Class HCompressorOption

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

public class HCompressorOption extends Object implements ICompressOption
Options to the HCompress compression algorithm. When compressing tables and images using the HCompress 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:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new set of options for HCompress.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an independent copy of this option.
    nom.tam.fits.compression.provider.param.hcompress.HCompressParameters
    (for internal use) Returns the parameters that represent the settings for this option in the FITS header or compressed data column.
    int
    Returns the scale parameter value
    int
    Returns the tile height (if supported), or else 0 (also the default implementation).
    int
    Returns the tile width (if supported), or else 0 (also the default implementation).
    boolean
    Checks if this type of compression is inherently lossy
    boolean
    Checks if smoothing is enabled
    void
    setParameters(nom.tam.fits.compression.provider.param.api.ICompressParameters parameters)
    (for internal use) Sets the parameters that link the options to how they are recorded in the FITS headers or compressed table columns.
    setScale(double value)
    Sets the scale parameter
    setSmooth(boolean value)
    Enabled or disables smoothing.
    setTileHeight(int value)
    Set the tile height (if the option supports it).
    setTileWidth(int value)
    Set the tile width (if the option supports it).
    <T> T
    unwrap(Class<T> clazz)
    (for internal use) Recasts these options for the specific implementation class

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HCompressorOption

      public HCompressorOption()
      Creates a new set of options for HCompress.
  • Method Details

    • copy

      public HCompressorOption 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).
    • getCompressionParameters

      public nom.tam.fits.compression.provider.param.hcompress.HCompressParameters 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:
    • getScale

      public int getScale()
      Returns the scale parameter value
      Returns:
      the value of the scale parameter.
      See Also:
    • getTileHeight

      public int getTileHeight()
      Description copied from interface: ICompressOption
      Returns the tile height (if supported), or else 0 (also the default implementation).
      Specified by:
      getTileHeight in interface ICompressOption
      Returns:
      the tile height in pixels, or 0 if the options do not have a tile size setting.
      See Also:
    • getTileWidth

      public int getTileWidth()
      Description copied from interface: ICompressOption
      Returns the tile width (if supported), or else 0 (also the default implementation).
      Specified by:
      getTileWidth in interface ICompressOption
      Returns:
      the tile width in pixels, or 0 if the options do not have a tile size setting.
      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.
    • isSmooth

      public boolean isSmooth()
      Checks if smoothing is enabled
      Returns:
      true if smoothing is enabled, otherwise false.
      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:
    • setScale

      public HCompressorOption setScale(double value) throws IllegalArgumentException
      Sets the scale parameter
      Parameters:
      value - the new scale parameter, which will be rounded to the nearest integer value for the actual implementation.
      Returns:
      itself
      Throws:
      IllegalArgumentException - if the scale value is negative
      See Also:
    • setSmooth

      public HCompressorOption setSmooth(boolean value)
      Enabled or disables smoothing.
      Parameters:
      value - true to enable smoothing, or false to disable.
      Returns:
      itself
    • 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.
    • setTileHeight

      public HCompressorOption 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 HCompressorOption 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: