public class NativeARGBDoubleType extends AbstractARGBDoubleType<NativeARGBDoubleType> implements NativeType<NativeARGBDoubleType>
| Modifier and Type | Field and Description |
|---|---|
protected DoubleAccess |
dataAccess |
protected NativeImg<?,? extends DoubleAccess> |
img |
| Constructor and Description |
|---|
NativeARGBDoubleType() |
NativeARGBDoubleType(DoubleAccess access) |
NativeARGBDoubleType(double a,
double r,
double g,
double b) |
NativeARGBDoubleType(NativeImg<?,? extends DoubleAccess> img) |
| Modifier and Type | Method and Description |
|---|---|
NativeARGBDoubleType |
copy()
|
NativeImg<NativeARGBDoubleType,? extends DoubleAccess> |
createSuitableNativeImg(NativeImgFactory<NativeARGBDoubleType> storageFactory,
long[] dim)
The
NativeType creates the NativeImg used for storing
image data; based on the given storage strategy and its size. |
NativeARGBDoubleType |
createVariable()
Creates a new
Type variable which can only store one value. |
void |
decIndex()
Decrement the index into the current data array.
|
void |
decIndex(int decrement)
Decrease the index into the current data array by
decrement
steps. |
NativeARGBDoubleType |
duplicateTypeOnSameNativeImg()
Creates a new
NativeType which stores in the same physical array. |
double |
getA() |
double |
getB() |
Fraction |
getEntitiesPerPixel()
Get the number of entities in the storage array required to store one
pixel value.
|
double |
getG() |
int |
getIndex()
Get the current index into the current data array.
|
double |
getR() |
void |
incIndex()
Increment the index into the current data array.
|
void |
incIndex(int increment)
Increases the index into the current data array by
increment
steps. |
void |
set(ARGBDoubleType c) |
void |
set(double a,
double r,
double g,
double b) |
void |
setA(double a) |
void |
setB(double b) |
void |
setG(double g) |
void |
setR(double r) |
void |
updateContainer(Object c)
This method is used by an accessor (e.g., a
Cursor) to request an
update of the current data array. |
void |
updateIndex(int index)
Set the index into the current data array.
|
add, div, mul, mul, mul, set, setOne, setZero, sub, toARGBInt, valueEqualsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalueEqualsprotected final NativeImg<?,? extends DoubleAccess> img
protected DoubleAccess dataAccess
public NativeARGBDoubleType(NativeImg<?,? extends DoubleAccess> img)
public NativeARGBDoubleType(double a,
double r,
double g,
double b)
public NativeARGBDoubleType(DoubleAccess access)
public NativeARGBDoubleType()
public NativeImg<NativeARGBDoubleType,? extends DoubleAccess> createSuitableNativeImg(NativeImgFactory<NativeARGBDoubleType> storageFactory, long[] dim)
NativeTypeNativeType creates the NativeImg 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.createSuitableNativeImg in interface NativeType<NativeARGBDoubleType>storageFactory - which storage strategy is useddim - the dimensionsNativeImg where only the Type
knows the BasicType it contains.public void updateContainer(Object c)
NativeTypeCursor) 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
.
updateContainer in interface NativeType<NativeARGBDoubleType>c - reference to an accessor which can be passed on to the
container (which will know what to do with it).public NativeARGBDoubleType duplicateTypeOnSameNativeImg()
NativeTypeNativeType which stores in the same physical array.
This is only used internally.duplicateTypeOnSameNativeImg in interface NativeType<NativeARGBDoubleType>NativeType instance working on the same
NativeImgpublic double getA()
getA in class AbstractARGBDoubleType<NativeARGBDoubleType>public double getR()
getR in class AbstractARGBDoubleType<NativeARGBDoubleType>public double getG()
getG in class AbstractARGBDoubleType<NativeARGBDoubleType>public double getB()
getB in class AbstractARGBDoubleType<NativeARGBDoubleType>public void setA(double a)
setA in class AbstractARGBDoubleType<NativeARGBDoubleType>public void setR(double r)
setR in class AbstractARGBDoubleType<NativeARGBDoubleType>public void setG(double g)
setG in class AbstractARGBDoubleType<NativeARGBDoubleType>public void setB(double b)
setB in class AbstractARGBDoubleType<NativeARGBDoubleType>public void set(double a,
double r,
double g,
double b)
set in class AbstractARGBDoubleType<NativeARGBDoubleType>public void set(ARGBDoubleType c)
public NativeARGBDoubleType createVariable()
TypeType variable which can only store one value.createVariable in interface Type<NativeARGBDoubleType>Type variablepublic NativeARGBDoubleType copy()
Typecopy in interface Type<NativeARGBDoubleType>Type variablepublic Fraction getEntitiesPerPixel()
NativeTypegetEntitiesPerPixel in interface NativeType<NativeARGBDoubleType>public void updateIndex(int index)
NativeType
This is used by accessors (e.g., a Cursor) to position the
NativeType in the container.
updateIndex in interface NativeType<NativeARGBDoubleType>index - the new array indexpublic void incIndex()
NativeType
This is used by accessors (e.g., a Cursor) to position the
NativeType in the container.
incIndex in interface NativeType<NativeARGBDoubleType>public void incIndex(int increment)
NativeTypeincrement
steps.
This is used by accessors (e.g., a Cursor) to position the
NativeType in the container.
incIndex in interface NativeType<NativeARGBDoubleType>increment - how many stepspublic void decIndex()
NativeType
This is used by accessors (e.g., a Cursor) to position the
NativeType in the container.
decIndex in interface NativeType<NativeARGBDoubleType>public void decIndex(int decrement)
NativeTypedecrement
steps.
This is used by accessors (e.g., a Cursor) to position the
NativeType in the container.
decIndex in interface NativeType<NativeARGBDoubleType>decrement - how many stepspublic int getIndex()
NativeType
This is used by accessors (e.g., a Cursor) to position the
NativeType in the container.
getIndex in interface NativeType<NativeARGBDoubleType>Copyright © 2009–2017 ImgLib2. All rights reserved.