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()
|
NativeARGBDoubleType |
createVariable()
Creates a new
Type variable which can only store one value. |
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() |
NativeTypeFactory<NativeARGBDoubleType,DoubleAccess> |
getNativeTypeFactory() |
double |
getR() |
Index |
index()
Get the (modifiable) index into the current data array.
|
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. |
add, div, equals, hashCode, mul, mul, mul, pow, pow, set, setOne, setZero, sub, toARGBInt, valueEquals
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
valueEquals
protected 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 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
.
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 Index index()
NativeType
index
in interface NativeType<NativeARGBDoubleType>
public NativeARGBDoubleType duplicateTypeOnSameNativeImg()
NativeType
NativeType
which stores in the same physical array.
This is only used internally.duplicateTypeOnSameNativeImg
in interface NativeType<NativeARGBDoubleType>
NativeType
instance working on the same
NativeImg
public NativeTypeFactory<NativeARGBDoubleType,DoubleAccess> getNativeTypeFactory()
getNativeTypeFactory
in interface NativeType<NativeARGBDoubleType>
public 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()
Type
Type
variable which can only store one value.createVariable
in interface Type<NativeARGBDoubleType>
Type
variablepublic NativeARGBDoubleType copy()
Type
copy
in interface Type<NativeARGBDoubleType>
Type
variablepublic Fraction getEntitiesPerPixel()
NativeType
getEntitiesPerPixel
in interface NativeType<NativeARGBDoubleType>
Copyright © 2015–2022 ImgLib2. All rights reserved.