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 Iterablefunctionality which is based onContourPlot.PixelBase. The Iterable Functionality also comprisesSpliterators as well as theforEach(Consumer)andstream()functionality.The Graphics2Drelated functionality likecreateGraphics()andpaint(Consumer)is by default based ongetRemoteBufferedImage(). 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 SummaryAll Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Spliterator<P>colSpliterator()Creates aSpliteratorthat 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.Graphics2DcreateGraphics()Creates aGraphics2D, which can be used to draw into this image.default <T> voidforEach(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 voidforEach(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> voidforEach(boolean parallel, ContourPlot.PixelManipulator<? super P,T> manipulator)Applies the specified manipulator to every pixel of this image.default voidforEach(boolean parallel, java.util.function.Consumer<? super P> action)Performs the specified action on each of the pixels of this image.default <T> voidforEach(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 voidforEach(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> voidforEach(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> voidforEach(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> voidforEach(ContourPlot.PixelManipulator<? super P,T> manipulator)Applies the specified manipulator to every pixel of this image.default voidforEach(java.util.function.Consumer<? super P> action)Performs the specified action on each of the pixels of this image.default voidforEach_defaultimpl(java.util.function.Consumer<? super P> action)Default implementation ofIterable.forEach(Consumer)
 only for performance test purposes as it is slower than theforEach(Consumer)implementation.default java.awt.DimensiongetDimension()intgetHeight()PgetPixel()Creates a new pixel object (instance ofContourPlot.PixelBase) for this Img with initial position (0,0) i.e. top left corner.PgetPixel(int x, int y)Creates a new Pixel object for this Img at specified positiondefault java.awt.image.BufferedImagegetRemoteBufferedImage()Creates aBufferedImagethat shares the data of this image.default intgetSpliteratorMinimumSplitSize()Returns the minimum number of elements in a split of aSpliteratorof this Img.intgetWidth()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 anIteratorfor the specified area of the image.default intnumValues()default voidpaint(java.util.function.Consumer<java.awt.Graphics2D> paintInstructions)Uses the specified paintInstructions to draw into this image.default java.util.Spliterator<P>rowSpliterator()Creates aSpliteratorthat guarantees that each split will at least cover an entire row of the Img.default java.util.Spliterator<P>spliterator()Returns aSpliteratorover the pixels of this image.default java.util.Spliterator<P>spliterator(int xStart, int yStart, int width, int height)Creates aSpliteratorover the pixels within the specified area.default java.util.stream.Stream<P>stream()Returns a sequentialStreamof pixels of this image.default java.util.stream.Stream<P>stream(boolean parallel)Returns aStreamof pixels of this image.default java.util.stream.Stream<P>stream(boolean parallel, int xStart, int yStart, int width, int height)Returns a PixelStreamfor the specified area of this Img.
 This Img'sspliterator(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 PixelStreamfor the specified area of this Img.
 This Img'sspliterator(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 aStreamof the specifiedContourPlot.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 aStreamof the specifiedContourPlot.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 aStream<Pixel>for the specifiedSpliterator<Pixel>.default booleansupportsRemoteBufferedImage()Returns true when this implementation ofContourPlot.ImgBasesupports thegetRemoteBufferedImage()method.default java.awt.image.BufferedImagetoBufferedImage()java.awt.image.BufferedImagetoBufferedImage(java.awt.image.BufferedImage bimg)Copies this image's data to the specifiedBufferedImage.
 
- 
- 
- 
Method Detail- 
getDimensiondefault java.awt.Dimension getDimension() - Returns:
- the dimension (width,height) of this image
- See Also:
- getWidth(),- getHeight(),- numValues()
 
 - 
getWidthint getWidth() - Returns:
- the width of this image (number of pixels in horizontal direction)
- See Also:
- getHeight(),- getDimension(),- numValues()
 
 - 
getHeightint getHeight() - Returns:
- the height of this image (number of pixels in vertical direction)
- See Also:
- getWidth(),- getDimension(),- numValues()
 
 - 
numValuesdefault int numValues() - Returns:
- the number of pixels of this image
- See Also:
- getWidth(),- getHeight(),- getDimension()
 
 - 
getPixelP getPixel() Creates a new pixel object (instance ofContourPlot.PixelBase) for this Img with initial position (0,0) i.e. top left corner.Tip: 
 Do not use this method repeatedly while iterating the image. UseContourPlot.PixelBase.setPosition(int, int)instead to avoid excessive allocation of pixel objects.
 You can also usefor(PixelBase px: img){...}syntax or theforEach(Consumer)method to iterate this image.- Returns:
- a pixel object for this image.
- See Also:
- getPixel(int, int)
 
 - 
getPixelP getPixel(int x, int y) Creates a new Pixel object for this Img at specified position. (0,0) is the top left corner, (width-1,height-1) is the bottom right corner.Tip: 
 Do not use this method repeatedly while iterating the image. UseContourPlot.PixelBase.setPosition(int, int)instead to avoid excessive allocation of pixel objects.
 You can also usefor(PixelBase px: img){...}syntax or theforEach(Consumer)method to iterate this image.- Parameters:
- x- coordinate
- y- coordinate
- Returns:
- a Pixel object for this Img at {x,y}.
- See Also:
- getPixel()
 
 - 
toBufferedImagejava.awt.image.BufferedImage toBufferedImage(java.awt.image.BufferedImage bimg) Copies this image's data to the specifiedBufferedImage. This method will preserve theRasterof the specified BufferedImage and will only modify the contents of it.- Parameters:
- bimg- the BufferedImage
- Returns:
- the specified BufferedImage
- Throws:
- java.lang.IllegalArgumentException- if the provided BufferedImage has a different dimension as this image.
- See Also:
- toBufferedImage(),- getRemoteBufferedImage()
 
 - 
toBufferedImagedefault java.awt.image.BufferedImage toBufferedImage() - Returns:
- a BufferedImage of type INT_ARGB with this Img's data copied to it.
- See Also:
- toBufferedImage(BufferedImage),- getRemoteBufferedImage()
 
 - 
getRemoteBufferedImagedefault java.awt.image.BufferedImage getRemoteBufferedImage() Creates aBufferedImagethat shares the data of this image. Changes in this image are reflected in the created BufferedImage and vice versa. TheColorModelandRasterof the resulting BufferedImage are implementation dependent.This operation may not be supported by an implementation of ContourPlot.ImgBaseand will then throw anUnsupportedOperationException. UsesupportsRemoteBufferedImage()to check if this operation is supported.- Returns:
- BufferedImage sharing this Img's data.
- Throws:
- java.lang.UnsupportedOperationException- if this implementation of- ContourPlot.ImgBasedoes not support this method.
- See Also:
- supportsRemoteBufferedImage(),- toBufferedImage(BufferedImage),- toBufferedImage()
 
 - 
supportsRemoteBufferedImagedefault boolean supportsRemoteBufferedImage() Returns true when this implementation ofContourPlot.ImgBasesupports thegetRemoteBufferedImage()method. This by default also indicates the support for the following methods:- Returns:
- true when supported, false otherwise.
 
 - 
createGraphicsdefault java.awt.Graphics2D createGraphics() Creates aGraphics2D, which can be used to draw into this image.
 This operation may not be supported by an implementation ofContourPlot.ImgBaseand will then throw anUnsupportedOperationException. UsesupportsRemoteBufferedImage()to check if this operation is supported.- Returns:
- Graphics2D object to draw into this image.
- Throws:
- java.lang.UnsupportedOperationException- if this implementation of- ContourPlot.ImgBasedoes not support this method.
- See Also:
- supportsRemoteBufferedImage(),- paint(Consumer)
 
 - 
paintdefault void paint(java.util.function.Consumer<java.awt.Graphics2D> paintInstructions) Uses the specified paintInstructions to draw into this image. This method will pass aGraphics2Dobject of this image to the specifiedConsumer. TheConsumer.accept(Object)method can then draw into this image. When the accept method returns, the Graphics2D object is disposed.This operation may not be supported by an implementation of ContourPlot.ImgBaseand will then throw anUnsupportedOperationException. UsesupportsRemoteBufferedImage()to check if this operation is supported.Example (using lambda expression for Consumers accept method): Img img = new Img(100, 100); img.paint( g2d -> { g2d.drawLine(0, 0, 100, 100); } );- Parameters:
- paintInstructions- to be executed on a Graphics2D object of this image of this Img.
- Throws:
- java.lang.UnsupportedOperationException- if this implementation of- ContourPlot.ImgBasedoes not support this method.
- Since:
- 1.3
- See Also:
- createGraphics()
 
 - 
iteratordefault java.util.Iterator<P> iterator() Returns an iterator over the pixels of this image. The iterator will always return the same object on next() but with different index (thus referencing different values in the image).- Specified by:
- iteratorin interface- java.lang.Iterable<P extends ContourPlot.PixelBase>
- Returns:
- an iterator over the pixels of this image.
- See Also:
- iterator(int, int, int, int),- spliterator(),- spliterator(int, int, int, int)
 
 - 
getSpliteratorMinimumSplitSizedefault int getSpliteratorMinimumSplitSize() Returns the minimum number of elements in a split of aSpliteratorof this Img. Spliterators will only split if they contain more elements than specified by this value. Default is 1024.- Returns:
- minimum number of elements of a Spliterator to allow for splitting.
 
 - 
iteratordefault java.util.Iterator<P> iterator(int xStart, int yStart, int width, int height) Returns anIteratorfor the specified area of the image. The Iterator will always return the same pixel object on next() but with different index (thus referencing different values in the image).- Parameters:
- xStart- left boundary of the area (inclusive)
- yStart- upper boundary of the area (inclusive)
- width- of the area
- height- of the area
- Returns:
- iterator for iterating over the pixels in the specified area.
- Throws:
- java.lang.IllegalArgumentException- if provided area is not within this image's bounds, or if the area is not positive (width or height ≤ 0).
- See Also:
- iterator(),- spliterator(),- spliterator(int, int, int, int)
 
 - 
spliteratordefault java.util.Spliterator<P> spliterator() Returns aSpliteratorover the pixels of this image. Within each split of the Spliterator a unique pixel object will be used on tryAdvance() but with changing index (thus referencing different values in the image).- Specified by:
- spliteratorin interface- java.lang.Iterable<P extends ContourPlot.PixelBase>
- Returns:
- a Spliterator over the pixels of this image
- See Also:
- spliterator(int, int, int, int),- rowSpliterator(),- colSpliterator(),- iterator(),- iterator(int, int, int, int)
 
 - 
rowSpliteratordefault java.util.Spliterator<P> rowSpliterator() Creates aSpliteratorthat guarantees that each split will at least cover an entire row of the Img. It also guarantes that each row will be iterated starting at the least index of that row (e.g.starts at index 0 then continues with index 1, then 2, until the end of the row, then continuing with the next row). This Spliterator iterates in row-major order.- Returns:
- Spliterator that splits at beginning of rows.
- See Also:
- colSpliterator(),- spliterator(),- stream(Spliterator, boolean),- stream(PixelConverter, boolean)
 
 - 
colSpliteratordefault java.util.Spliterator<P> colSpliterator() Creates aSpliteratorthat guarantees that each split will at least cover an entire column of the Img. It also guarantes that each column will be iterated starting at the least index of that column (e.g.starts at index 0 then continues with index 1, then 2, until the end of the column, then continuing with the next column). This Spliterator iterates in column-major order.- Returns:
- Spliterator that splits at beginning of columns.
- See Also:
- rowSpliterator(),- spliterator(),- stream(Spliterator, boolean),- stream(PixelConverter, boolean)
 
 - 
spliteratordefault java.util.Spliterator<P> spliterator(int xStart, int yStart, int width, int height) Creates aSpliteratorover the pixels within the specified area.- Parameters:
- xStart- left boundary of the area (inclusive)
- yStart- upper boundary of the area (inclusive)
- width- of the area
- height- of the area
- Returns:
- spliterator for the specified area.
- Throws:
- java.lang.IllegalArgumentException- if provided area is not within this image's bounds, or if the area is not positive (width or height ≤ 0).
- See Also:
- spliterator(),- colSpliterator(),- rowSpliterator(),- stream(Spliterator, boolean),- stream(PixelConverter, boolean)
 
 - 
forEach_defaultimpldefault void forEach_defaultimpl(java.util.function.Consumer<? super P> action) Default implementation ofIterable.forEach(Consumer)
 only for performance test purposes as it is slower than theforEach(Consumer)implementation.- Parameters:
- action- to be performed
 
 - 
forEachdefault void forEach(java.util.function.Consumer<? super P> action) Performs the specified action on each of the pixels of this image.- Specified by:
- forEachin interface- java.lang.Iterable<P extends ContourPlot.PixelBase>
- Parameters:
- action- to be performed
- Since:
- 1.0
- See Also:
- forEach(PixelManipulator),- forEach(boolean, Consumer),- forEach(boolean, PixelManipulator),- forEach(PixelConverter, boolean, Consumer),- forEach(int, int, int, int, Consumer),- forEach(int, int, int, int, PixelManipulator),- forEach(boolean, int, int, int, int, Consumer),- forEach(boolean, int, int, int, int, PixelManipulator),- forEach(PixelConverter, boolean, int, int, int, int, Consumer),- stream()
 
 - 
forEachdefault void forEach(boolean parallel, java.util.function.Consumer<? super P> action)Performs the specified action on each of the pixels of this image.- Parameters:
- parallel- whether to be performed in parallel
- action- to be performed
- See Also:
- forEach(Consumer),- forEach(PixelManipulator),- forEach(boolean, Consumer),- forEach(boolean, PixelManipulator),- forEach(PixelConverter, boolean, Consumer),- forEach(int, int, int, int, Consumer),- forEach(int, int, int, int, PixelManipulator),- forEach(boolean, int, int, int, int, Consumer),- forEach(boolean, int, int, int, int, PixelManipulator),- forEach(PixelConverter, boolean, int, int, int, int, Consumer),- stream()
 
 - 
forEachdefault 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.- Parameters:
- xStart- left boundary of the area (inclusive)
- yStart- upper boundary of the area (inclusive)
- width- of the area
- height- of the area
- action- to be performed on each pixel
- Throws:
- java.lang.IllegalArgumentException- if provided area is not within this images's bounds.
- See Also:
- forEach(Consumer),- forEach(PixelManipulator),- forEach(boolean, Consumer),- forEach(boolean, PixelManipulator),- forEach(PixelConverter, boolean, Consumer),- forEach(int, int, int, int, Consumer),- forEach(int, int, int, int, PixelManipulator),- forEach(boolean, int, int, int, int, Consumer),- forEach(boolean, int, int, int, int, PixelManipulator),- forEach(PixelConverter, boolean, int, int, int, int, Consumer),- stream()
 
 - 
forEachdefault 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.- Parameters:
- parallel- whether to be performed in parallel
- xStart- left boundary of the area (inclusive)
- yStart- upper boundary of the area (inclusive)
- width- of the area
- height- of the area
- action- to be performed on each pixel
- Throws:
- java.lang.IllegalArgumentException- if provided area is not within this images's bounds, or if the area is not positive (width or height ≤ 0).
- See Also:
- forEach(Consumer),- forEach(PixelManipulator),- forEach(boolean, Consumer),- forEach(boolean, PixelManipulator),- forEach(PixelConverter, boolean, Consumer),- forEach(int, int, int, int, Consumer),- forEach(int, int, int, int, PixelManipulator),- forEach(boolean, int, int, int, int, Consumer),- forEach(boolean, int, int, int, int, PixelManipulator),- forEach(PixelConverter, boolean, int, int, int, int, Consumer),- stream()
 
 - 
forEachdefault <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. Prior to applying the action, each time the pixel is converted using the specified converter. The action is then performed on an instance of the element type of the converter (which is also the type accepted by the action). Finally the modified instance is then converted back to the pixel.- Type Parameters:
- T- converter's element type
- Parameters:
- converter- that converts the pixel to the type accepted by the action
- parallel- whether to be performed in parallel
- action- to be performed on each pixel
- See Also:
- forEach(Consumer),- forEach(PixelManipulator),- forEach(boolean, Consumer),- forEach(boolean, PixelManipulator),- forEach(PixelConverter, boolean, Consumer),- forEach(int, int, int, int, Consumer),- forEach(int, int, int, int, PixelManipulator),- forEach(boolean, int, int, int, int, Consumer),- forEach(boolean, int, int, int, int, PixelManipulator),- forEach(PixelConverter, boolean, int, int, int, int, Consumer),- stream()
 
 - 
forEachdefault <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. Prior to applying the action, each time the pixel is converted using the specified converter. The action is then performed on an instance of the element type of the converter (which is also the type accepted by the action). Finally the modified instance is then converted back to the pixel.- Type Parameters:
- T- converter's element type
- Parameters:
- converter- that converts the pixel to the type accepted by the action
- parallel- whether to be performed in parallel
- xStart- left boundary of the area (inclusive)
- yStart- upper boundary of the area (inclusive)
- width- of the area
- height- of the area
- action- to be performed on each pixel
- Throws:
- java.lang.IllegalArgumentException- if provided area is not within this images's bounds, or if the area is not positive (width or height ≤ 0).
- See Also:
- forEach(Consumer),- forEach(PixelManipulator),- forEach(boolean, Consumer),- forEach(boolean, PixelManipulator),- forEach(PixelConverter, boolean, Consumer),- forEach(int, int, int, int, Consumer),- forEach(int, int, int, int, PixelManipulator),- forEach(boolean, int, int, int, int, Consumer),- forEach(boolean, int, int, int, int, PixelManipulator),- forEach(PixelConverter, boolean, int, int, int, int, Consumer),- stream()
 
 - 
forEachdefault <T> void forEach(ContourPlot.PixelManipulator<? super P,T> manipulator) Applies the specified manipulator to every pixel of this image.- Type Parameters:
- T- manipulator's element type
- Parameters:
- manipulator- that will be applied
- See Also:
- forEach(Consumer),- forEach(PixelManipulator),- forEach(boolean, Consumer),- forEach(boolean, PixelManipulator),- forEach(PixelConverter, boolean, Consumer),- forEach(int, int, int, int, Consumer),- forEach(int, int, int, int, PixelManipulator),- forEach(boolean, int, int, int, int, Consumer),- forEach(boolean, int, int, int, int, PixelManipulator),- forEach(PixelConverter, boolean, int, int, int, int, Consumer),- stream()
 
 - 
forEachdefault <T> void forEach(boolean parallel, ContourPlot.PixelManipulator<? super P,T> manipulator)Applies the specified manipulator to every pixel of this image.- Type Parameters:
- T- manipulator's element type
- Parameters:
- parallel- whether to be performed in parallel
- manipulator- that will be applied
- See Also:
- forEach(Consumer),- forEach(PixelManipulator),- forEach(boolean, Consumer),- forEach(boolean, PixelManipulator),- forEach(PixelConverter, boolean, Consumer),- forEach(int, int, int, int, Consumer),- forEach(int, int, int, int, PixelManipulator),- forEach(boolean, int, int, int, int, Consumer),- forEach(boolean, int, int, int, int, PixelManipulator),- forEach(PixelConverter, boolean, int, int, int, int, Consumer),- stream()
 
 - 
forEachdefault <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.- Type Parameters:
- T- manipulator's element type
- Parameters:
- xStart- left boundary of the area (inclusive)
- yStart- upper boundary of the area (inclusive)
- width- of the area
- height- of the area
- manipulator- that will be applied
- Throws:
- java.lang.IllegalArgumentException- if provided area is not within this images's bounds.
- See Also:
- forEach(Consumer),- forEach(PixelManipulator),- forEach(boolean, Consumer),- forEach(boolean, PixelManipulator),- forEach(PixelConverter, boolean, Consumer),- forEach(int, int, int, int, Consumer),- forEach(int, int, int, int, PixelManipulator),- forEach(boolean, int, int, int, int, Consumer),- forEach(boolean, int, int, int, int, PixelManipulator),- forEach(PixelConverter, boolean, int, int, int, int, Consumer),- stream()
 
 - 
forEachdefault <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.- Type Parameters:
- T- manipulator's element type
- Parameters:
- parallel- whether to be performed in parallel
- xStart- left boundary of the area (inclusive)
- yStart- upper boundary of the area (inclusive)
- width- of the area
- height- of the area
- manipulator- that will be applied
- Throws:
- java.lang.IllegalArgumentException- if provided area is not within this images's bounds.
- See Also:
- forEach(Consumer),- forEach(PixelManipulator),- forEach(boolean, Consumer),- forEach(boolean, PixelManipulator),- forEach(PixelConverter, boolean, Consumer),- forEach(int, int, int, int, Consumer),- forEach(int, int, int, int, PixelManipulator),- forEach(boolean, int, int, int, int, Consumer),- forEach(boolean, int, int, int, int, PixelManipulator),- forEach(PixelConverter, boolean, int, int, int, int, Consumer),- stream()
 
 - 
streamstatic <Px extends ContourPlot.PixelBase> java.util.stream.Stream<Px> stream(java.util.Spliterator<Px> spliterator, boolean parallel) Returns aStream<Pixel>for the specifiedSpliterator<Pixel>. This is just a wrapper method arroundStreamSupport.stream(Spliterator, boolean)mainly used as syntactic sugar for the use with the non default Spliterators (rowSpliterator()andcolSpliterator(). When the default spliterator of the Img is sufficient the non-staticstream()can be used.For example (horizontal edge detection in parallel using forward difference): Img myImg = ...; ImgBase.stream(myImg.rowSpliterator(), true).forEach( px -> { int next = px.getImg().getValue(px.getX()+1, px.getY(), Img.boundary_mode_repeat_edge); int forwardDiff = Math.abs( Pixel.getLuminance(next) - px.getLuminance() ); px.setRGB(forwardDiff, forwardDiff, forwardDiff); });- Type Parameters:
- Px- pixel type of the stream
- Parameters:
- spliterator- Spliterator of Img to be streamed
- parallel- whether parallel or sequential stream is returned
- Returns:
- a new sequential or parallel pixel stream.
- See Also:
- stream()
 
 - 
streamdefault java.util.stream.Stream<P> stream() Returns a sequentialStreamof pixels of this image. This Img'sspliterator()is used to create the Stream.The elements of this stream are not distinct! 
 This is due to aContourPlot.PixelBaseobject being a pointer into the data of the image and not a pixel value itself. While streaming the index of the pixel object is changed for each actual pixel of the image.
 Thus, a Set created by the expressionimg.stream().collect(Collectors.toSet())will only contain a single element.- Returns:
- pixel Stream of this image.
- See Also:
- stream(),- stream(boolean parallel),- stream(int x, int y, int w, int h),- stream(boolean parallel, int x, int y, int w, int h),- stream(PixelConverter c, boolean parallel),- stream(PixelConverter c, boolean parallel, int x, int y, int w, int h),- stream(Spliterator spliterator, boolean parallel),- forEach(Consumer action)
 
 - 
streamdefault java.util.stream.Stream<P> stream(boolean parallel) Returns aStreamof pixels of this image. Depending on the specified argument, the stream will be parallel or sequential. This Img'sspliterator()is used to create the Stream.The elements of this stream are not distinct! 
 This is due to aContourPlot.PixelBaseobject being a pointer into the data of the image and not a pixel value itself. While streaming the index of the pixel object is changed for each actual pixel of the image.
 Thus, a Set created by the expressionimg.stream().collect(Collectors.toSet())will only contain a single element.- Parameters:
- parallel- whether the stream is parallel (true) or sequential (false)
- Returns:
- pixel Stream of this image.
- See Also:
- stream(),- stream(boolean parallel),- stream(int x, int y, int w, int h),- stream(boolean parallel, int x, int y, int w, int h),- stream(PixelConverter c, boolean parallel),- stream(PixelConverter c, boolean parallel, int x, int y, int w, int h),- stream(Spliterator spliterator, boolean parallel),- forEach(Consumer action)
 
 - 
streamdefault java.util.stream.Stream<P> stream(int xStart, int yStart, int width, int height) Returns a PixelStreamfor the specified area of this Img.
 This Img'sspliterator(int,int,int,int)is used to create the Stream.- Parameters:
- xStart- left boundary of the area (inclusive)
- yStart- upper boundary of the area (inclusive)
- width- of the area
- height- of the area
- Returns:
- Pixel Stream for specified area.
- Throws:
- java.lang.IllegalArgumentException- if provided area is not within this Img's bounds.
- See Also:
- stream(),- stream(boolean parallel),- stream(int x, int y, int w, int h),- stream(boolean parallel, int x, int y, int w, int h),- stream(PixelConverter c, boolean parallel),- stream(PixelConverter c, boolean parallel, int x, int y, int w, int h),- stream(Spliterator spliterator, boolean parallel),- forEach(Consumer action)
 
 - 
streamdefault java.util.stream.Stream<P> stream(boolean parallel, int xStart, int yStart, int width, int height) Returns a PixelStreamfor the specified area of this Img.
 This Img'sspliterator(int,int,int,int)is used to create the Stream.- Parameters:
- parallel- whether the stream is parallel (true) or sequential (false)
- xStart- left boundary of the area (inclusive)
- yStart- upper boundary of the area (inclusive)
- width- of the area
- height- of the area
- Returns:
- Pixel Stream for specified area.
- Throws:
- java.lang.IllegalArgumentException- if provided area is not within this image's bounds.
- See Also:
- stream(),- stream(boolean parallel),- stream(int x, int y, int w, int h),- stream(boolean parallel, int x, int y, int w, int h),- stream(PixelConverter c, boolean parallel),- stream(PixelConverter c, boolean parallel, int x, int y, int w, int h),- stream(Spliterator spliterator, boolean parallel),- forEach(Consumer action)
 
 - 
streamdefault <T> java.util.stream.Stream<T> stream(ContourPlot.PixelConvertingSpliterator.PixelConverter<? super P,T> converter, boolean parallel) Returns aStreamof the specifiedContourPlot.PixelConvertingSpliterator.PixelConverter's element type over the pixels of this image. Each pixel will be converted to the element type before being processed, and the element will be back converted to the pixel after processing. The conversion and back conversion is handled by the specified converter.- Type Parameters:
- T- converter's element type
- Parameters:
- converter- that determines the element type of the stream and handles conversion/back conversion
- parallel- whether the stream is parallel (true) or sequential (false)
- Returns:
- a Stream over the pixels of this image in the representation given by the specified converter.
- See Also:
- stream(),- stream(boolean parallel),- stream(int x, int y, int w, int h),- stream(boolean parallel, int x, int y, int w, int h),- stream(PixelConverter c, boolean parallel),- stream(PixelConverter c, boolean parallel, int x, int y, int w, int h),- stream(Spliterator spliterator, boolean parallel),- forEach(boolean, PixelManipulator),- forEach(PixelConverter, boolean, Consumer)
 
 - 
streamdefault <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 aStreamof the specifiedContourPlot.PixelConvertingSpliterator.PixelConverter's element type over the pixels of this image within the specified area. Each pixel will be converted to the element type before being processed, and the element will be back converted to the pixel after processing. The conversion and back conversion is handled by the specified converter.- Type Parameters:
- T- converter's element type
- Parameters:
- converter- that determines the element type of the stream and handles conversion/back conversion
- parallel- whether the stream is parallel (true) or sequential (false)
- xStart- left boundary of the area (inclusive)
- yStart- upper boundary of the area (inclusive)
- width- of the area
- height- of the area
- Returns:
- a Stream over the pixels in the specified area of this image in the representation given by the specified converter.
- Throws:
- java.lang.IllegalArgumentException- if provided area is not within this image's bounds.
- See Also:
- stream(),- stream(boolean parallel),- stream(int x, int y, int w, int h),- stream(boolean parallel, int x, int y, int w, int h),- stream(PixelConverter c, boolean parallel),- stream(PixelConverter c, boolean parallel, int x, int y, int w, int h),- stream(Spliterator spliterator, boolean parallel),- forEach(boolean parallel, int x, int y, int w, int h, PixelManipulator m),- forEach(PixelConverter c, boolean parallel, int x, int y, int w, int h, Consumer action)
 
 - 
copyContourPlot.ImgBase<P> copy() Returns a deep copy of this image. 'Deep' means that changes made to this image are NOT reflected in the copy.- Returns:
- a deep copy.
 
 
- 
 
-