Class AbstractNullPixelMask

java.lang.Object
nom.tam.image.compression.tile.mask.AbstractNullPixelMask
Direct Known Subclasses:
NullPixelMaskPreserver, NullPixelMaskRestorer

public class AbstractNullPixelMask extends Object
(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

    Fields
    Modifier and Type
    Field
    Description
    protected static final byte
    Byte value signifying invalid / null data
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    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 Type
    Method
    Description
    Returns the object that manages the compression, and which therefore handles the masking
    protected ByteBuffer
    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 a null 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
    Sets data for a new mask as a flattened buffer of data.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NULL_INDICATOR

      protected static final byte NULL_INDICATOR
      Byte 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 data
      tileIndex - the tile index
      nullValue - the integer value representing null or invalid data
      compressorControl - The class managing the compression
      Throws:
      IllegalStateException - if the compressorControl argument is null
  • 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

      public void setMask(ByteBuffer mask)
      Sets data for a new mask as a flattened buffer of data.
      Parameters:
      mask - the buffer containing the mask data in flattened format.
    • getCompressorControl

      protected ICompressorControl getCompressorControl()
      Returns the object that manages the compression, and which therefore handles the masking
      Returns:
      the object that manages the compression.
    • getMask

      protected ByteBuffer 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 a null or an undefined data point.
      Returns:
      the value that demarks an undefined datum.
    • getTileBuffer

      protected TileBuffer 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

      protected ByteBuffer initializedMask(int remaining)
      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.