Class AbstractNullPixelMask
java.lang.Object
nom.tam.image.compression.tile.mask.AbstractNullPixelMask
- Direct Known Subclasses:
NullPixelMaskPreserver
,NullPixelMaskRestorer
(for internal use) Base support for blank (
null
) in
compressed images. In regular images specific values (such as
Double.NaN
or a specific integer value) may be used to indicate
missing data. However, because of e.g. quantization or lossy compression,
these specific values may not be recovered exactly when compressing /
decompressing images. Hence, there is a need to demark null
values differently in copmressed images. This class provides support for that
purpose.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final byte
Byte value signifying invalid / null data -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractNullPixelMask
(TileBuffer tileBuffer, int tileIndex, long nullValue, ICompressorControl compressorControl) Creates a new pixel mask got a given image tile and designated null value. -
Method Summary
Modifier and TypeMethodDescriptionprotected ICompressorControl
Returns the object that manages the compression, and which therefore handles the maskingprotected ByteBuffer
getMask()
Returns the mask data as a buffer in flattened format.byte[]
Deprecated.(for internal use) Visibility may be reduced to package level in the future.protected long
Returns the value that represents anull
or an undefined data point.protected TileBuffer
Returns the buffer that holds data for an image tile.protected int
Return the tile index for the image tile that is processed.protected ByteBuffer
initializedMask
(int remaining) Creates an internal buffer for holding the mask data, for the specified number of points.void
setMask
(ByteBuffer mask) Sets data for a new mask as a flattened buffer of data.
-
Field Details
-
NULL_INDICATOR
protected static final byte NULL_INDICATORByte value signifying invalid / null data- See Also:
-
-
Constructor Details
-
AbstractNullPixelMask
protected AbstractNullPixelMask(TileBuffer tileBuffer, int tileIndex, long nullValue, ICompressorControl compressorControl) throws IllegalStateException Creates a new pixel mask got a given image tile and designated null value.- Parameters:
tileBuffer
- the buffer containing the tile datatileIndex
- the tile indexnullValue
- the integer value representingnull
or invalid datacompressorControl
- The class managing the compression- Throws:
IllegalStateException
- if the compressorControl argument isnull
-
-
Method Details
-
getMaskBytes
public byte[] getMaskBytes()Deprecated.(for internal use) Visibility may be reduced to package level in the future.Returns a byte array containing the mask- Returns:
- the byte array containing the pixel mask for the tile.
-
setMask
Sets data for a new mask as a flattened buffer of data.- Parameters:
mask
- the buffer containing the mask data in flattened format.
-
getCompressorControl
Returns the object that manages the compression, and which therefore handles the masking- Returns:
- the object that manages the compression.
-
getMask
Returns the mask data as a buffer in flattened format.- Returns:
- the buffer containing the mask data in flattened format.
-
getNullValue
protected long getNullValue()Returns the value that represents anull
or an undefined data point.- Returns:
- the value that demarks an undefined datum.
-
getTileBuffer
Returns the buffer that holds data for an image tile.- Returns:
- the buffer that holds data for a single image tile.
-
getTileIndex
protected int getTileIndex()Return the tile index for the image tile that is processed.- Returns:
- the image tile index
-
initializedMask
Creates an internal buffer for holding the mask data, for the specified number of points.- Parameters:
remaining
- the number of points the mask should accomodate.- Returns:
- the internal buffer that may store the mask data for the specified number of data points.
-