public abstract class GenericShortType<T extends GenericShortType<T>> extends AbstractIntegerType<T> implements NativeType<T>
native
IntegerType
s that
encode their value into a 16bit short.Modifier and Type | Field and Description |
---|---|
protected ShortAccess |
dataAccess |
protected NativeImg<?,? extends ShortAccess> |
img |
Constructor and Description |
---|
GenericShortType() |
GenericShortType(NativeImg<?,? extends ShortAccess> shortStorage) |
GenericShortType(short value) |
GenericShortType(ShortAccess access) |
Modifier and Type | Method and Description |
---|---|
void |
add(T c) |
int |
compareTo(T other) |
void |
dec() |
void |
div(T c) |
boolean |
equals(Object obj) |
int |
getBitsPerPixel() |
Fraction |
getEntitiesPerPixel()
Get the number of entities in the storage array required to store one
pixel value.
|
abstract NativeTypeFactory<T,ShortAccess> |
getNativeTypeFactory() |
short |
getShort()
Returns the primitive short value that is used to store this type.
|
protected short |
getValue()
Deprecated.
Use
getShort() instead. |
int |
hashCode() |
void |
inc() |
Index |
index()
Get the (modifiable) index into the current data array.
|
void |
mul(double c) |
void |
mul(float c) |
void |
mul(T c) |
void |
set(T c)
Sets the value of another
Type . |
void |
setOne() |
void |
setShort(short f)
Sets the primitive short value that is used to store this type.
|
protected void |
setValue(short f)
Deprecated.
Use
setShort(short) instead. |
void |
setZero() |
void |
sub(T 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(T t) |
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, duplicateTypeOnSameNativeImg, getIndex, incIndex, incIndex, updateIndex
copy, createVariable
getBigInteger, getInteger, getIntegerLong, setBigInteger, setInteger, setInteger
getMaxValue, getMinValue
complexConjugate, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginary
pow
protected final NativeImg<?,? extends ShortAccess> img
protected ShortAccess dataAccess
public GenericShortType(NativeImg<?,? extends ShortAccess> shortStorage)
public GenericShortType(short value)
public GenericShortType(ShortAccess access)
public GenericShortType()
public Fraction getEntitiesPerPixel()
NativeType
getEntitiesPerPixel
in interface NativeType<T extends GenericShortType<T>>
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<T extends GenericShortType<T>>
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<T extends GenericShortType<T>>
public abstract NativeTypeFactory<T,ShortAccess> getNativeTypeFactory()
getNativeTypeFactory
in interface NativeType<T extends GenericShortType<T>>
@Deprecated protected short getValue()
getShort()
instead.@Deprecated protected void setValue(short f)
setShort(short)
instead.public short getShort()
public void setShort(short f)
public void mul(float c)
mul
in interface MulFloatingPoint
mul
in class AbstractRealType<T extends GenericShortType<T>>
public void mul(double c)
mul
in interface MulFloatingPoint
mul
in class AbstractRealType<T extends GenericShortType<T>>
public void add(T c)
add
in interface Add<T extends GenericShortType<T>>
add
in class AbstractRealType<T extends GenericShortType<T>>
public void div(T c)
div
in interface Div<T extends GenericShortType<T>>
div
in class AbstractRealType<T extends GenericShortType<T>>
public void mul(T c)
mul
in interface Mul<T extends GenericShortType<T>>
mul
in class AbstractRealType<T extends GenericShortType<T>>
public void sub(T c)
sub
in interface Sub<T extends GenericShortType<T>>
sub
in class AbstractRealType<T extends GenericShortType<T>>
public void set(T c)
Type
Type
.set
in interface Type<T extends GenericShortType<T>>
set
in class AbstractRealType<T extends GenericShortType<T>>
c
- the new valuepublic void setOne()
setOne
in interface SetOne
setOne
in class AbstractIntegerType<T extends GenericShortType<T>>
public void setZero()
setZero
in interface SetZero
setZero
in class AbstractIntegerType<T extends GenericShortType<T>>
public void inc()
inc
in interface RealType<T extends GenericShortType<T>>
inc
in class AbstractIntegerType<T extends GenericShortType<T>>
public void dec()
dec
in interface RealType<T extends GenericShortType<T>>
dec
in class AbstractIntegerType<T extends GenericShortType<T>>
public String toString()
toString
in class AbstractIntegerType<T extends GenericShortType<T>>
public int getBitsPerPixel()
getBitsPerPixel
in interface RealType<T extends GenericShortType<T>>
public int compareTo(T other)
compareTo
in interface Comparable<T extends GenericShortType<T>>
compareTo
in class AbstractIntegerType<T extends GenericShortType<T>>
public boolean valueEquals(T t)
valueEquals
in interface ValueEquals<T extends GenericShortType<T>>
valueEquals
in class AbstractIntegerType<T extends GenericShortType<T>>
public boolean equals(Object obj)
equals
in class AbstractIntegerType<T extends GenericShortType<T>>
public int hashCode()
hashCode
in class AbstractIntegerType<T extends GenericShortType<T>>
Copyright © 2015–2022 ImgLib2. All rights reserved.