Package net.imglib2.type.numeric.integer
Class AbstractIntegerBitType<T extends AbstractIntegerBitType<T>>
java.lang.Object
net.imglib2.type.AbstractBitType<T>
net.imglib2.type.numeric.integer.AbstractIntegerBitType<T>
- All Implemented Interfaces:
Comparable<T>,NativeType<T>,ComplexType<T>,IntegerType<T>,NumericType<T>,RealType<T>,Add<T>,Div<T>,Mul<T>,MulFloatingPoint,SetOne,SetZero,Sub<T>,ValueEquals<T>,Type<T>
- Direct Known Subclasses:
Unsigned12BitType,Unsigned2BitType,Unsigned4BitType
public abstract class AbstractIntegerBitType<T extends AbstractIntegerBitType<T>>
extends AbstractBitType<T>
implements IntegerType<T>
The performance of this type is traded off for the gain in memory storage.
- Author:
- Albert Cardona
-
Field Summary
Fields inherited from class net.imglib2.type.AbstractBitType
dataAccess, i, img, nBits -
Constructor Summary
ConstructorsConstructorDescriptionAbstractIntegerBitType(NativeImg<?, ? extends LongAccess> bitStorage, int nBits) -
Method Summary
Modifier and TypeMethodDescriptionvoidintvoidvoiddec()voidbooleanabstract longget()intdoublefloatintlongdoubleThe maximum value that can be stored isMath.pow(2, nBits) -1.doubledoubledoublefloatdoublefloatdoublefloatinthashCode()voidinc()voidmul(double c) voidmul(float c) voidabstract voidset(long value) voidSets the value of anotherType.voidvoidsetComplexNumber(double r, double i) voidsetComplexNumber(float r, float i) voidsetImaginary(double complex) voidsetImaginary(float complex) voidsetInteger(int f) voidsetInteger(long f) voidsetOne()voidsetReal(double real) voidsetReal(float real) voidsetZero()voidtoString()booleanvalueEquals(T t) Default test at long precision.Methods inherited from class net.imglib2.type.AbstractBitType
decIndex, decIndex, getEntitiesPerPixel, getIndex, incIndex, incIndex, updateContainer, updateIndexMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.imglib2.type.NativeType
createSuitableNativeImg, duplicateTypeOnSameNativeImgMethods inherited from interface net.imglib2.type.Type
copy, createVariable
-
Constructor Details
-
AbstractIntegerBitType
-
-
Method Details
-
get
public abstract long get() -
set
public abstract void set(long value) -
getBitsPerPixel
public int getBitsPerPixel()- Specified by:
getBitsPerPixelin interfaceRealType<T extends AbstractIntegerBitType<T>>
-
getMinIncrement
public double getMinIncrement()- Specified by:
getMinIncrementin interfaceRealType<T extends AbstractIntegerBitType<T>>
-
mul
public void mul(float c) - Specified by:
mulin interfaceMulFloatingPoint
-
mul
public void mul(double c) - Specified by:
mulin interfaceMulFloatingPoint
-
getRealFloat
public float getRealFloat()- Specified by:
getRealFloatin interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
getRealDouble
public double getRealDouble()- Specified by:
getRealDoublein interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
setReal
public void setReal(float real) - Specified by:
setRealin interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
setReal
public void setReal(double real) - Specified by:
setRealin interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
setZero
public void setZero() -
setOne
public void setOne() -
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<T extends AbstractIntegerBitType<T>>
-
toString
-
getInteger
public int getInteger()- Specified by:
getIntegerin interfaceIntegerType<T extends AbstractIntegerBitType<T>>
-
getIntegerLong
public long getIntegerLong()- Specified by:
getIntegerLongin interfaceIntegerType<T extends AbstractIntegerBitType<T>>
-
getBigInteger
- Specified by:
getBigIntegerin interfaceIntegerType<T extends AbstractIntegerBitType<T>>
-
setInteger
public void setInteger(int f) - Specified by:
setIntegerin interfaceIntegerType<T extends AbstractIntegerBitType<T>>
-
setInteger
public void setInteger(long f) - Specified by:
setIntegerin interfaceIntegerType<T extends AbstractIntegerBitType<T>>
-
setBigInteger
- Specified by:
setBigIntegerin interfaceIntegerType<T extends AbstractIntegerBitType<T>>
-
getMaxValue
public double getMaxValue()The maximum value that can be stored isMath.pow(2, nBits) -1.- Specified by:
getMaxValuein interfaceRealType<T extends AbstractIntegerBitType<T>>
-
getMinValue
public double getMinValue()- Specified by:
getMinValuein interfaceRealType<T extends AbstractIntegerBitType<T>>
-
inc
public void inc()- Specified by:
incin interfaceRealType<T extends AbstractIntegerBitType<T>>
-
dec
public void dec()- Specified by:
decin interfaceRealType<T extends AbstractIntegerBitType<T>>
-
add
- Specified by:
addin interfaceAdd<T extends AbstractIntegerBitType<T>>
-
sub
- Specified by:
subin interfaceSub<T extends AbstractIntegerBitType<T>>
-
mul
- Specified by:
mulin interfaceMul<T extends AbstractIntegerBitType<T>>
-
div
- Specified by:
divin interfaceDiv<T extends AbstractIntegerBitType<T>>
-
set
Description copied from interface:TypeSets the value of anotherType.- Specified by:
setin interfaceType<T extends AbstractIntegerBitType<T>>- Parameters:
c- the new value
-
getImaginaryFloat
public float getImaginaryFloat()- Specified by:
getImaginaryFloatin interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
getImaginaryDouble
public double getImaginaryDouble()- Specified by:
getImaginaryDoublein interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
setImaginary
public void setImaginary(float complex) - Specified by:
setImaginaryin interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
setImaginary
public void setImaginary(double complex) - Specified by:
setImaginaryin interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
getPhaseFloat
public float getPhaseFloat()- Specified by:
getPhaseFloatin interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
getPhaseDouble
public double getPhaseDouble()- Specified by:
getPhaseDoublein interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
getPowerFloat
public float getPowerFloat()- Specified by:
getPowerFloatin interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
getPowerDouble
public double getPowerDouble()- Specified by:
getPowerDoublein interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
setComplexNumber
public void setComplexNumber(float r, float i) - Specified by:
setComplexNumberin interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
setComplexNumber
public void setComplexNumber(double r, double i) - Specified by:
setComplexNumberin interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
complexConjugate
public void complexConjugate()- Specified by:
complexConjugatein interfaceComplexType<T extends AbstractIntegerBitType<T>>
-
valueEquals
Default test at long precision. Please override for types longer than 64bit.- Specified by:
valueEqualsin interfaceValueEquals<T extends AbstractIntegerBitType<T>>- Parameters:
t-- Returns:
-