Class AbstractBitType<T extends AbstractBitType<T>>
- All Implemented Interfaces:
NativeType<T>, ValueEquals<T>, Type<T>
- Direct Known Subclasses:
AbstractBit64Type, AbstractIntegerBitType
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LongAccessprotected final Indexprotected final NativeImg<?, ? extends LongAccess> protected final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the number of entities in the storage array required to store one pixel value.abstract NativeTypeFactory<T, LongAccess> index()Get the (modifiable) index into the current data array.voidThis method is used by an accessor (e.g., aCursor) to request an update of the current data array.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface NativeType
decIndex, decIndex, duplicateTypeOnSameNativeImg, getIndex, incIndex, incIndex, updateIndexMethods inherited from interface Type
copy, createVariable, setMethods inherited from interface ValueEquals
valueEquals
-
Field Details
-
i
-
nBits
protected final int nBits -
img
-
dataAccess
-
-
Constructor Details
-
AbstractBitType
-
-
Method Details
-
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 AbstractBitType<T>>- Parameters:
c- reference to an accessor which can be passed on to the container (which will know what to do with it).
-
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<T extends AbstractBitType<T>>
-
getNativeTypeFactory
- Specified by:
getNativeTypeFactoryin interfaceNativeType<T extends AbstractBitType<T>>
-
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 AbstractBitType<T>>- Returns:
- the number of storage type entities required to store one pixel value.
-