Package gov.nih.mipav.model.algorithms
Class ContourPlot.Iterators.ImgAreaIterator<P extends ContourPlot.PixelBase>
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.ContourPlot.Iterators.ImgAreaIterator<P>
-
- Type Parameters:
P
- the pixel type of this iterator
- All Implemented Interfaces:
java.util.Iterator<P>
- Enclosing class:
- ContourPlot.Iterators
public static class ContourPlot.Iterators.ImgAreaIterator<P extends ContourPlot.PixelBase> extends java.lang.Object implements java.util.Iterator<P>
The standard iterator class for iterating over an area of an image.- Author:
- hageldave
-
-
Constructor Summary
Constructors Constructor Description ImgAreaIterator(int xStart, int yStart, int width, int height, P px)
Creates a new ImgAreaIterator for iterating the pixels in the specified area of an image.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forEachRemaining(java.util.function.Consumer<? super P> action)
boolean
hasNext()
P
next()
-
-
-
Field Detail
-
px
private final P extends ContourPlot.PixelBase px
-
xStart
private final int xStart
-
yStart
private final int yStart
-
width
private final int width
-
height
private final int height
-
x
private int x
-
y
private int y
-
-
Constructor Detail
-
ImgAreaIterator
public ImgAreaIterator(int xStart, int yStart, int width, int height, P px)
Creates a new ImgAreaIterator for iterating the pixels in the specified area of an image. The iterated image is the source of the specified pixel. The specified pixel will be reused on every invocation ofnext()
with incremented index.- Parameters:
xStart
- the left boundary of the area (inclusive)yStart
- the top boundary of the area (inclusive)width
- of the areaheight
- of the areapx
- the pixel used for iterating
-
-
Method Detail
-
next
public P next()
- Specified by:
next
in interfacejava.util.Iterator<P extends ContourPlot.PixelBase>
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<P extends ContourPlot.PixelBase>
-
forEachRemaining
public void forEachRemaining(java.util.function.Consumer<? super P> action)
- Specified by:
forEachRemaining
in interfacejava.util.Iterator<P extends ContourPlot.PixelBase>
-
-