Class GenericByteType<T extends GenericByteType<T>>
- java.lang.Object
-
- net.imglib2.type.numeric.complex.AbstractComplexType<T>
-
- net.imglib2.type.numeric.real.AbstractRealType<T>
-
- net.imglib2.type.numeric.integer.AbstractIntegerType<T>
-
- net.imglib2.type.numeric.integer.GenericByteType<T>
-
- All Implemented Interfaces:
java.lang.Comparable<T>,NativeType<T>,ComplexType<T>,IntegerType<T>,NumericType<T>,RealType<T>,Add<T>,Div<T>,Mul<T>,MulFloatingPoint,Pow<T>,PowFloatingPoint,SetOne,SetZero,Sub<T>,ValueEquals<T>,Type<T>
- Direct Known Subclasses:
ByteType,UnsignedByteType
public abstract class GenericByteType<T extends GenericByteType<T>> extends AbstractIntegerType<T> implements NativeType<T>
TODO
-
-
Field Summary
Fields Modifier and Type Field Description protected ByteAccessdataAccess(package private) Indexiprotected NativeImg<?,? extends ByteAccess>img
-
Constructor Summary
Constructors Constructor Description GenericByteType()GenericByteType(byte value)GenericByteType(ByteAccess access)GenericByteType(NativeImg<?,? extends ByteAccess> byteStorage)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(T c)intcompareTo(T other)voiddec()voiddiv(T c)booleanequals(java.lang.Object obj)intgetBitsPerPixel()bytegetByte()Returns the primitive byte value that is used to store this type.FractiongetEntitiesPerPixel()Get the number of entities in the storage array required to store one pixel value.abstract NativeTypeFactory<T,ByteAccess>getNativeTypeFactory()protected bytegetValue()Deprecated.UsegetByte()instead.inthashCode()voidinc()Indexindex()Get the (modifiable) index into the current data array.voidmul(double c)voidmul(float c)voidmul(T c)voidset(T c)Sets the value of anotherType.voidsetByte(byte f)Sets the primitive byte value that is used to store this type.voidsetOne()protected voidsetValue(byte f)Deprecated.UsesetByte(byte)instead.voidsetZero()voidsub(T c)java.lang.StringtoString()voidupdateContainer(java.lang.Object c)This method is used by an accessor (e.g., aCursor) to request an update of the current data array.booleanvalueEquals(T t)-
Methods inherited from class net.imglib2.type.numeric.integer.AbstractIntegerType
getMinIncrement, getRealDouble, getRealFloat, setReal, setReal
-
Methods inherited from class net.imglib2.type.numeric.real.AbstractRealType
getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, pow, pow, setImaginary, setImaginary
-
Methods inherited from class net.imglib2.type.numeric.complex.AbstractComplexType
complexConjugate, setComplexNumber, setComplexNumber
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.imglib2.type.numeric.ComplexType
complexConjugate, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginary
-
Methods inherited from interface net.imglib2.type.numeric.IntegerType
getBigInteger, getInteger, getIntegerLong, setBigInteger, setInteger, setInteger
-
Methods inherited from interface net.imglib2.type.NativeType
decIndex, decIndex, duplicateTypeOnSameNativeImg, getIndex, incIndex, incIndex, updateIndex
-
Methods inherited from interface net.imglib2.type.operators.PowFloatingPoint
pow
-
Methods inherited from interface net.imglib2.type.numeric.RealType
getMaxValue, getMinValue
-
Methods inherited from interface net.imglib2.type.Type
copy, createVariable
-
-
-
-
Field Detail
-
i
final Index i
-
img
protected final NativeImg<?,? extends ByteAccess> img
-
dataAccess
protected ByteAccess dataAccess
-
-
Constructor Detail
-
GenericByteType
public GenericByteType(NativeImg<?,? extends ByteAccess> byteStorage)
-
GenericByteType
public GenericByteType(byte value)
-
GenericByteType
public GenericByteType(ByteAccess access)
-
GenericByteType
public GenericByteType()
-
-
Method Detail
-
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<T extends GenericByteType<T>>- Returns:
- the number of storage type entities required to store one pixel value.
-
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<T extends GenericByteType<T>>- 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<T extends GenericByteType<T>>
-
getNativeTypeFactory
public abstract NativeTypeFactory<T,ByteAccess> getNativeTypeFactory()
- Specified by:
getNativeTypeFactoryin interfaceNativeType<T extends GenericByteType<T>>
-
getValue
@Deprecated protected byte getValue()
Deprecated.UsegetByte()instead.
-
setValue
@Deprecated protected void setValue(byte f)
Deprecated.UsesetByte(byte)instead.
-
getByte
public byte getByte()
Returns the primitive byte value that is used to store this type.- Returns:
- primitive byte value
-
setByte
public void setByte(byte f)
Sets the primitive byte value that is used to store this type.
-
mul
public void mul(float c)
- Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<T extends GenericByteType<T>>
-
mul
public void mul(double c)
- Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<T extends GenericByteType<T>>
-
add
public void add(T c)
- Specified by:
addin interfaceAdd<T extends GenericByteType<T>>- Overrides:
addin classAbstractRealType<T extends GenericByteType<T>>
-
div
public void div(T c)
- Specified by:
divin interfaceDiv<T extends GenericByteType<T>>- Overrides:
divin classAbstractRealType<T extends GenericByteType<T>>
-
mul
public void mul(T c)
- Specified by:
mulin interfaceMul<T extends GenericByteType<T>>- Overrides:
mulin classAbstractRealType<T extends GenericByteType<T>>
-
sub
public void sub(T c)
- Specified by:
subin interfaceSub<T extends GenericByteType<T>>- Overrides:
subin classAbstractRealType<T extends GenericByteType<T>>
-
set
public void set(T c)
Description copied from interface:TypeSets the value of anotherType.- Specified by:
setin interfaceType<T extends GenericByteType<T>>- Overrides:
setin classAbstractRealType<T extends GenericByteType<T>>- Parameters:
c- the new value
-
setOne
public void setOne()
- Specified by:
setOnein interfaceSetOne- Overrides:
setOnein classAbstractIntegerType<T extends GenericByteType<T>>
-
setZero
public void setZero()
- Specified by:
setZeroin interfaceSetZero- Overrides:
setZeroin classAbstractIntegerType<T extends GenericByteType<T>>
-
inc
public void inc()
- Specified by:
incin interfaceRealType<T extends GenericByteType<T>>- Overrides:
incin classAbstractIntegerType<T extends GenericByteType<T>>
-
dec
public void dec()
- Specified by:
decin interfaceRealType<T extends GenericByteType<T>>- Overrides:
decin classAbstractIntegerType<T extends GenericByteType<T>>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractIntegerType<T extends GenericByteType<T>>
-
getBitsPerPixel
public int getBitsPerPixel()
- Specified by:
getBitsPerPixelin interfaceRealType<T extends GenericByteType<T>>
-
compareTo
public int compareTo(T other)
- Specified by:
compareToin interfacejava.lang.Comparable<T extends GenericByteType<T>>- Overrides:
compareToin classAbstractIntegerType<T extends GenericByteType<T>>
-
valueEquals
public boolean valueEquals(T t)
- Specified by:
valueEqualsin interfaceValueEquals<T extends GenericByteType<T>>- Overrides:
valueEqualsin classAbstractIntegerType<T extends GenericByteType<T>>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classAbstractIntegerType<T extends GenericByteType<T>>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractIntegerType<T extends GenericByteType<T>>
-
-