Class RiceCompressOption

java.lang.Object
nom.tam.fits.compression.algorithm.rice.RiceCompressOption
All Implemented Interfaces:
Cloneable, ICompressOption

public class RiceCompressOption extends Object implements ICompressOption
Options to the Rice compression algorithm. When compressing tables and images using the Rice algorithm, users can control how exactly the compression is perfomed. When reading compressed FITS files, these options will be set automatically based on the header values recorded in the compressed HDU.
See Also:
  • Field Details

    • DEFAULT_RICE_BLOCKSIZE

      public static final int DEFAULT_RICE_BLOCKSIZE
      the default block size to use in bytes
      See Also:
    • DEFAULT_RICE_BYTEPIX

      public static final int DEFAULT_RICE_BYTEPIX
      the default BYTEPIX value
  • Constructor Details

    • RiceCompressOption

      public RiceCompressOption()
      Creates a new set of options for Rice compression.
  • Method Details

    • copy

      public RiceCompressOption copy()
      Description copied from interface: ICompressOption
      Returns an independent copy of this option. Modifications to the original or the copy will not affect the other.
      Specified by:
      copy in interface ICompressOption
      Returns:
      copy the option (normally the option from with the copy happened is saved as original).
    • getBlockSize

      public final int getBlockSize()
      Returns the currently set block size.
      Returns:
      the block size in bytes.
      See Also:
    • getBytePix

      public final int getBytePix()
      REturns the currently set BYTEPIX value
      Returns:
      the BYTEPIX value.
      See Also:
    • getCompressionParameters

      public nom.tam.fits.compression.provider.param.rice.RiceCompressParameters getCompressionParameters()
      Description copied from interface: ICompressOption
      (for internal use) Returns the parameters that represent the settings for this option in the FITS header or compressed data column.
      Specified by:
      getCompressionParameters in interface ICompressOption
      Returns:
      the parameters that must be synchronized with the hdu meta data.
      See Also:
    • isLossyCompression

      public boolean isLossyCompression()
      Description copied from interface: ICompressOption
      Checks if this type of compression is inherently lossy
      Specified by:
      isLossyCompression in interface ICompressOption
      Returns:
      true if the compression done with this specified options uses approximations. That means if the reconstruction of the data is excact the return should be false.
    • setBlockSize

      public RiceCompressOption setBlockSize(int value) throws IllegalArgumentException
      Sets a new block size to use
      Parameters:
      value - the new block size in bytes
      Returns:
      itself
      Throws:
      IllegalArgumentException - if the value is not 16 or 32.
      See Also:
    • setBytePix

      public RiceCompressOption setBytePix(int value) throws IllegalArgumentException
      Sets a new BYTEPIX value to use.
      Parameters:
      value - the new BYTEPIX value. It is currently not checked for validity, so use carefully.
      Returns:
      itself
      Throws:
      IllegalArgumentException - if the value is not 1, 2, 4, or 8.
      See Also:
    • setParameters

      public void setParameters(nom.tam.fits.compression.provider.param.api.ICompressParameters parameters)
      Description copied from interface: ICompressOption
      (for internal use) Sets the parameters that link the options to how they are recorded in the FITS headers or compressed table columns.
      Specified by:
      setParameters in interface ICompressOption
      Parameters:
      parameters - the parameters to synchronized
      See Also:
    • setTileHeight

      public RiceCompressOption setTileHeight(int value)
      Description copied from interface: ICompressOption
      Set the tile height (if the option supports it). If the implementing option class does not have a setting for tile size, it should simply ignore the setting and return normally.
      Specified by:
      setTileHeight in interface ICompressOption
      Parameters:
      value - the new tile height in pixels
      Returns:
      itself
      See Also:
    • setTileWidth

      public RiceCompressOption setTileWidth(int value)
      Description copied from interface: ICompressOption
      Set the tile width (if the option supports it). If the implementing option class does not have a setting for tile size, it should simply ignore the setting and return normally.
      Specified by:
      setTileWidth in interface ICompressOption
      Parameters:
      value - the new tile with in pixels
      Returns:
      itself
      See Also:
    • unwrap

      public <T> T unwrap(Class<T> clazz)
      Description copied from interface: ICompressOption
      (for internal use) Recasts these options for the specific implementation class
      Specified by:
      unwrap in interface ICompressOption
      Type Parameters:
      T - these options recast to the designated implementation type.
      Parameters:
      clazz - the implementation class
      Returns:
      the recast version of us or null if the recasting is not available for the specified class type.