Class GenericShortType<T extends GenericShortType<T>>
- All Implemented Interfaces:
Comparable<T>,NativeType<T>,ComplexType<T>,IntegerType<T>,NumericType<T>,RealType<T>,Add<T>,Div<T>,Mul<T>,MulFloatingPoint,SetOne,SetZero,Sub<T>,ValueEquals<T>,Type<T>
- Direct Known Subclasses:
ShortType,UnsignedShortType
native IntegerTypes that
encode their value into a 16bit short.- Author:
- Stephan Preibisch, Stephan Saalfeld
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ShortAccessprotected final NativeImg<?, ? extends ShortAccess> -
Constructor Summary
ConstructorsConstructorDescriptionGenericShortType(short value) GenericShortType(ShortAccess access) GenericShortType(NativeImg<?, ? extends ShortAccess> shortStorage) -
Method Summary
Modifier and TypeMethodDescriptionvoidintvoiddec()voiddecIndex()Decrement the index into the current data array.voiddecIndex(int decrement) Decrease the index into the current data array bydecrementsteps.voidintGet the number of entities in the storage array required to store one pixel value.intgetIndex()Get the current index into the current data array.shortgetShort()Returns the primitive short value that is used to store this type.protected shortgetValue()Deprecated.inthashCode()voidinc()voidincIndex()Increment the index into the current data array.voidincIndex(int increment) Increases the index into the current data array byincrementsteps.voidmul(double c) voidmul(float c) voidvoidSets the value of anotherType.voidsetOne()voidsetShort(short f) Sets the primitive short value that is used to store this type.protected voidsetValue(short f) Deprecated.UsesetShort(short)instead.voidsetZero()voidtoString()voidThis method is used by an accessor (e.g., aCursor) to request an update of the current data array.voidupdateIndex(int index) Set the index into the current data array.booleanvalueEquals(T t) Methods inherited from class net.imglib2.type.numeric.integer.AbstractIntegerType
getMinIncrement, getRealDouble, getRealFloat, setReal, setRealMethods inherited from class net.imglib2.type.numeric.real.AbstractRealType
equals, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, setImaginary, setImaginaryMethods inherited from class net.imglib2.type.numeric.complex.AbstractComplexType
complexConjugate, setComplexNumber, setComplexNumberMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.imglib2.type.numeric.ComplexType
complexConjugate, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, setComplexNumber, setComplexNumber, setImaginary, setImaginaryMethods inherited from interface net.imglib2.type.numeric.IntegerType
getBigInteger, getInteger, getIntegerLong, setBigInteger, setInteger, setIntegerMethods inherited from interface net.imglib2.type.NativeType
createSuitableNativeImg, duplicateTypeOnSameNativeImgMethods inherited from interface net.imglib2.type.numeric.RealType
getMaxValue, getMinValueMethods inherited from interface net.imglib2.type.Type
copy, createVariable
-
Field Details
-
img
-
dataAccess
-
-
Constructor Details
-
GenericShortType
-
GenericShortType
public GenericShortType(short value) -
GenericShortType
-
GenericShortType
public GenericShortType()
-
-
Method Details
-
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<T extends GenericShortType<T>>- Returns:
- the number of storage type entities required to store one pixel value.
-
updateContainer
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<T extends GenericShortType<T>>- Parameters:
c- reference to an accessor which can be passed on to the container (which will know what to do with it).
-
getValue
Deprecated.UsegetShort()instead. -
setValue
Deprecated.UsesetShort(short)instead. -
getShort
public short getShort()Returns the primitive short value that is used to store this type.- Returns:
- primitive short value
-
setShort
public void setShort(short f) Sets the primitive short value that is used to store this type. -
mul
public void mul(float c) - Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<T extends GenericShortType<T>>
-
mul
public void mul(double c) - Specified by:
mulin interfaceMulFloatingPoint- Overrides:
mulin classAbstractRealType<T extends GenericShortType<T>>
-
add
- Specified by:
addin interfaceAdd<T extends GenericShortType<T>>- Overrides:
addin classAbstractRealType<T extends GenericShortType<T>>
-
div
- Specified by:
divin interfaceDiv<T extends GenericShortType<T>>- Overrides:
divin classAbstractRealType<T extends GenericShortType<T>>
-
mul
- Specified by:
mulin interfaceMul<T extends GenericShortType<T>>- Overrides:
mulin classAbstractRealType<T extends GenericShortType<T>>
-
sub
- Specified by:
subin interfaceSub<T extends GenericShortType<T>>- Overrides:
subin classAbstractRealType<T extends GenericShortType<T>>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractIntegerType<T extends GenericShortType<T>>
-
compareTo
- Specified by:
compareToin interfaceComparable<T extends GenericShortType<T>>- Overrides:
compareToin classAbstractIntegerType<T extends GenericShortType<T>>
-
set
Description copied from interface:TypeSets the value of anotherType.- Specified by:
setin interfaceType<T extends GenericShortType<T>>- Overrides:
setin classAbstractRealType<T extends GenericShortType<T>>- Parameters:
c- the new value
-
setOne
public void setOne()- Specified by:
setOnein interfaceSetOne- Overrides:
setOnein classAbstractIntegerType<T extends GenericShortType<T>>
-
setZero
public void setZero()- Specified by:
setZeroin interfaceSetZero- Overrides:
setZeroin classAbstractIntegerType<T extends GenericShortType<T>>
-
inc
public void inc()- Specified by:
incin interfaceRealType<T extends GenericShortType<T>>- Overrides:
incin classAbstractIntegerType<T extends GenericShortType<T>>
-
dec
public void dec()- Specified by:
decin interfaceRealType<T extends GenericShortType<T>>- Overrides:
decin classAbstractIntegerType<T extends GenericShortType<T>>
-
toString
- Overrides:
toStringin classAbstractIntegerType<T extends GenericShortType<T>>
-
updateIndex
public void updateIndex(int index) Description copied from interface:NativeTypeSet the index into the current data array.This is used by accessors (e.g., a
Cursor) to position theNativeTypein the container.- Specified by:
updateIndexin interfaceNativeType<T extends GenericShortType<T>>- Parameters:
index- the new array index
-
getIndex
public int getIndex()Description copied from interface:NativeTypeGet the current index into the current data array.This is used by accessors (e.g., a
Cursor) to position theNativeTypein the container.- Specified by:
getIndexin interfaceNativeType<T extends GenericShortType<T>>- Returns:
- the current index into the underlying data array
-
incIndex
public void incIndex()Description copied from interface:NativeTypeIncrement the index into the current data array.This is used by accessors (e.g., a
Cursor) to position theNativeTypein the container.- Specified by:
incIndexin interfaceNativeType<T extends GenericShortType<T>>
-
incIndex
public void incIndex(int increment) Description copied from interface:NativeTypeIncreases the index into the current data array byincrementsteps.This is used by accessors (e.g., a
Cursor) to position theNativeTypein the container.- Specified by:
incIndexin interfaceNativeType<T extends GenericShortType<T>>- Parameters:
increment- how many steps
-
decIndex
public void decIndex()Description copied from interface:NativeTypeDecrement the index into the current data array.This is used by accessors (e.g., a
Cursor) to position theNativeTypein the container.- Specified by:
decIndexin interfaceNativeType<T extends GenericShortType<T>>
-
decIndex
public void decIndex(int decrement) Description copied from interface:NativeTypeDecrease the index into the current data array bydecrementsteps.This is used by accessors (e.g., a
Cursor) to position theNativeTypein the container.- Specified by:
decIndexin interfaceNativeType<T extends GenericShortType<T>>- Parameters:
decrement- how many steps
-
getBitsPerPixel
public int getBitsPerPixel()- Specified by:
getBitsPerPixelin interfaceRealType<T extends GenericShortType<T>>
-
valueEquals
- Specified by:
valueEqualsin interfaceValueEquals<T extends GenericShortType<T>>
-
getShort()instead.