public final class TransformRandomAccess<T> extends AbstractLocalizable implements RandomAccess<T>
source
RandomAccess which is related to this by a generic
Transform
transformToSource
.
TransformRandomAccess
gets called by Cursor
implementations
over RandomAccess
that initialize at the Interval
min
position - 1, i.e. they call bck(0)
after
setPosition(min)
. Transforms are not
necessarily defined at this position and may throw an exception. Therefore,
position update must not apply the transformation! Instead, the
transformation is applied at get()
. So don't call get()
more than once at the same place (generally a good idea).position
n
Modifier | Constructor and Description |
---|---|
protected |
TransformRandomAccess(TransformRandomAccess<T> randomAccess) |
Modifier and Type | Method and Description |
---|---|
void |
bck(int d)
Move by -1 in one dimension.
|
TransformRandomAccess<T> |
copy() |
TransformRandomAccess<T> |
copyRandomAccess() |
void |
fwd(int d)
Move by 1 in one dimension.
|
T |
get()
Access the actual T instance providing access to a pixel,
sub-pixel or integral region value the
Sampler points at. |
void |
move(int[] distance)
Move the element relative to its current location using an int[] as
distance vector.
|
void |
move(int distance,
int d)
Move the element in one dimension for some distance.
|
void |
move(Localizable localizable)
Move the element relative to its current location using an
Localizable as distance vector. |
void |
move(long[] distance)
Move the element relative to its current location using a long[] as
distance vector.
|
void |
move(long distance,
int d)
Move the element in one dimension for some distance.
|
void |
setPosition(int[] pos)
Set the position of the element.
|
void |
setPosition(int pos,
int d)
Set the position of the element for one dimension.
|
void |
setPosition(Localizable localizable)
Place the element at the same location as a given
Localizable |
void |
setPosition(long[] pos)
Set the position of the element.
|
void |
setPosition(long pos,
int d)
Set the position of the element for one dimension.
|
getDoublePosition, getFloatPosition, getIntPosition, getLongPosition, localize, localize, localize, localize
numDimensions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIntPosition, getLongPosition, localize, localize
getDoublePosition, getFloatPosition, localize, localize
numDimensions
protected TransformRandomAccess(TransformRandomAccess<T> randomAccess)
public void fwd(int d)
Positionable
fwd
in interface Positionable
d
- dimensionpublic void bck(int d)
Positionable
bck
in interface Positionable
d
- dimensionpublic void move(int distance, int d)
Positionable
move
in interface Positionable
distance
- relative offset in dimension dd
- dimensionpublic void move(long distance, int d)
Positionable
move
in interface Positionable
distance
- relative offset in dimension dd
- dimensionpublic void move(Localizable localizable)
Positionable
Localizable
as distance vector.move
in interface Positionable
localizable
- relative offsetpublic void move(int[] distance)
Positionable
move
in interface Positionable
distance
- relative offsetpublic void move(long[] distance)
Positionable
move
in interface Positionable
distance
- relative offsetpublic void setPosition(Localizable localizable)
Positionable
Localizable
setPosition
in interface Positionable
localizable
- relative offsetpublic void setPosition(int[] pos)
Positionable
setPosition
in interface Positionable
pos
- absolute positionpublic void setPosition(long[] pos)
Positionable
setPosition
in interface Positionable
pos
- absolute positionpublic void setPosition(int pos, int d)
Positionable
setPosition
in interface Positionable
pos
- absolute position in dimension dd
- dimensionpublic void setPosition(long pos, int d)
Positionable
setPosition
in interface Positionable
pos
- absolute position in dimension dd
- dimensionpublic T get()
Sampler
Sampler
points at.public TransformRandomAccess<T> copy()
copy
in interface Sampler<T>
Sampler
in the same state accessing the same
values.
It does NOT copy T, just the state of the Sampler
.
Otherwise use T.copy() if available.
Sampler.copy().get() == Sampler.get(), i.e. both hold the same
value, not necessarily the same instance (this is the case for an
ArrayCursor
for example)public TransformRandomAccess<T> copyRandomAccess()
copyRandomAccess
in interface RandomAccess<T>
Copyright © 2009–2017 ImgLib2. All rights reserved.