Interface ContourPlot.ImgBase<P extends ContourPlot.PixelBase>

  • Type Parameters:
    P - the pixel type of the image
    All Superinterfaces:
    java.lang.Iterable<P>
    All Known Implementing Classes:
    ContourPlot.Img
    Enclosing class:
    ContourPlot

    public static interface ContourPlot.ImgBase<P extends ContourPlot.PixelBase>
    extends java.lang.Iterable<P>
    Base interface for imagingkit's Img classes.

    This interface defines the most basic methods like getting the dimensions of an image and converting an image to BufferedImage.

    Appart from that it defines and implements all the Iterable functionality which is based on ContourPlot.PixelBase. The Iterable Functionality also comprises Spliterators as well as the forEach(Consumer) and stream() functionality.

    The Graphics2D related functionality like createGraphics() and paint(Consumer) is by default based on getRemoteBufferedImage(). If it is possible to create a remote BufferedImage from the implemented data structure, the method should be overridden to enable the mentioned funtionality.

    Since:
    2.0
    Author:
    hageldave
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default java.util.Spliterator<P> colSpliterator()
      Creates a Spliterator that guarantees that each split will at least cover an entire column of the Img.
      ContourPlot.ImgBase<P> copy()
      Returns a deep copy of this image.
      default java.awt.Graphics2D createGraphics()
      Creates a Graphics2D, which can be used to draw into this image.
      default <T> void forEach​(boolean parallel, int xStart, int yStart, int width, int height, ContourPlot.PixelManipulator<? super P,​T> manipulator)
      Applies the specified manipulator to every pixel in the specified area of this image.
      default void forEach​(boolean parallel, int xStart, int yStart, int width, int height, java.util.function.Consumer<? super P> action)
      Applies the specified action to every pixel in the specified area of this image.
      default <T> void forEach​(boolean parallel, ContourPlot.PixelManipulator<? super P,​T> manipulator)
      Applies the specified manipulator to every pixel of this image.
      default void forEach​(boolean parallel, java.util.function.Consumer<? super P> action)
      Performs the specified action on each of the pixels of this image.
      default <T> void forEach​(int xStart, int yStart, int width, int height, ContourPlot.PixelManipulator<? super P,​T> manipulator)
      Applies the specified manipulator to every pixel in the specified area of this image.
      default void forEach​(int xStart, int yStart, int width, int height, java.util.function.Consumer<? super P> action)
      Applies the specified action to every pixel in the specified area of this image.
      default <T> void forEach​(ContourPlot.PixelConvertingSpliterator.PixelConverter<? super P,​T> converter, boolean parallel, int xStart, int yStart, int width, int height, java.util.function.Consumer<? super T> action)
      Applies the specified action to every pixel in the specified area of this image.
      default <T> void forEach​(ContourPlot.PixelConvertingSpliterator.PixelConverter<? super P,​T> converter, boolean parallel, java.util.function.Consumer<? super T> action)
      Applies the specified action to every pixel of this image.
      default <T> void forEach​(ContourPlot.PixelManipulator<? super P,​T> manipulator)
      Applies the specified manipulator to every pixel of this image.
      default void forEach​(java.util.function.Consumer<? super P> action)
      Performs the specified action on each of the pixels of this image.
      default void forEach_defaultimpl​(java.util.function.Consumer<? super P> action)
      Default implementation of Iterable.forEach(Consumer)
      only for performance test purposes as it is slower than the forEach(Consumer) implementation.
      default java.awt.Dimension getDimension()  
      int getHeight()  
      P getPixel()
      Creates a new pixel object (instance of ContourPlot.PixelBase) for this Img with initial position (0,0) i.e. top left corner.
      P getPixel​(int x, int y)
      Creates a new Pixel object for this Img at specified position
      default java.awt.image.BufferedImage getRemoteBufferedImage()
      Creates a BufferedImage that shares the data of this image.
      default int getSpliteratorMinimumSplitSize()
      Returns the minimum number of elements in a split of a Spliterator of this Img.
      int getWidth()  
      default java.util.Iterator<P> iterator()
      Returns an iterator over the pixels of this image.
      default java.util.Iterator<P> iterator​(int xStart, int yStart, int width, int height)
      Returns an Iterator for the specified area of the image.
      default int numValues()  
      default void paint​(java.util.function.Consumer<java.awt.Graphics2D> paintInstructions)
      Uses the specified paintInstructions to draw into this image.
      default java.util.Spliterator<P> rowSpliterator()
      Creates a Spliterator that guarantees that each split will at least cover an entire row of the Img.
      default java.util.Spliterator<P> spliterator()
      Returns a Spliterator over the pixels of this image.
      default java.util.Spliterator<P> spliterator​(int xStart, int yStart, int width, int height)
      Creates a Spliterator over the pixels within the specified area.
      default java.util.stream.Stream<P> stream()
      Returns a sequential Stream of pixels of this image.
      default java.util.stream.Stream<P> stream​(boolean parallel)
      Returns a Stream of pixels of this image.
      default java.util.stream.Stream<P> stream​(boolean parallel, int xStart, int yStart, int width, int height)
      Returns a Pixel Stream for the specified area of this Img.
      This Img's spliterator(int,int,int,int) is used to create the Stream.
      default java.util.stream.Stream<P> stream​(int xStart, int yStart, int width, int height)
      Returns a Pixel Stream for the specified area of this Img.
      This Img's spliterator(int,int,int,int) is used to create the Stream.
      default <T> java.util.stream.Stream<T> stream​(ContourPlot.PixelConvertingSpliterator.PixelConverter<? super P,​T> converter, boolean parallel)
      Returns a Stream of the specified ContourPlot.PixelConvertingSpliterator.PixelConverter's element type over the pixels of this image.
      default <T> java.util.stream.Stream<T> stream​(ContourPlot.PixelConvertingSpliterator.PixelConverter<? super P,​T> converter, boolean parallel, int xStart, int yStart, int width, int height)
      Returns a Stream of the specified ContourPlot.PixelConvertingSpliterator.PixelConverter's element type over the pixels of this image within the specified area.
      static <Px extends ContourPlot.PixelBase>
      java.util.stream.Stream<Px>
      stream​(java.util.Spliterator<Px> spliterator, boolean parallel)
      Returns a Stream<Pixel> for the specified Spliterator<Pixel>.
      default boolean supportsRemoteBufferedImage()
      Returns true when this implementation of ContourPlot.ImgBase supports the getRemoteBufferedImage() method.
      default java.awt.image.BufferedImage toBufferedImage()  
      java.awt.image.BufferedImage toBufferedImage​(java.awt.image.BufferedImage bimg)
      Copies this image's data to the specified BufferedImage.