public interface Localizable extends RealLocalizable
Localizable
interface can localize itself in an n-dimensional
discrete space. Not only Cursor
s can use this interface, it might be
used by much more classes as RandomAccess
s can take any
Localizable
as input for where they should move to.Modifier and Type | Method and Description |
---|---|
default double |
getDoublePosition(int d)
Return the current position in a given dimension.
|
default float |
getFloatPosition(int d)
Return the current position in a given dimension.
|
default int |
getIntPosition(int d)
Return the current position in a given dimension.
|
long |
getLongPosition(int d)
Return the current position in a given dimension.
|
default void |
localize(int[] position)
Write the current position into the passed array.
|
default void |
localize(long[] position)
Write the current position into the passed array.
|
default void |
localize(Positionable position)
Write the current position into the passed
Positionable . |
default long[] |
positionAsLongArray()
Allocate and return a long array containing the localizable's position.
|
default Point |
positionAsPoint()
Allocate and return a
Point containing the localizable's
position. |
localize, localize, localize, positionAsDoubleArray, positionAsRealPoint
numDimensions
default void localize(int[] position)
position
- receives current positiondefault void localize(long[] position)
position
- receives current positiondefault void localize(Positionable position)
Positionable
.
Note for developers: This default implementation forwards to
Positionable.setPosition(Localizable)
, so don't do the
same there.position
- receives current positiondefault int getIntPosition(int d)
d
- dimensiondefault long[] positionAsLongArray()
localize(long[])
.default Point positionAsPoint()
Point
containing the localizable's
position.
Please note that his method allocates a new Point
each time
which introduces notable overhead in both compute and memory.
If you query it frequently, you should allocate a dedicated
Point
first and reuse it with localize(Positionable)
.long getLongPosition(int d)
d
- dimensiondefault float getFloatPosition(int d)
RealLocalizable
getFloatPosition
in interface RealLocalizable
d
- dimensiondefault double getDoublePosition(int d)
RealLocalizable
getDoublePosition
in interface RealLocalizable
d
- dimensionCopyright © 2015–2022 ImgLib2. All rights reserved.