Class TiledImageCompressionOperation

java.lang.Object
nom.tam.image.tile.operation.AbstractTiledImageOperation<nom.tam.image.compression.tile.TileCompressionOperation>
nom.tam.image.compression.tile.TiledImageCompressionOperation
All Implemented Interfaces:
ITiledImageOperation

public class TiledImageCompressionOperation extends AbstractTiledImageOperation<nom.tam.image.compression.tile.TileCompressionOperation>
(for internal use) Compresseses an entire image, by parallel processing image tiles. This class represents a complete compression of a tiled describing an image ordered from left to right and top down. the tiles all have the same geometry only the tiles at the right and bottom sides can have different (truncated) sizes.
  • Constructor Details

    • TiledImageCompressionOperation

      public TiledImageCompressionOperation(BinaryTable binaryTable)
      create a TiledImageCompressionOperation based on a compressed image data.
      Parameters:
      binaryTable - the compressed image data.
  • Method Details

    • compress

      public void compress(BinaryTableHDU hdu) throws FitsException
      Throws:
      FitsException
    • compressOptions

      public ICompressOption compressOptions()
      Description copied from interface: ITiledImageOperation
      Retuers the tile compression options to use for tile compressing or uncompressing images.
      Returns:
      the tile compression options
    • decompress

      public Buffer decompress()
    • forceNoLoss

      public void forceNoLoss(int x, int y, int width, int heigth)
    • getCompressedWholeArea

      public ByteBuffer getCompressedWholeArea()
      Description copied from interface: ITiledImageOperation
      Returns a buffer containing the entire tile compressed image.
      Returns:
      a buffer containing the tile compresed image in serialized form.
    • getCompressorControl

      public ICompressorControl getCompressorControl()
      Description copied from interface: ITiledImageOperation
      Returns the class that can perform the tile compression or decompression with the desired tile compression algorithm and options. Some image tiles may not be possible to compress with the chosen algorithm, and FITS then allows alternative compression of these using GZIP instead (see ITiledImageOperation.getGzipCompressorControl()
      Returns:
      the class that can perform the desired tile compression.
      See Also:
    • getGzipCompressorControl

      public ICompressorControl getGzipCompressorControl()
      Description copied from interface: ITiledImageOperation
      Return the class that can GZIP compress tiles that cannot be compressed otherwise. GZIP compression is failsafe and is therefore a standard fallback option when compressing tiles. It may also be the desired first choice method also.
      Returns:
      the class that can perform the fail-safe tile compression using GZIP.
      See Also:
    • prepareUncompressedData

      public TiledImageCompressionOperation prepareUncompressedData(Buffer buffer) throws FitsException
      Throws:
      FitsException
    • preserveNulls

      public ImageNullPixelMask preserveNulls(long nullValue, String compressionAlgorithm)
      preserve null values, where the value representing null is specified as a parameter. This parameter is ignored for floating point values where NaN is used as null value.
      Parameters:
      nullValue - the value representing null for byte/short and integer pixel values
      compressionAlgorithm - compression algorithm to use for the null pixel mask
      Returns:
      the created null pixel mask
    • read

      Throws:
      FitsException
    • readPrimaryHeaders

      public void readPrimaryHeaders(Header header) throws FitsException
      Throws:
      FitsException
    • setCompressAlgorithm

      public TiledImageCompressionOperation setCompressAlgorithm(HeaderCard compressAlgorithmCard)
      Sets the compression algorithm, via a ZCMPTYPE header card or equivalent. The card must contain one of the values recognized by the FITS standard. If not, null will be set instead.
      Parameters:
      compressAlgorithmCard - The header card that specifies the compression algorithm, with one of the standard recognized values such as Compression.ZCMPTYPE_GZIP_1, or null.
      Returns:
      itself
      See Also:
    • setQuantAlgorithm

      public TiledImageCompressionOperation setQuantAlgorithm(HeaderCard quantAlgorithmCard)
      Sets the quantization algorithm, via a ZQUANTIZ header card or equivalent. The card must contain one of the values recognized by the FITS standard. If not, null will be set instead.
      Parameters:
      quantAlgorithmCard - The header card that specifies the compression algorithm, with one of the standard recognized values such as Compression.ZQUANTIZ_NO_DITHER, or null.
      Returns:
      itself
      See Also:
    • getQuantAlgorithm

      public String getQuantAlgorithm()
      Returns the name of the currently configured quantization algorithm.
      Returns:
      The name of the standard quantization algorithm (i.e. a FITS standard value for the ZQUANTIZ keyword), or null if not quantization is currently defined, possibly because an invalid value was set before.
      Since:
      1.18
      See Also:
    • getCompressAlgorithm

      public String getCompressAlgorithm()
      Returns the name of the currently configured compression algorithm.
      Returns:
      The name of the standard compression algorithm (i.e. a FITS standard value for the ZCMPTYPE keyword), or null if not quantization is currently defined, possibly because an invalid value was set before.
      Since:
      1.18
      See Also:
    • getBinaryTable

      protected BinaryTable getBinaryTable()
    • getImageNullPixelMask

      protected ImageNullPixelMask getImageNullPixelMask()