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 Details

    • 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 element
      element - 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 value
      px - 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 (see allocateElement())
      pixelToElement - a consumer that sets the contents of the element according to a pixel (see convertPixelToElement(PixelBase, Object))
      elementToPixel - a consumer that sets the content of a pixel according to the element (see convertElementToPixel(Object, PixelBase))
      Returns:
      a new PixelConverter