Package nom.tam.image.compression.tile
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 Summary
ConstructorsConstructorDescriptionTiledImageCompressionOperation
(BinaryTable binaryTable) create a TiledImageCompressionOperation based on a compressed image data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
compress
(BinaryTableHDU hdu) Retuers the tile compression options to use for tile compressing or uncompressing images.void
forceNoLoss
(int x, int y, int width, int heigth) protected BinaryTable
Returns the name of the currently configured compression algorithm.Returns a buffer containing the entire tile compressed image.Returns the class that can perform the tile compression or decompression with the desired tile compression algorithm and options.Return the class that can GZIP compress tiles that cannot be compressed otherwise.protected ImageNullPixelMask
Returns the name of the currently configured quantization algorithm.prepareUncompressedData
(Buffer buffer) preserveNulls
(long nullValue, String compressionAlgorithm) preserve null values, where the value representing null is specified as a parameter.void
readPrimaryHeaders
(Header header) setCompressAlgorithm
(HeaderCard compressAlgorithmCard) Sets the compression algorithm, via aZCMPTYPE
header card or equivalent.setQuantAlgorithm
(HeaderCard quantAlgorithmCard) Sets the quantization algorithm, via aZQUANTIZ
header card or equivalent.Methods inherited from class nom.tam.image.tile.operation.AbstractTiledImageOperation
createTiles, getBaseType, getBufferSize, getImageWidth, getNAxes, getNumberOfTileOperations, getTileAxes, getTileOperation, getTileOperations, hasAxes, hasTileAxes, setAxes, setBaseType, setTileAxes
-
Constructor Details
-
TiledImageCompressionOperation
create a TiledImageCompressionOperation based on a compressed image data.- Parameters:
binaryTable
- the compressed image data.
-
-
Method Details
-
compress
- Throws:
FitsException
-
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
-
forceNoLoss
public void forceNoLoss(int x, int y, int width, int heigth) -
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
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 (seeITiledImageOperation.getGzipCompressorControl()
- Returns:
- the class that can perform the desired tile compression.
- See Also:
-
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
- Throws:
FitsException
-
preserveNulls
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 valuescompressionAlgorithm
- compression algorithm to use for the null pixel mask- Returns:
- the created null pixel mask
-
read
- Throws:
FitsException
-
readPrimaryHeaders
- Throws:
FitsException
-
setCompressAlgorithm
Sets the compression algorithm, via aZCMPTYPE
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 asCompression.ZCMPTYPE_GZIP_1
, ornull
.- Returns:
- itself
- See Also:
-
setQuantAlgorithm
Sets the quantization algorithm, via aZQUANTIZ
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 asCompression.ZQUANTIZ_NO_DITHER
, ornull
.- Returns:
- itself
- See Also:
-
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), ornull
if not quantization is currently defined, possibly because an invalid value was set before. - Since:
- 1.18
- See Also:
-
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), ornull
if not quantization is currently defined, possibly because an invalid value was set before. - Since:
- 1.18
- See Also:
-
getBinaryTable
-
getImageNullPixelMask
-