Class NativeARGBDoubleType
- java.lang.Object
-
- net.imglib2.type.numeric.AbstractARGBDoubleType<NativeARGBDoubleType>
-
- net.imglib2.type.numeric.NativeARGBDoubleType
-
- All Implemented Interfaces:
NativeType<NativeARGBDoubleType>,NumericType<NativeARGBDoubleType>,Add<NativeARGBDoubleType>,Div<NativeARGBDoubleType>,Mul<NativeARGBDoubleType>,MulFloatingPoint,Pow<NativeARGBDoubleType>,PowFloatingPoint,SetOne,SetZero,Sub<NativeARGBDoubleType>,ValueEquals<NativeARGBDoubleType>,Type<NativeARGBDoubleType>
public class NativeARGBDoubleType extends AbstractARGBDoubleType<NativeARGBDoubleType> implements NativeType<NativeARGBDoubleType>
-
-
Field Summary
Fields Modifier and Type Field Description protected DoubleAccessdataAccessprivate Indexiprotected NativeImg<?,? extends DoubleAccess>imgprivate static NativeTypeFactory<NativeARGBDoubleType,DoubleAccess>typeFactory
-
Constructor Summary
Constructors Constructor Description NativeARGBDoubleType()NativeARGBDoubleType(double a, double r, double g, double b)NativeARGBDoubleType(DoubleAccess access)NativeARGBDoubleType(NativeImg<?,? extends DoubleAccess> img)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NativeARGBDoubleTypecopy()NativeARGBDoubleTypecreateVariable()Creates a newTypevariable which can only store one value.NativeARGBDoubleTypeduplicateTypeOnSameNativeImg()Creates a newNativeTypewhich stores in the same physical array.doublegetA()doublegetB()FractiongetEntitiesPerPixel()Get the number of entities in the storage array required to store one pixel value.doublegetG()NativeTypeFactory<NativeARGBDoubleType,DoubleAccess>getNativeTypeFactory()doublegetR()Indexindex()Get the (modifiable) index into the current data array.voidset(double a, double r, double g, double b)voidset(ARGBDoubleType c)voidsetA(double a)voidsetB(double b)voidsetG(double g)voidsetR(double r)voidupdateContainer(java.lang.Object c)This method is used by an accessor (e.g., aCursor) to request an update of the current data array.-
Methods inherited from class net.imglib2.type.numeric.AbstractARGBDoubleType
add, div, equals, hashCode, mul, mul, mul, pow, pow, set, setOne, setZero, sub, toARGBInt, valueEquals
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.imglib2.type.NativeType
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
-
Methods inherited from interface net.imglib2.type.operators.ValueEquals
valueEquals
-
-
-
-
Field Detail
-
i
private final Index i
-
img
protected final NativeImg<?,? extends DoubleAccess> img
-
dataAccess
protected DoubleAccess dataAccess
-
typeFactory
private static final NativeTypeFactory<NativeARGBDoubleType,DoubleAccess> typeFactory
-
-
Constructor Detail
-
NativeARGBDoubleType
public NativeARGBDoubleType(NativeImg<?,? extends DoubleAccess> img)
-
NativeARGBDoubleType
public NativeARGBDoubleType(double a, double r, double g, double b)
-
NativeARGBDoubleType
public NativeARGBDoubleType(DoubleAccess access)
-
NativeARGBDoubleType
public NativeARGBDoubleType()
-
-
Method Detail
-
updateContainer
public void updateContainer(java.lang.Object c)
Description copied from interface:NativeTypeThis method is used by an accessor (e.g., aCursor) to request an update of the current data array.As an example consider a
CellCursormoving on aCellImg. The cursor maintains aNativeTypewhich provides access to the image data. When the cursor moves from one cell to the next, the underlying data array of theNativeTypemust be switched to the data array of the new cell.To achieve this, the
CellCursorcallsupdateContainer()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 theNativeTypedoes not know about the type of the cursor, the container does.CellImgknows that it is passed aCellCursorinstance, 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
NativeTypeknows 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:
updateContainerin interfaceNativeType<NativeARGBDoubleType>- Parameters:
c- reference to an accessor which can be passed on to the container (which will know what to do with it).
-
index
public Index index()
Description copied from interface:NativeTypeGet the (modifiable) index into the current data array. The returned instance will always be the same for the same Type.- Specified by:
indexin interfaceNativeType<NativeARGBDoubleType>
-
duplicateTypeOnSameNativeImg
public NativeARGBDoubleType duplicateTypeOnSameNativeImg()
Description copied from interface:NativeTypeCreates a newNativeTypewhich stores in the same physical array. This is only used internally.- Specified by:
duplicateTypeOnSameNativeImgin interfaceNativeType<NativeARGBDoubleType>- Returns:
- a new
NativeTypeinstance working on the sameNativeImg
-
getNativeTypeFactory
public NativeTypeFactory<NativeARGBDoubleType,DoubleAccess> getNativeTypeFactory()
- Specified by:
getNativeTypeFactoryin interfaceNativeType<NativeARGBDoubleType>
-
getA
public double getA()
- Specified by:
getAin classAbstractARGBDoubleType<NativeARGBDoubleType>
-
getR
public double getR()
- Specified by:
getRin classAbstractARGBDoubleType<NativeARGBDoubleType>
-
getG
public double getG()
- Specified by:
getGin classAbstractARGBDoubleType<NativeARGBDoubleType>
-
getB
public double getB()
- Specified by:
getBin classAbstractARGBDoubleType<NativeARGBDoubleType>
-
setA
public void setA(double a)
- Specified by:
setAin classAbstractARGBDoubleType<NativeARGBDoubleType>
-
setR
public void setR(double r)
- Specified by:
setRin classAbstractARGBDoubleType<NativeARGBDoubleType>
-
setG
public void setG(double g)
- Specified by:
setGin classAbstractARGBDoubleType<NativeARGBDoubleType>
-
setB
public void setB(double b)
- Specified by:
setBin classAbstractARGBDoubleType<NativeARGBDoubleType>
-
set
public void set(double a, double r, double g, double b)- Overrides:
setin classAbstractARGBDoubleType<NativeARGBDoubleType>
-
set
public void set(ARGBDoubleType c)
-
createVariable
public NativeARGBDoubleType createVariable()
Description copied from interface:TypeCreates a newTypevariable which can only store one value.- Specified by:
createVariablein interfaceType<NativeARGBDoubleType>- Returns:
- a new
Typevariable
-
copy
public NativeARGBDoubleType copy()
Description copied from interface:Type- Specified by:
copyin interfaceType<NativeARGBDoubleType>- Returns:
- a new
Typevariable
-
getEntitiesPerPixel
public Fraction getEntitiesPerPixel()
Description copied from interface:NativeTypeGet 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:
getEntitiesPerPixelin interfaceNativeType<NativeARGBDoubleType>- Returns:
- the number of storage type entities required to store one pixel value.
-
-