Package gov.nih.mipav.model.algorithms
Interface ContourPlot.PixelConvertingSpliterator.PixelConverter<P extends ContourPlot.PixelBase,T>
- Enclosing class:
ContourPlot.PixelConvertingSpliterator<P extends ContourPlot.PixelBase,T>
public static interface ContourPlot.PixelConvertingSpliterator.PixelConverter<P extends ContourPlot.PixelBase,T>
-
Method Summary
Modifier and TypeMethodDescriptionAllocates a new element for the PixelConvertingSpliterator (will be called once per split)voidconvertElementToPixel(T element, P px) converts the specified element back to the specified pixel (set pixel value according to element).voidconvertPixelToElement(P px, T element) converts the specified pixel to the specified element (initiliazation of previously allocated element).static <P extends ContourPlot.PixelBase,T>
ContourPlot.PixelConvertingSpliterator.PixelConverter<P, T> fromFunctions(Supplier<T> allocator, BiConsumer<P, T> pixelToElement, BiConsumer<T, P> elementToPixel) Creates a new PixelConverter from the specified functions.
-
Method Details
-
allocateElement
T allocateElement()Allocates a new element for the PixelConvertingSpliterator (will be called once per split)- Returns:
- element, probably in uninitialized state
-
convertPixelToElement
converts the specified pixel to the specified element (initiliazation of previously allocated element).
NOT ALLOCATION, ONLY SETUP OF THE ELEMENT- Parameters:
px- to used for setting up the elementelement- to be set up
-
convertElementToPixel
converts the specified element back to the specified pixel (set pixel value according to element).
NOT ALLOCATION, ONLY SETTING THE PIXEL VALUE ACCORDINGLY- Parameters:
element- to be used for setting the pixel valuepx- to be set
-
fromFunctions
static <P extends ContourPlot.PixelBase,T> ContourPlot.PixelConvertingSpliterator.PixelConverter<P,T> fromFunctions(Supplier<T> allocator, BiConsumer<P, T> pixelToElement, BiConsumer<T, P> elementToPixel) Creates a new PixelConverter from the specified functions.- Parameters:
allocator- a supplier that allocates a new object of the element type (seeallocateElement())pixelToElement- a consumer that sets the contents of the element according to a pixel (seeconvertPixelToElement(PixelBase, Object))elementToPixel- a consumer that sets the content of a pixel according to the element (seeconvertElementToPixel(Object, PixelBase))- Returns:
- a new PixelConverter
-