Class BasePairCharType
- All Implemented Interfaces:
Comparable<BasePairCharType>,BasePairType<BasePairCharType>,NativeType<BasePairCharType>,ValueEquals<BasePairCharType>,Type<BasePairCharType>
BasePairBitType.Base enumeration.- Author:
- Stephan Preibisch, Stephan Saalfeld
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CharAccessprotected final NativeImg<?, ? extends CharAccess> Fields inherited from class net.imglib2.type.AbstractNativeType
i -
Constructor Summary
ConstructorsConstructorDescriptionBasePairCharType(char value) BasePairCharType(NativeImg<?, ? extends CharAccess> charStorage) -
Method Summary
Modifier and TypeMethodDescriptionbyteintvoidcopy()NativeImg<BasePairCharType, ? extends CharAccess> createSuitableNativeImg(NativeImgFactory<BasePairCharType> storageFactory, long[] dim) TheNativeTypecreates theNativeImgused for storing image data; based on the given storage strategy and its size.Creates a newTypevariable which can only store one value.Creates a newNativeTypewhich stores in the same physical array.get()chargetChar()Get the number of entities in the storage array required to store one pixel value.voidset(BasePairBitType.Base base) voidSets the value of anotherType.voidsetChar(char f) toString()voidThis method is used by an accessor (e.g., aCursor) to request an update of the current data array.booleanMethods inherited from class net.imglib2.type.AbstractNativeType
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
-
Field Details
-
img
-
dataAccess
-
-
Constructor Details
-
BasePairCharType
-
BasePairCharType
-
BasePairCharType
public BasePairCharType(char value) -
BasePairCharType
public BasePairCharType()
-
-
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<BasePairCharType>- Returns:
- the number of storage type entities required to store one pixel value.
-
createSuitableNativeImg
public NativeImg<BasePairCharType,? extends CharAccess> createSuitableNativeImg(NativeImgFactory<BasePairCharType> storageFactory, long[] dim) Description copied from interface:NativeTypeTheNativeTypecreates theNativeImgused for storing image data; based on the given storage strategy and its size. It basically only decides here which BasicType it uses (float, int, byte, bit, ...) and how many entities per pixel it needs (e.g. 2 floats per pixel for a complex number). This enables the separation of containers and the basic types.- Specified by:
createSuitableNativeImgin interfaceNativeType<BasePairCharType>- Parameters:
storageFactory- which storage strategy is useddim- the dimensions- Returns:
- the instantiated
NativeImgwhere only theTypeknows the BasicType it contains.
-
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<BasePairCharType>- Parameters:
c- reference to an accessor which can be passed on to the container (which will know what to do with it).
-
duplicateTypeOnSameNativeImg
Description copied from interface:NativeTypeCreates a newNativeTypewhich stores in the same physical array. This is only used internally.- Specified by:
duplicateTypeOnSameNativeImgin interfaceNativeType<BasePairCharType>- Returns:
- a new
NativeTypeinstance working on the sameNativeImg
-
getChar
public char getChar() -
setChar
public void setChar(char f) -
set
- Specified by:
setin interfaceBasePairType<BasePairCharType>
-
get
- Specified by:
getin interfaceBasePairType<BasePairCharType>
-
set
Description copied from interface:TypeSets the value of anotherType.- Specified by:
setin interfaceType<BasePairCharType>- Parameters:
c- the new value
-
compareTo
- Specified by:
compareToin interfaceComparable<BasePairCharType>
-
complement
public void complement()- Specified by:
complementin interfaceBasePairType<BasePairCharType>
-
baseToValue
public byte baseToValue()- Specified by:
baseToValuein interfaceBasePairType<BasePairCharType>
-
createVariable
Description copied from interface:TypeCreates a newTypevariable which can only store one value.- Specified by:
createVariablein interfaceType<BasePairCharType>- Returns:
- a new
Typevariable
-
copy
Description copied from interface:Type- Specified by:
copyin interfaceType<BasePairCharType>- Returns:
- a new
Typevariable
-
toString
- Specified by:
toStringin classAbstractNativeType<BasePairCharType>
-
valueEquals
- Specified by:
valueEqualsin interfaceValueEquals<BasePairCharType>
-