public class ComplexDoubleType extends AbstractComplexType<ComplexDoubleType> implements NativeType<ComplexDoubleType>
Modifier and Type | Field and Description |
---|---|
protected DoubleAccess |
dataAccess |
protected NativeImg<?,? extends DoubleAccess> |
img |
Constructor and Description |
---|
ComplexDoubleType() |
ComplexDoubleType(DoubleAccess access) |
ComplexDoubleType(double r,
double i) |
ComplexDoubleType(NativeImg<?,? extends DoubleAccess> complexfloatStorage) |
Modifier and Type | Method and Description |
---|---|
ComplexDoubleType |
copy()
|
ComplexDoubleType |
createVariable()
Creates a new
Type variable which can only store one value. |
ComplexDoubleType |
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.
|
double |
getImaginaryDouble() |
float |
getImaginaryFloat() |
NativeTypeFactory<ComplexDoubleType,DoubleAccess> |
getNativeTypeFactory() |
double |
getRealDouble() |
float |
getRealFloat() |
Index |
index()
Get the (modifiable) index into the current data array.
|
void |
set(ComplexDoubleType c)
Sets the value of another
Type . |
void |
set(double r,
double i) |
void |
setImaginary(double i) |
void |
setImaginary(float i) |
void |
setReal(double r) |
void |
setReal(float 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, complexConjugate, div, equals, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, hashCode, mul, mul, mul, pow, pow, setComplexNumber, setComplexNumber, setOne, setZero, sub, toString, valueEquals
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
valueEquals
protected final NativeImg<?,? extends DoubleAccess> img
protected DoubleAccess dataAccess
public ComplexDoubleType(NativeImg<?,? extends DoubleAccess> complexfloatStorage)
public ComplexDoubleType(double r, double i)
public ComplexDoubleType(DoubleAccess access)
public ComplexDoubleType()
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<ComplexDoubleType>
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<ComplexDoubleType>
public ComplexDoubleType duplicateTypeOnSameNativeImg()
NativeType
NativeType
which stores in the same physical array.
This is only used internally.duplicateTypeOnSameNativeImg
in interface NativeType<ComplexDoubleType>
NativeType
instance working on the same
NativeImg
public NativeTypeFactory<ComplexDoubleType,DoubleAccess> getNativeTypeFactory()
getNativeTypeFactory
in interface NativeType<ComplexDoubleType>
public float getRealFloat()
getRealFloat
in interface ComplexType<ComplexDoubleType>
public double getRealDouble()
getRealDouble
in interface ComplexType<ComplexDoubleType>
public float getImaginaryFloat()
getImaginaryFloat
in interface ComplexType<ComplexDoubleType>
public double getImaginaryDouble()
getImaginaryDouble
in interface ComplexType<ComplexDoubleType>
public void setReal(float r)
setReal
in interface ComplexType<ComplexDoubleType>
public void setReal(double r)
setReal
in interface ComplexType<ComplexDoubleType>
public void setImaginary(float i)
setImaginary
in interface ComplexType<ComplexDoubleType>
public void setImaginary(double i)
setImaginary
in interface ComplexType<ComplexDoubleType>
public void set(double r, double i)
public void set(ComplexDoubleType c)
Type
Type
.set
in interface Type<ComplexDoubleType>
set
in class AbstractComplexType<ComplexDoubleType>
c
- the new valuepublic ComplexDoubleType createVariable()
Type
Type
variable which can only store one value.createVariable
in interface Type<ComplexDoubleType>
Type
variablepublic ComplexDoubleType copy()
Type
copy
in interface Type<ComplexDoubleType>
Type
variablepublic Fraction getEntitiesPerPixel()
NativeType
getEntitiesPerPixel
in interface NativeType<ComplexDoubleType>
Copyright © 2015–2022 ImgLib2. All rights reserved.