Class BitType
- java.lang.Object
-
- net.imglib2.type.numeric.complex.AbstractComplexType<T>
-
- net.imglib2.type.numeric.real.AbstractRealType<T>
-
- net.imglib2.type.numeric.integer.AbstractIntegerType<BitType>
-
- net.imglib2.type.logic.BitType
-
- All Implemented Interfaces:
java.lang.Comparable<BitType>,BooleanType<BitType>,NativeType<BitType>,ComplexType<BitType>,IntegerType<BitType>,NumericType<BitType>,RealType<BitType>,Add<BitType>,Div<BitType>,Mul<BitType>,MulFloatingPoint,Pow<BitType>,PowFloatingPoint,SetOne,SetZero,Sub<BitType>,ValueEquals<BitType>,Type<BitType>
public class BitType extends AbstractIntegerType<BitType> implements BooleanType<BitType>, NativeType<BitType>, IntegerType<BitType>
TODO
-
-
Field Summary
Fields Modifier and Type Field Description protected LongAccessdataAccessprotected Indexiprotected NativeImg<?,? extends LongAccess>imgprivate static NativeTypeFactory<BitType,LongAccess>typeFactory
-
Constructor Summary
Constructors Constructor Description BitType()BitType(boolean value)BitType(LongAccess access)BitType(NativeImg<?,? extends LongAccess> bitStorage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(BitType c)voidand(BitType c)intcompareTo(BitType other)BitTypecopy()BitTypecreateVariable()Creates a newTypevariable which can only store one value.voiddec()voiddiv(BitType c)BitTypeduplicateTypeOnSameNativeImg()Creates a newNativeTypewhich stores in the same physical array.booleanequals(java.lang.Object obj)booleanget()java.math.BigIntegergetBigInteger()intgetBitsPerPixel()FractiongetEntitiesPerPixel()Get the number of entities in the storage array required to store one pixel value.intgetInteger()longgetIntegerLong()doublegetMaxValue()doublegetMinValue()NativeTypeFactory<BitType,LongAccess>getNativeTypeFactory()inthashCode()voidinc()Indexindex()Get the (modifiable) index into the current data array.voidmul(double c)voidmul(float c)voidmul(BitType c)voidnot()voidor(BitType c)voidset(boolean value)voidset(BitType c)Sets the value of anotherType.voidsetBigInteger(java.math.BigInteger b)voidsetInteger(int f)voidsetInteger(long f)voidsetOne()voidsetZero()voidsub(BitType 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(BitType t)voidxor(BitType c)-
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, getRealDouble, getRealFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginary, setReal, setReal
-
Methods inherited from interface net.imglib2.type.NativeType
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
-
Methods inherited from interface net.imglib2.type.operators.PowFloatingPoint
pow
-
Methods inherited from interface net.imglib2.type.numeric.RealType
getMinIncrement
-
-
-
-
Field Detail
-
i
protected final Index i
-
img
protected final NativeImg<?,? extends LongAccess> img
-
dataAccess
protected LongAccess dataAccess
-
typeFactory
private static final NativeTypeFactory<BitType,LongAccess> typeFactory
-
-
Constructor Detail
-
BitType
public BitType(NativeImg<?,? extends LongAccess> bitStorage)
-
BitType
public BitType(boolean value)
-
BitType
public BitType(LongAccess access)
-
BitType
public BitType()
-
-
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<BitType>- 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<BitType>
-
duplicateTypeOnSameNativeImg
public BitType duplicateTypeOnSameNativeImg()
Description copied from interface:NativeTypeCreates a newNativeTypewhich stores in the same physical array. This is only used internally.- Specified by:
duplicateTypeOnSameNativeImgin interfaceNativeType<BitType>- Returns:
- a new
NativeTypeinstance working on the sameNativeImg
-
getNativeTypeFactory
public NativeTypeFactory<BitType,LongAccess> getNativeTypeFactory()
- Specified by:
getNativeTypeFactoryin interfaceNativeType<BitType>
-
get
public boolean get()
- Specified by:
getin interfaceBooleanType<BitType>
-
set
public void set(boolean value)
- Specified by:
setin interfaceBooleanType<BitType>
-
getInteger
public int getInteger()
- Specified by:
getIntegerin interfaceIntegerType<BitType>
-
getIntegerLong
public long getIntegerLong()
- Specified by:
getIntegerLongin interfaceIntegerType<BitType>
-
getBigInteger
public java.math.BigInteger getBigInteger()
- Specified by:
getBigIntegerin interfaceIntegerType<BitType>
-
setInteger
public void setInteger(int f)
- Specified by:
setIntegerin interfaceIntegerType<BitType>
-
setInteger
public void setInteger(long f)
- Specified by:
setIntegerin interfaceIntegerType<BitType>
-
setBigInteger
public void setBigInteger(java.math.BigInteger b)
- Specified by:
setBigIntegerin interfaceIntegerType<BitType>
-
getMaxValue
public double getMaxValue()
- Specified by:
getMaxValuein interfaceRealType<BitType>
-
getMinValue
public double getMinValue()
- Specified by:
getMinValuein interfaceRealType<BitType>
-
set
public void set(BitType c)
Description copied from interface:TypeSets the value of anotherType.
-
and
public void and(BitType c)
- Specified by:
andin interfaceBooleanType<BitType>
-
or
public void or(BitType c)
- Specified by:
orin interfaceBooleanType<BitType>
-
xor
public void xor(BitType c)
- Specified by:
xorin interfaceBooleanType<BitType>
-
not
public void not()
- Specified by:
notin interfaceBooleanType<BitType>
-
add
public void add(BitType c)
-
div
public void div(BitType c)
-
mul
public void mul(BitType c)
-
sub
public void sub(BitType c)
-
mul
public void mul(float c)
- Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<BitType>
-
mul
public void mul(double c)
- Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<BitType>
-
setOne
public void setOne()
- Specified by:
setOnein interfaceSetOne- Overrides:
setOnein classAbstractIntegerType<BitType>
-
setZero
public void setZero()
- Specified by:
setZeroin interfaceSetZero- Overrides:
setZeroin classAbstractIntegerType<BitType>
-
inc
public void inc()
-
dec
public void dec()
-
createVariable
public BitType createVariable()
Description copied from interface:TypeCreates a newTypevariable which can only store one value.- Specified by:
createVariablein interfaceType<BitType>- Returns:
- a new
Typevariable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractIntegerType<BitType>
-
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<BitType>- Returns:
- the number of storage type entities required to store one pixel value.
-
getBitsPerPixel
public int getBitsPerPixel()
- Specified by:
getBitsPerPixelin interfaceRealType<BitType>
-
compareTo
public int compareTo(BitType other)
- Specified by:
compareToin interfacejava.lang.Comparable<BitType>- Overrides:
compareToin classAbstractIntegerType<BitType>
-
valueEquals
public boolean valueEquals(BitType t)
- Specified by:
valueEqualsin interfaceValueEquals<BitType>- Overrides:
valueEqualsin classAbstractIntegerType<BitType>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classAbstractIntegerType<BitType>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractIntegerType<BitType>
-
-