public class BitType extends AbstractIntegerType<BitType> implements BooleanType<BitType>, NativeType<BitType>, IntegerType<BitType>
Modifier and Type | Field and Description |
---|---|
protected LongAccess |
dataAccess |
protected Index |
i |
protected NativeImg<?,? extends LongAccess> |
img |
Constructor and Description |
---|
BitType() |
BitType(boolean value) |
BitType(LongAccess access) |
BitType(NativeImg<?,? extends LongAccess> bitStorage) |
Modifier and Type | Method and Description |
---|---|
void |
add(BitType c) |
void |
and(BitType c) |
int |
compareTo(BitType other) |
BitType |
copy()
|
BitType |
createVariable()
Creates a new
Type variable which can only store one value. |
void |
dec() |
void |
div(BitType c) |
BitType |
duplicateTypeOnSameNativeImg()
Creates a new
NativeType which stores in the same physical array. |
boolean |
equals(Object obj) |
boolean |
get() |
BigInteger |
getBigInteger() |
int |
getBitsPerPixel() |
Fraction |
getEntitiesPerPixel()
Get the number of entities in the storage array required to store one
pixel value.
|
int |
getInteger() |
long |
getIntegerLong() |
double |
getMaxValue() |
double |
getMinValue() |
NativeTypeFactory<BitType,LongAccess> |
getNativeTypeFactory() |
int |
hashCode() |
void |
inc() |
Index |
index()
Get the (modifiable) index into the current data array.
|
void |
mul(BitType c) |
void |
mul(double c) |
void |
mul(float c) |
void |
not() |
void |
or(BitType c) |
void |
set(BitType c)
Sets the value of another
Type . |
void |
set(boolean value) |
void |
setBigInteger(BigInteger b) |
void |
setInteger(int f) |
void |
setInteger(long f) |
void |
setOne() |
void |
setZero() |
void |
sub(BitType c) |
String |
toString() |
void |
updateContainer(Object c)
This method is used by an accessor (e.g., a
Cursor ) to request an
update of the current data array. |
boolean |
valueEquals(BitType t) |
void |
xor(BitType c) |
getMinIncrement, getRealDouble, getRealFloat, setReal, setReal
getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, pow, pow, setImaginary, setImaginary
complexConjugate, setComplexNumber, setComplexNumber
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
getMinIncrement
complexConjugate, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, getRealDouble, getRealFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginary, setReal, setReal
pow
protected final Index i
protected final NativeImg<?,? extends LongAccess> img
protected LongAccess dataAccess
public BitType(NativeImg<?,? extends LongAccess> bitStorage)
public BitType(boolean value)
public BitType(LongAccess access)
public BitType()
public void updateContainer(Object c)
NativeType
Cursor
) to request an
update of the current data array.
As an example consider a CellCursor
moving on a CellImg
.
The cursor maintains a NativeType
which provides access to the
image data. When the cursor moves from one cell to the next, the
underlying data array of the NativeType
must be switched to the
data array of the new cell.
To achieve this, the CellCursor
calls updateContainer()
with itself as the argument. updateContainer()
in turn will call
NativeImg.update(Object)
on it's container, passing along the
reference to the cursor. In this example, the container would be a
CellImg
. While the NativeType
does not know about the
type of the cursor, the container does. CellImg
knows that it is
passed a CellCursor
instance, which can be used to figure out the
current cell and the underlying data array, which is then returned to the
NativeType
.
The idea behind this concept is maybe not obvious. The NativeType
knows 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 of NativeType
.
updateContainer
in interface NativeType<BitType>
c
- reference to an accessor which can be passed on to the
container (which will know what to do with it).public Index index()
NativeType
index
in interface NativeType<BitType>
public BitType duplicateTypeOnSameNativeImg()
NativeType
NativeType
which stores in the same physical array.
This is only used internally.duplicateTypeOnSameNativeImg
in interface NativeType<BitType>
NativeType
instance working on the same
NativeImg
public NativeTypeFactory<BitType,LongAccess> getNativeTypeFactory()
getNativeTypeFactory
in interface NativeType<BitType>
public boolean get()
get
in interface BooleanType<BitType>
public void set(boolean value)
set
in interface BooleanType<BitType>
public int getInteger()
getInteger
in interface IntegerType<BitType>
public long getIntegerLong()
getIntegerLong
in interface IntegerType<BitType>
public BigInteger getBigInteger()
getBigInteger
in interface IntegerType<BitType>
public void setInteger(int f)
setInteger
in interface IntegerType<BitType>
public void setInteger(long f)
setInteger
in interface IntegerType<BitType>
public void setBigInteger(BigInteger b)
setBigInteger
in interface IntegerType<BitType>
public double getMaxValue()
getMaxValue
in interface RealType<BitType>
public double getMinValue()
getMinValue
in interface RealType<BitType>
public void set(BitType c)
Type
Type
.public void and(BitType c)
and
in interface BooleanType<BitType>
public void or(BitType c)
or
in interface BooleanType<BitType>
public void xor(BitType c)
xor
in interface BooleanType<BitType>
public void not()
not
in interface BooleanType<BitType>
public void add(BitType c)
public void div(BitType c)
public void mul(BitType c)
public void sub(BitType c)
public void mul(float c)
mul
in interface MulFloatingPoint
mul
in class AbstractRealType<BitType>
public void mul(double c)
mul
in interface MulFloatingPoint
mul
in class AbstractRealType<BitType>
public void setOne()
setOne
in interface SetOne
setOne
in class AbstractIntegerType<BitType>
public void setZero()
setZero
in interface SetZero
setZero
in class AbstractIntegerType<BitType>
public void inc()
public void dec()
public BitType createVariable()
Type
Type
variable which can only store one value.createVariable
in interface Type<BitType>
Type
variablepublic String toString()
toString
in class AbstractIntegerType<BitType>
public Fraction getEntitiesPerPixel()
NativeType
getEntitiesPerPixel
in interface NativeType<BitType>
public int getBitsPerPixel()
getBitsPerPixel
in interface RealType<BitType>
public int compareTo(BitType other)
compareTo
in interface Comparable<BitType>
compareTo
in class AbstractIntegerType<BitType>
public boolean valueEquals(BitType t)
valueEquals
in interface ValueEquals<BitType>
valueEquals
in class AbstractIntegerType<BitType>
public boolean equals(Object obj)
equals
in class AbstractIntegerType<BitType>
public int hashCode()
hashCode
in class AbstractIntegerType<BitType>
Copyright © 2015–2022 ImgLib2. All rights reserved.