public class CircleCursor<T> extends Object implements Cursor<T>
Each point of the circle is iterated exactly once, and there is no "hole" in the circle. Contrary to the algorithm linked below, the circles generated by this cursor are "slim": each pixel of the circle is connected with 8-connectivity. For instance, a bitmap excerpt from such a circle looks like this:
.......... OOO....... ...OO..... .....O.... .....O....
| Constructor and Description |
|---|
CircleCursor(RandomAccessible<T> rai,
Localizable center,
long radius)
Iterates over a Bresenham circle in the target
RandomAccessible. |
CircleCursor(RandomAccessible<T> rai,
Localizable center,
long radius,
int dimX,
int dimY)
Iterates over a Bresenham circle in the target
RandomAccessible. |
| Modifier and Type | Method and Description |
|---|---|
Cursor<T> |
copy() |
void |
fwd() |
T |
get() |
double |
getDoublePosition(int d) |
float |
getFloatPosition(int d) |
int |
getIntPosition(int d) |
long |
getLongPosition(int d) |
T |
getType() |
boolean |
hasNext() |
void |
jumpFwd(long steps) |
void |
localize(double[] position) |
void |
localize(float[] position) |
void |
localize(int[] position) |
void |
localize(long[] position) |
T |
next() |
int |
numDimensions() |
void |
reset() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcopyCursorforEachRemaining, removelocalize, localize, positionAsLongArray, positionAsPointpositionAsDoubleArray, positionAsRealPointpublic CircleCursor(RandomAccessible<T> rai, Localizable center, long radius)
RandomAccessible.
Each point of the circle is iterated exactly once, and there is no "hole"
in the circle.rai - the random accessible. It is the caller responsibility to
ensure it can be accessed everywhere the circle will be
iterated.center - the circle center. Must be at least of dimension 2. Dimensions
0 and 1 are used to specify the circle center.radius - the circle radius. The circle is written in a plane in
dimensions 0 and 1.public CircleCursor(RandomAccessible<T> rai, Localizable center, long radius, int dimX, int dimY)
RandomAccessible.
Each point of the circle is iterated exactly once, and there is no "hole"
in the circle.rai - the random accessible. It is the caller responsibility to
ensure it can be accessed everywhere the circle will be
iterated.center - the circle center. Must at least contain dimensions specified
dimX and dimY.radius - the circle radius.dimX - the first dimension of the plane in which to draw the circle.dimY - the second dimension of the plane in which to draw the circle.public void reset()
public void fwd()
public void localize(float[] position)
localize in interface RealLocalizablepublic void localize(double[] position)
localize in interface RealLocalizablepublic float getFloatPosition(int d)
getFloatPosition in interface LocalizablegetFloatPosition in interface RealLocalizablepublic double getDoublePosition(int d)
getDoublePosition in interface LocalizablegetDoublePosition in interface RealLocalizablepublic int numDimensions()
numDimensions in interface EuclideanSpacepublic T getType()
public void jumpFwd(long steps)
public T next()
public void localize(int[] position)
localize in interface Localizablepublic void localize(long[] position)
localize in interface Localizablepublic int getIntPosition(int d)
getIntPosition in interface Localizablepublic long getLongPosition(int d)
getLongPosition in interface LocalizableCopyright © 2009–2024 ImgLib2. All rights reserved.