Class RiceCompressOption
java.lang.Object
nom.tam.fits.compression.algorithm.rice.RiceCompressOption
- All Implemented Interfaces:
Cloneable
,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.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
the default block size to use in bytesstatic final int
the default BYTEPIX value -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Returns an independent copy of this option.final int
Returns the currently set block size.final int
REturns the currently set BYTEPIX valuenom.tam.fits.compression.provider.param.rice.RiceCompressParameters
(for internal use) Returns the parameters that represent the settings for this option in the FITS header or compressed data column.boolean
Checks if this type of compression is inherently lossysetBlockSize
(int value) Sets a new block size to usesetBytePix
(int value) Sets a new BYTEPIX value to use.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.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
(for internal use) Recasts these options for the specific implementation classMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nom.tam.fits.compression.algorithm.api.ICompressOption
getTileHeight, getTileWidth
-
Field Details
-
DEFAULT_RICE_BLOCKSIZE
public static final int DEFAULT_RICE_BLOCKSIZEthe default block size to use in bytes- See Also:
-
DEFAULT_RICE_BYTEPIX
public static final int DEFAULT_RICE_BYTEPIXthe default BYTEPIX value
-
-
Constructor Details
-
RiceCompressOption
public RiceCompressOption()Creates a new set of options for Rice compression.
-
-
Method Details
-
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 interfaceICompressOption
- 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 interfaceICompressOption
- 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 interfaceICompressOption
- 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 befalse
.
-
setBlockSize
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
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 interfaceICompressOption
- Parameters:
parameters
- the parameters to synchronized- See Also:
-
setTileHeight
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 interfaceICompressOption
- Parameters:
value
- the new tile height in pixels- Returns:
- itself
- See Also:
-
setTileWidth
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 interfaceICompressOption
- Parameters:
value
- the new tile with in pixels- Returns:
- itself
- See Also:
-
unwrap
Description copied from interface:ICompressOption
(for internal use) Recasts these options for the specific implementation class- Specified by:
unwrap
in interfaceICompressOption
- 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.
-