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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intthe default block size to use in bytesstatic final intthe default BYTEPIX value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns an independent copy of this option.final intReturns the currently set block size.final intREturns 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.booleanChecks 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.voidsetParameters(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, waitMethods 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:ICompressOptionReturns an independent copy of this option. Modifications to the original or the copy will not affect the other.- Specified by:
copyin 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:
getCompressionParametersin interfaceICompressOption- Returns:
- the parameters that must be synchronized with the hdu meta data.
- See Also:
-
isLossyCompression
public boolean isLossyCompression()Description copied from interface:ICompressOptionChecks if this type of compression is inherently lossy- Specified by:
isLossyCompressionin interfaceICompressOption- Returns:
trueif 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:
setParametersin interfaceICompressOption- Parameters:
parameters- the parameters to synchronized- See Also:
-
setTileHeight
Description copied from interface:ICompressOptionSet 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:
setTileHeightin interfaceICompressOption- Parameters:
value- the new tile height in pixels- Returns:
- itself
- See Also:
-
setTileWidth
Description copied from interface:ICompressOptionSet 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:
setTileWidthin 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:
unwrapin interfaceICompressOption- Type Parameters:
T- these options recast to the designated implementation type.- Parameters:
clazz- the implementation class- Returns:
- the recast version of us or
nullif the recasting is not available for the specified class type.
-