Package net.imglib2.type
Class AbstractBit64Type<T extends AbstractBit64Type<T>>
java.lang.Object
net.imglib2.type.AbstractBitType<T>
net.imglib2.type.AbstractBit64Type<T>
- All Implemented Interfaces:
NativeType<T>
,ValueEquals<T>
,Type<T>
- Direct Known Subclasses:
BasePairBitType
,UnsignedVariableBitLengthType
A
Type
with arbitrary bit depth up to maximum 64 bits.
The behavior beyond 64 bits is undefined.
To set and get bits, we use longs. Therefore not more than 64 bits are supported. The long is not
supposed to have anything to do with math, it is simply an efficient way to hold an array of bits
The performance of this type is traded off for the gain in memory storage.
The setBits(long)
operation takes have the time as the getBits()
operation.
The performance may degrade very slightly with increasing bit depth, but the decrease is barely noticeable.- Author:
- Albert Cardona, Stephan Preibisch
-
Field Summary
Fields inherited from class net.imglib2.type.AbstractBitType
dataAccess, i, img, nBits
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractBit64Type
(int nBits) AbstractBit64Type
(long value, int nBits) AbstractBit64Type
(LongAccess access, int nBits) AbstractBit64Type
(NativeImg<?, ? extends LongAccess> bitStorage, int nBits) -
Method Summary
Modifier and TypeMethodDescriptionprotected long
getBits()
Writes the current "subLong" location of the LongAccess into the lower nBits bits of the long value Note that "long value" does not refer to math, it is just a way to help to return arbitrary values.protected void
setBits
(long value) Sets the lower nBits bits of the long value into the current "subLong" location of the LongAccess Note that "long value" does not refer to math, it is just a way to help to set arbitrary values.Methods inherited from class net.imglib2.type.AbstractBitType
decIndex, decIndex, getEntitiesPerPixel, getIndex, incIndex, incIndex, updateContainer, updateIndex
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.NativeType
createSuitableNativeImg, duplicateTypeOnSameNativeImg
Methods inherited from interface net.imglib2.type.Type
copy, createVariable, set
Methods inherited from interface net.imglib2.type.operators.ValueEquals
valueEquals
-
Constructor Details
-
AbstractBit64Type
-
AbstractBit64Type
public AbstractBit64Type(long value, int nBits) -
AbstractBit64Type
-
AbstractBit64Type
public AbstractBit64Type(int nBits)
-
-
Method Details
-
getBits
protected long getBits()Writes the current "subLong" location of the LongAccess into the lower nBits bits of the long value Note that "long value" does not refer to math, it is just a way to help to return arbitrary values. It is basically an array of bits.- Returns:
-
setBits
protected void setBits(long value) Sets the lower nBits bits of the long value into the current "subLong" location of the LongAccess Note that "long value" does not refer to math, it is just a way to help to set arbitrary values. It is basically an array of bits.- Parameters:
value
-
-