public class DoubleType extends AbstractRealType<DoubleType> implements NativeType<DoubleType>
Modifier and Type | Field and Description |
---|---|
protected DoubleAccess |
dataAccess |
protected NativeImg<?,? extends DoubleAccess> |
img |
Constructor and Description |
---|
DoubleType() |
DoubleType(double value) |
DoubleType(DoubleAccess access) |
DoubleType(NativeImg<?,? extends DoubleAccess> doubleStorage) |
Modifier and Type | Method and Description |
---|---|
DoubleType |
copy()
|
DoubleType |
createVariable()
Creates a new
Type variable which can only store one value. |
DoubleType |
duplicateTypeOnSameNativeImg()
Creates a new
NativeType which stores in the same physical array. |
static boolean |
equals(double a,
double b) |
double |
get() |
int |
getBitsPerPixel() |
Fraction |
getEntitiesPerPixel()
Get the number of entities in the storage array required to store one
pixel value.
|
double |
getMaxValue() |
double |
getMinIncrement() |
double |
getMinValue() |
NativeTypeFactory<DoubleType,DoubleAccess> |
getNativeTypeFactory() |
double |
getRealDouble() |
float |
getRealFloat() |
Index |
index()
Get the (modifiable) index into the current data array.
|
void |
set(double f) |
void |
setReal(double real) |
void |
setReal(float real) |
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, compareTo, dec, div, equals, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, hashCode, inc, mul, mul, mul, pow, pow, set, setImaginary, setImaginary, setOne, setZero, sub, toString, valueEquals
complexConjugate, setComplexNumber, setComplexNumber
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
valueEquals
complexConjugate, setComplexNumber, setComplexNumber
protected final NativeImg<?,? extends DoubleAccess> img
protected DoubleAccess dataAccess
public DoubleType(NativeImg<?,? extends DoubleAccess> doubleStorage)
public DoubleType(double value)
public DoubleType(DoubleAccess access)
public DoubleType()
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<DoubleType>
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<DoubleType>
public DoubleType duplicateTypeOnSameNativeImg()
NativeType
NativeType
which stores in the same physical array.
This is only used internally.duplicateTypeOnSameNativeImg
in interface NativeType<DoubleType>
NativeType
instance working on the same
NativeImg
public NativeTypeFactory<DoubleType,DoubleAccess> getNativeTypeFactory()
getNativeTypeFactory
in interface NativeType<DoubleType>
public double get()
public void set(double f)
public float getRealFloat()
getRealFloat
in interface ComplexType<DoubleType>
public double getRealDouble()
getRealDouble
in interface ComplexType<DoubleType>
public void setReal(float real)
setReal
in interface ComplexType<DoubleType>
public void setReal(double real)
setReal
in interface ComplexType<DoubleType>
public double getMaxValue()
getMaxValue
in interface RealType<DoubleType>
public double getMinValue()
getMinValue
in interface RealType<DoubleType>
public double getMinIncrement()
getMinIncrement
in interface RealType<DoubleType>
public DoubleType createVariable()
Type
Type
variable which can only store one value.createVariable
in interface Type<DoubleType>
Type
variablepublic DoubleType copy()
Type
copy
in interface Type<DoubleType>
Type
variablepublic Fraction getEntitiesPerPixel()
NativeType
getEntitiesPerPixel
in interface NativeType<DoubleType>
public int getBitsPerPixel()
getBitsPerPixel
in interface RealType<DoubleType>
public static boolean equals(double a, double b)
Copyright © 2015–2022 ImgLib2. All rights reserved.