public interface NativeLongAccessType<T extends NativeLongAccessType<T>> extends Type<T>
NativeLongAccessType
is a Type
that that provides access to
data stored in Java primitive arrays. To this end, implementations maintain a
reference to the current storage array and the index of an element in that
array.
The NativeLongAccessType
is positioned on the correct storage array
and index by accessors (Cursors
and RandomAccesses
).
The NativeLongAccessType
is the only class that is aware of the
actual data type, i.e., which Java primitive type is used to store the data.
On the other hand it does not know the storage layout, i.e., how
n-dimensional pixel coordinates map to indices in the current array. It also
doesn't know whether and how the data is split into multiple chunks. This is
determined by the container implementation (e.g., ArrayImg
,
CellImg
, ...). Separating the storage layout from access and
operations on the Type
avoids re-implementation for each container
type.
Modifier and Type | Method and Description |
---|---|
NativeLongAccessImg<T,?> |
createSuitableNativeImg(NativeLongAccessImgFactory<T> storageFactory,
long[] dim)
The
NativeLongAccessType creates the NativeLongAccessImg
used for storing image data; based on the given storage strategy and its
size. |
void |
decIndex() |
void |
decIndex(long decrement)
Decrease the index into the current data array by
decrement
steps. |
T |
duplicateTypeOnSameNativeImg()
Creates a new
NativeType which stores in the same physical array. |
Fraction |
getEntitiesPerPixel()
Get the number of entities in the storage array required to store one
pixel value.
|
long |
getIndexLong()
Get the current index into the current data array.
|
NativeLongAccessTypeFactory<T,?> |
getNativeLongAccessTypeFactory() |
void |
incIndex() |
void |
incIndex(long increment)
Increases the index into the current data array by
increment
steps. |
void |
updateContainer(Object c) |
void |
updateIndex(long i)
Set the index into the current data array.
|
copy, createVariable, set
valueEquals
NativeLongAccessImg<T,?> createSuitableNativeImg(NativeLongAccessImgFactory<T> storageFactory, long[] dim)
NativeLongAccessType
creates the NativeLongAccessImg
used for storing image data; based on the given storage strategy and its
size. It basically only decides here which BasicType it uses (float, int,
byte, bit, ...) and how many entities per pixel it needs (e.g. 2 floats
per pixel for a complex number). This enables the separation of
containers and the basic types.storageFactory
- which storage strategy is useddim
- the dimensionsNativeLongAccessImg
where only the
Type
knows the BasicType it contains.void updateIndex(long i)
This is used by accessors (e.g., a Cursor
) to position the
NativeLongAccessType
in the container.
i
- the new array indexlong getIndexLong()
This is used by accessors (e.g., a Cursor
) to position the
NativeLongAccessType
in the container.
void incIndex()
void decIndex()
void incIndex(long increment)
increment
steps.
This is used by accessors (e.g., a Cursor
) to position the
NativeLongAccessType
in the container.
increment
- how many stepsvoid decIndex(long decrement)
decrement
steps.
This is used by accessors (e.g., a Cursor
) to position the
NativeLongAccessType
in the container.
decrement
- how many stepsFraction getEntitiesPerPixel()
T duplicateTypeOnSameNativeImg()
NativeType
which stores in the same physical array.
This is only used internally.NativeType
instance working on the same
NativeImg
void updateContainer(Object c)
NativeLongAccessTypeFactory<T,?> getNativeLongAccessTypeFactory()
Copyright © 2015–2022 ImgLib2. All rights reserved.