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()
|
NativeImg<ComplexDoubleType,? extends DoubleAccess> |
createSuitableNativeImg(NativeImgFactory<ComplexDoubleType> storageFactory,
long[] dim)
The
NativeType creates the NativeImg used for storing
image data; based on the given storage strategy and its size. |
ComplexDoubleType |
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. |
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() |
int |
getIndex()
Get the current index into the current data array.
|
double |
getRealDouble() |
float |
getRealFloat() |
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(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. |
void |
updateIndex(int index)
Set the index into the current data array.
|
boolean |
valueEquals(ComplexDoubleType t) |
add, complexConjugate, div, equals, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, hashCode, mul, mul, mul, setComplexNumber, setComplexNumber, setOne, setZero, sub, toString
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 NativeImg<ComplexDoubleType,? extends DoubleAccess> createSuitableNativeImg(NativeImgFactory<ComplexDoubleType> storageFactory, long[] dim)
NativeType
NativeType
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<ComplexDoubleType>
storageFactory
- which storage strategy is useddim
- the dimensionsNativeImg
where only the Type
knows the BasicType it contains.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 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 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>
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<ComplexDoubleType>
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<ComplexDoubleType>
public void incIndex(int increment)
NativeType
increment
steps.
This is used by accessors (e.g., a Cursor
) to position the
NativeType
in the container.
incIndex
in interface NativeType<ComplexDoubleType>
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<ComplexDoubleType>
public void decIndex(int decrement)
NativeType
decrement
steps.
This is used by accessors (e.g., a Cursor
) to position the
NativeType
in the container.
decIndex
in interface NativeType<ComplexDoubleType>
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<ComplexDoubleType>
public boolean valueEquals(ComplexDoubleType t)
valueEquals
in interface ValueEquals<ComplexDoubleType>
Copyright © 2009–2018 ImgLib2. All rights reserved.