Class NativeARGBDoubleType
- All Implemented Interfaces:
NativeType<NativeARGBDoubleType>
,NumericType<NativeARGBDoubleType>
,Add<NativeARGBDoubleType>
,Div<NativeARGBDoubleType>
,Mul<NativeARGBDoubleType>
,MulFloatingPoint
,SetOne
,SetZero
,Sub<NativeARGBDoubleType>
,ValueEquals<NativeARGBDoubleType>
,Type<NativeARGBDoubleType>
- Author:
- Stephan Saalfeld
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DoubleAccess
protected final NativeImg<?,
? extends DoubleAccess> -
Constructor Summary
ConstructorsConstructorDescriptionNativeARGBDoubleType
(double a, double r, double g, double b) NativeARGBDoubleType
(DoubleAccess access) NativeARGBDoubleType
(NativeImg<?, ? extends DoubleAccess> img) -
Method Summary
Modifier and TypeMethodDescriptioncopy()
NativeImg<NativeARGBDoubleType,
? extends DoubleAccess> createSuitableNativeImg
(NativeImgFactory<NativeARGBDoubleType> storageFactory, long[] dim) TheNativeType
creates theNativeImg
used for storing image data; based on the given storage strategy and its size.Creates a newType
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 bydecrement
steps.Creates a newNativeType
which stores in the same physical array.double
getA()
double
getB()
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 byincrement
steps.void
set
(double a, double r, double g, double b) void
void
setA
(double a) void
setB
(double b) void
setG
(double g) void
setR
(double r) void
This method is used by an accessor (e.g., aCursor
) to request an update of the current data array.void
updateIndex
(int index) Set the index into the current data array.Methods inherited from class net.imglib2.type.numeric.AbstractARGBDoubleType
add, div, mul, mul, mul, set, setOne, setZero, sub, toARGBInt, valueEquals
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.imglib2.type.operators.ValueEquals
valueEquals
-
Field Details
-
img
-
dataAccess
-
-
Constructor Details
-
NativeARGBDoubleType
-
NativeARGBDoubleType
public NativeARGBDoubleType(double a, double r, double g, double b) -
NativeARGBDoubleType
-
NativeARGBDoubleType
public NativeARGBDoubleType()
-
-
Method Details
-
createSuitableNativeImg
public NativeImg<NativeARGBDoubleType,? extends DoubleAccess> createSuitableNativeImg(NativeImgFactory<NativeARGBDoubleType> storageFactory, long[] dim) Description copied from interface:NativeType
TheNativeType
creates theNativeImg
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.- Specified by:
createSuitableNativeImg
in interfaceNativeType<NativeARGBDoubleType>
- Parameters:
storageFactory
- which storage strategy is useddim
- the dimensions- Returns:
- the instantiated
NativeImg
where only theType
knows the BasicType it contains.
-
updateContainer
Description copied from interface:NativeType
This method is used by an accessor (e.g., aCursor
) to request an update of the current data array.As an example consider a
CellCursor
moving on aCellImg
. The cursor maintains aNativeType
which provides access to the image data. When the cursor moves from one cell to the next, the underlying data array of theNativeType
must be switched to the data array of the new cell.To achieve this, the
CellCursor
callsupdateContainer()
with itself as the argument.updateContainer()
in turn will callNativeImg.update(Object)
on it's container, passing along the reference to the cursor. In this example, the container would be aCellImg
. While theNativeType
does not know about the type of the cursor, the container does.CellImg
knows that it is passed aCellCursor
instance, which can be used to figure out the current cell and the underlying data array, which is then returned to theNativeType
.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 ofNativeType
.- Specified by:
updateContainer
in interfaceNativeType<NativeARGBDoubleType>
- Parameters:
c
- reference to an accessor which can be passed on to the container (which will know what to do with it).
-
duplicateTypeOnSameNativeImg
Description copied from interface:NativeType
Creates a newNativeType
which stores in the same physical array. This is only used internally.- Specified by:
duplicateTypeOnSameNativeImg
in interfaceNativeType<NativeARGBDoubleType>
- Returns:
- a new
NativeType
instance working on the sameNativeImg
-
getA
public double getA()- Specified by:
getA
in classAbstractARGBDoubleType<NativeARGBDoubleType>
-
getR
public double getR()- Specified by:
getR
in classAbstractARGBDoubleType<NativeARGBDoubleType>
-
getG
public double getG()- Specified by:
getG
in classAbstractARGBDoubleType<NativeARGBDoubleType>
-
getB
public double getB()- Specified by:
getB
in classAbstractARGBDoubleType<NativeARGBDoubleType>
-
setA
public void setA(double a) - Specified by:
setA
in classAbstractARGBDoubleType<NativeARGBDoubleType>
-
setR
public void setR(double r) - Specified by:
setR
in classAbstractARGBDoubleType<NativeARGBDoubleType>
-
setG
public void setG(double g) - Specified by:
setG
in classAbstractARGBDoubleType<NativeARGBDoubleType>
-
setB
public void setB(double b) - Specified by:
setB
in classAbstractARGBDoubleType<NativeARGBDoubleType>
-
set
public void set(double a, double r, double g, double b) - Overrides:
set
in classAbstractARGBDoubleType<NativeARGBDoubleType>
-
set
-
createVariable
Description copied from interface:Type
Creates a newType
variable which can only store one value.- Specified by:
createVariable
in interfaceType<NativeARGBDoubleType>
- Returns:
- a new
Type
variable
-
copy
Description copied from interface:Type
- Specified by:
copy
in interfaceType<NativeARGBDoubleType>
- Returns:
- a new
Type
variable
-
getEntitiesPerPixel
Description copied from interface:NativeType
Get the number of entities in the storage array required to store one pixel value. A pixel value may be spread over several or less than one entity. For example, a complex number may require 2 entries of a float[] array to store one pixel. Or a 12-bit type might need 12/64th entries of a long[] array.- Specified by:
getEntitiesPerPixel
in interfaceNativeType<NativeARGBDoubleType>
- Returns:
- the number of storage type entities required to store one pixel value.
-
updateIndex
public void updateIndex(int index) Description copied from interface:NativeType
Set the index into the current data array.This is used by accessors (e.g., a
Cursor
) to position theNativeType
in the container.- Specified by:
updateIndex
in interfaceNativeType<NativeARGBDoubleType>
- Parameters:
index
- the new array index
-
incIndex
public void incIndex()Description copied from interface:NativeType
Increment the index into the current data array.This is used by accessors (e.g., a
Cursor
) to position theNativeType
in the container.- Specified by:
incIndex
in interfaceNativeType<NativeARGBDoubleType>
-
incIndex
public void incIndex(int increment) Description copied from interface:NativeType
Increases the index into the current data array byincrement
steps.This is used by accessors (e.g., a
Cursor
) to position theNativeType
in the container.- Specified by:
incIndex
in interfaceNativeType<NativeARGBDoubleType>
- Parameters:
increment
- how many steps
-
decIndex
public void decIndex()Description copied from interface:NativeType
Decrement the index into the current data array.This is used by accessors (e.g., a
Cursor
) to position theNativeType
in the container.- Specified by:
decIndex
in interfaceNativeType<NativeARGBDoubleType>
-
decIndex
public void decIndex(int decrement) Description copied from interface:NativeType
Decrease the index into the current data array bydecrement
steps.This is used by accessors (e.g., a
Cursor
) to position theNativeType
in the container.- Specified by:
decIndex
in interfaceNativeType<NativeARGBDoubleType>
- Parameters:
decrement
- how many steps
-
getIndex
public int getIndex()Description copied from interface:NativeType
Get the current index into the current data array.This is used by accessors (e.g., a
Cursor
) to position theNativeType
in the container.- Specified by:
getIndex
in interfaceNativeType<NativeARGBDoubleType>
- Returns:
- the current index into the underlying data array
-