Class UnsignedVariableBitLengthType
java.lang.Object
net.imglib2.type.AbstractBitType<UnsignedVariableBitLengthType>
net.imglib2.type.AbstractBit64Type<UnsignedVariableBitLengthType>
net.imglib2.type.numeric.integer.UnsignedVariableBitLengthType
- All Implemented Interfaces:
Comparable<UnsignedVariableBitLengthType>, NativeType<UnsignedVariableBitLengthType>, ComplexType<UnsignedVariableBitLengthType>, IntegerType<UnsignedVariableBitLengthType>, NumericType<UnsignedVariableBitLengthType>, RealType<UnsignedVariableBitLengthType>, Add<UnsignedVariableBitLengthType>, Div<UnsignedVariableBitLengthType>, Mul<UnsignedVariableBitLengthType>, MulFloatingPoint, Pow<UnsignedVariableBitLengthType>, PowFloatingPoint, SetOne, SetZero, Sub<UnsignedVariableBitLengthType>, ValueEquals<UnsignedVariableBitLengthType>, Type<UnsignedVariableBitLengthType>
public class UnsignedVariableBitLengthType
extends AbstractBit64Type<UnsignedVariableBitLengthType>
implements IntegerType<UnsignedVariableBitLengthType>
A
Type with arbitrary bit depth up to maximum 64 bits. The behavior
beyond 64 bits is undefined.
The performance of this type is traded off for the gain in memory storage.
The set(long) operation takes have the time as the get()
operation. The performance may degrade very slightly with increasing bit
depth, but the decrease is barely noticeable.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NativeTypeFactory<UnsignedVariableBitLengthType, LongAccess> Fields inherited from class AbstractBitType
dataAccess, i, img, nBits -
Constructor Summary
ConstructorsConstructorDescriptionUnsignedVariableBitLengthType(int nBits) UnsignedVariableBitLengthType(long value, int nBits) UnsignedVariableBitLengthType(LongAccess access, int nBits) UnsignedVariableBitLengthType(NativeImg<?, ? extends LongAccess> bitStorage, int nBits) -
Method Summary
Modifier and TypeMethodDescriptionvoidintvoidcopy()Creates a newTypevariable which can only store one value.voiddec()voidCreates a newNativeTypewhich stores in the same physical array.booleanlongget()intdoublefloatintlongdoubleThe maximum value that can be stored isMath.pow(2, nBits) -1.doubledoubledoublefloatdoublefloatdoublefloatinthashCode()voidinc()voidmul(double c) voidmul(float c) voidvoidpow(double power) voidvoidset(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()booleanDefault test at long precision.Methods inherited from class AbstractBit64Type
getBits, setBitsMethods inherited from class AbstractBitType
getEntitiesPerPixel, index, updateContainerMethods inherited from interface NativeType
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
-
Field Details
-
typeFactory
-
-
Constructor Details
-
UnsignedVariableBitLengthType
-
UnsignedVariableBitLengthType
public UnsignedVariableBitLengthType(long value, int nBits) -
UnsignedVariableBitLengthType
-
UnsignedVariableBitLengthType
public UnsignedVariableBitLengthType(int nBits)
-
-
Method Details
-
set
public void set(long value) -
get
public long get() -
set
Description copied from interface:TypeSets the value of anotherType.- Specified by:
setin interfaceType<UnsignedVariableBitLengthType>- Parameters:
c- the new value
-
duplicateTypeOnSameNativeImg
Description copied from interface:NativeTypeCreates a newNativeTypewhich stores in the same physical array. This is only used internally.- Specified by:
duplicateTypeOnSameNativeImgin interfaceNativeType<UnsignedVariableBitLengthType>- Returns:
- a new
NativeTypeinstance working on the sameNativeImg
-
getNativeTypeFactory
- Specified by:
getNativeTypeFactoryin interfaceNativeType<UnsignedVariableBitLengthType>- Specified by:
getNativeTypeFactoryin classAbstractBitType<UnsignedVariableBitLengthType>
-
createVariable
Description copied from interface:TypeCreates a newTypevariable which can only store one value.- Specified by:
createVariablein interfaceType<UnsignedVariableBitLengthType>- Returns:
- a new
Typevariable
-
copy
Description copied from interface:Type- Specified by:
copyin interfaceType<UnsignedVariableBitLengthType>- Returns:
- a new
Typevariable
-
div
- Specified by:
divin interfaceDiv<UnsignedVariableBitLengthType>- See Also:
-
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<UnsignedVariableBitLengthType>
-
getRealDouble
public double getRealDouble()- Specified by:
getRealDoublein interfaceComplexType<UnsignedVariableBitLengthType>
-
setReal
public void setReal(float real) - Specified by:
setRealin interfaceComplexType<UnsignedVariableBitLengthType>
-
setReal
public void setReal(double real) - Specified by:
setRealin interfaceComplexType<UnsignedVariableBitLengthType>
-
setZero
-
setOne
-
getBitsPerPixel
public int getBitsPerPixel()- Specified by:
getBitsPerPixelin interfaceRealType<UnsignedVariableBitLengthType>
-
getMinIncrement
public double getMinIncrement()- Specified by:
getMinIncrementin interfaceRealType<UnsignedVariableBitLengthType>
-
toString
-
getInteger
public int getInteger()- Specified by:
getIntegerin interfaceIntegerType<UnsignedVariableBitLengthType>
-
getIntegerLong
public long getIntegerLong()- Specified by:
getIntegerLongin interfaceIntegerType<UnsignedVariableBitLengthType>
-
getBigInteger
- Specified by:
getBigIntegerin interfaceIntegerType<UnsignedVariableBitLengthType>
-
setInteger
public void setInteger(int f) - Specified by:
setIntegerin interfaceIntegerType<UnsignedVariableBitLengthType>
-
setInteger
public void setInteger(long f) - Specified by:
setIntegerin interfaceIntegerType<UnsignedVariableBitLengthType>
-
setBigInteger
- Specified by:
setBigIntegerin interfaceIntegerType<UnsignedVariableBitLengthType>
-
getMaxValue
public double getMaxValue()The maximum value that can be stored isMath.pow(2, nBits) -1.- Specified by:
getMaxValuein interfaceRealType<UnsignedVariableBitLengthType>
-
getMinValue
public double getMinValue()- Specified by:
getMinValuein interfaceRealType<UnsignedVariableBitLengthType>
-
inc
public void inc()- Specified by:
incin interfaceRealType<UnsignedVariableBitLengthType>
-
dec
public void dec()- Specified by:
decin interfaceRealType<UnsignedVariableBitLengthType>
-
add
- Specified by:
addin interfaceAdd<UnsignedVariableBitLengthType>
-
sub
- Specified by:
subin interfaceSub<UnsignedVariableBitLengthType>
-
mul
- Specified by:
mulin interfaceMul<UnsignedVariableBitLengthType>
-
pow
- Specified by:
powin interfacePow<UnsignedVariableBitLengthType>
-
pow
public void pow(double power) - Specified by:
powin interfacePowFloatingPoint
-
getImaginaryFloat
public float getImaginaryFloat()- Specified by:
getImaginaryFloatin interfaceComplexType<UnsignedVariableBitLengthType>
-
getImaginaryDouble
public double getImaginaryDouble()- Specified by:
getImaginaryDoublein interfaceComplexType<UnsignedVariableBitLengthType>
-
setImaginary
public void setImaginary(float complex) - Specified by:
setImaginaryin interfaceComplexType<UnsignedVariableBitLengthType>
-
setImaginary
public void setImaginary(double complex) - Specified by:
setImaginaryin interfaceComplexType<UnsignedVariableBitLengthType>
-
getPhaseFloat
public float getPhaseFloat()- Specified by:
getPhaseFloatin interfaceComplexType<UnsignedVariableBitLengthType>
-
getPhaseDouble
public double getPhaseDouble()- Specified by:
getPhaseDoublein interfaceComplexType<UnsignedVariableBitLengthType>
-
getPowerFloat
public float getPowerFloat()- Specified by:
getPowerFloatin interfaceComplexType<UnsignedVariableBitLengthType>
-
getPowerDouble
public double getPowerDouble()- Specified by:
getPowerDoublein interfaceComplexType<UnsignedVariableBitLengthType>
-
setComplexNumber
public void setComplexNumber(float r, float i) - Specified by:
setComplexNumberin interfaceComplexType<UnsignedVariableBitLengthType>
-
setComplexNumber
public void setComplexNumber(double r, double i) - Specified by:
setComplexNumberin interfaceComplexType<UnsignedVariableBitLengthType>
-
complexConjugate
public void complexConjugate()- Specified by:
complexConjugatein interfaceComplexType<UnsignedVariableBitLengthType>
-
compareTo
- Specified by:
compareToin interfaceComparable<UnsignedVariableBitLengthType>
-
valueEquals
Default test at long precision. Please override for types longer than 64bit.- Specified by:
valueEqualsin interfaceValueEquals<UnsignedVariableBitLengthType>- Parameters:
t-- Returns:
-
equals
-
hashCode
-