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
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description TallocateElement()Allocates 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(java.util.function.Supplier<T> allocator, java.util.function.BiConsumer<P,T> pixelToElement, java.util.function.BiConsumer<T,P> elementToPixel)Creates a new PixelConverter from the specified functions.
-
-
-
Method Detail
-
allocateElement
T allocateElement()
Allocates a new element for the PixelConvertingSpliterator (will be called once per split)- Returns:
- element, probably in uninitialized state
-
convertPixelToElement
void convertPixelToElement(P px, T element)
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
void convertElementToPixel(T element, P px)
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(java.util.function.Supplier<T> allocator, java.util.function.BiConsumer<P,T> pixelToElement, java.util.function.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
-
-