public class VolatileARGBType extends AbstractVolatileNativeNumericType<ARGBType,VolatileARGBType>
Volatile
variant of UnsignedShortType
. It uses an
underlying UnsignedShortType
that maps into a
VolatileShortAccess
.Modifier and Type | Field and Description |
---|---|
protected NativeImg<?,? extends VolatileIntAccess> |
img |
Constructor and Description |
---|
VolatileARGBType() |
VolatileARGBType(int value) |
VolatileARGBType(NativeImg<?,? extends VolatileIntAccess> img) |
VolatileARGBType(VolatileIntAccess access) |
Modifier and Type | Method and Description |
---|---|
VolatileARGBType |
copy()
|
VolatileARGBType |
createVariable()
Creates a new
Type variable which can only store one value. |
VolatileARGBType |
duplicateTypeOnSameNativeImg()
Creates a new
NativeType which stores in the same physical array. |
NativeTypeFactory<VolatileARGBType,?> |
getNativeTypeFactory() |
void |
set(int value) |
void |
updateContainer(Object c)
This method is used by an accessor (e.g., a
Cursor ) to request an
update of the current data array. |
getEntitiesPerPixel, index
add, div, equals, hashCode, mul, mul, mul, pow, pow, set, setOne, setZero, sub, valueEquals
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
valueEquals
protected final NativeImg<?,? extends VolatileIntAccess> img
public VolatileARGBType(NativeImg<?,? extends VolatileIntAccess> img)
public VolatileARGBType(VolatileIntAccess access)
public VolatileARGBType(int value)
public VolatileARGBType()
public void set(int value)
public void updateContainer(Object c)
NativeType
Cursor
) to request an
update of the current data array.
As an example consider a CellCursor
moving on a CellImg
.
The cursor maintains a NativeType
which provides access to the
image data. When the cursor moves from one cell to the next, the
underlying data array of the NativeType
must be switched to the
data array of the new cell.
To achieve this, the CellCursor
calls updateContainer()
with itself as the argument. updateContainer()
in turn will call
NativeImg.update(Object)
on it's container, passing along the
reference to the cursor. In this example, the container would be a
CellImg
. While the NativeType
does not know about the
type of the cursor, the container does. CellImg
knows that it is
passed a CellCursor
instance, which can be used to figure out the
current cell and the underlying data array, which is then returned to the
NativeType
.
The idea behind this concept is maybe not obvious. The NativeType
knows which basic type is used (float, int, byte, ...). However, it does
not know how the data is stored (ArrayImg
, CellImg
, ...).
This prevents the need for multiple implementations of NativeType
.
c
- reference to an accessor which can be passed on to the
container (which will know what to do with it).public VolatileARGBType duplicateTypeOnSameNativeImg()
NativeType
NativeType
which stores in the same physical array.
This is only used internally.NativeType
instance working on the same
NativeImg
public VolatileARGBType createVariable()
Type
Type
variable which can only store one value.Type
variablepublic VolatileARGBType copy()
Type
Type
variablepublic NativeTypeFactory<VolatileARGBType,?> getNativeTypeFactory()
Copyright © 2015–2022 ImgLib2. All rights reserved.