Package nom.tam.image.compression.tile
Class TiledImageCompressionOperation
java.lang.Object
nom.tam.image.tile.operation.AbstractTiledImageOperation<TileCompressionOperation>
nom.tam.image.compression.tile.TiledImageCompressionOperation
- All Implemented Interfaces:
ITiledImageOperation
public class TiledImageCompressionOperation
extends AbstractTiledImageOperation<TileCompressionOperation>
This class represents a complete tiledImageOperation of tileOperations
describing an image ordered from left to right and top down. the
tileOperations all have the same geometry only the tileOperations at the
right side and the bottom side can have different sizes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BinaryTable
private String
ZCMPTYPE name of the algorithm that was used to compressprivate ByteBuffer
private ICompressorControl
private ICompressorControl
private ImageNullPixelMask
private ICompressOption
private String
ZQUANTIZ name of the algorithm that was used to quantize -
Constructor Summary
ConstructorsConstructorDescriptionTiledImageCompressionOperation
(BinaryTable binaryTable) create a TiledImageCompressionOperation based on a compressed image data. -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addColumnToTable
(BinaryTableHDU hdu, Object column, String columnName) void
compress
(BinaryTableHDU hdu) void
forceNoLoss
(int x, int y, int width, int heigth) protected BinaryTable
protected ImageNullPixelMask
private <T> T
getNullableColumn
(Header header, Class<T> class1, String columnName) private void
protected void
private void
prepareUncompressedData
(Buffer buffer) preserveNulls
(long nullValue, String compressionAlgorithm) preserve null values, where the value representing null is specified as a parameter.private void
private void
private void
readBaseType
(Header header) private void
readCompressionHeaders
(Header header) void
readPrimaryHeaders
(Header header) private void
readTileAxis
(Header header) setCompressAlgorithm
(HeaderCard compressAlgorithmCard) private <T> Object
setInColumn
(Object column, boolean predicate, TileCompressionOperation tileOperation, Class<T> clazz, T value) private static void
setNullEntries
(Object column, Object defaultValue) setQuantAlgorithm
(HeaderCard quantAlgorithmCard) private void
private void
writeHeader
(Header header) Methods inherited from class nom.tam.image.tile.operation.AbstractTiledImageOperation
areAxesUndefined, areTileAxesUndefined, createTiles, getBaseType, getBufferSize, getImageWidth, getNAxes, getNumberOfTileOperations, getTileAxes, getTileOperation, getTileOperations, setAxes, setBaseType, setTileAxes
-
Field Details
-
compressAlgorithm
ZCMPTYPE name of the algorithm that was used to compress -
binaryTable
-
compressedWholeArea
-
compressorControl
-
gzipCompressorControl
-
quantAlgorithm
ZQUANTIZ name of the algorithm that was used to quantize -
imageOptions
-
imageNullPixelMask
-
-
Constructor Details
-
TiledImageCompressionOperation
create a TiledImageCompressionOperation based on a compressed image data.- Parameters:
binaryTable
- the compressed image data.
-
-
Method Details
-
addColumnToTable
private static void addColumnToTable(BinaryTableHDU hdu, Object column, String columnName) throws FitsException - Throws:
FitsException
-
setNullEntries
-
compress
- Throws:
FitsException
-
compressOptions
-
decompress
-
forceNoLoss
public void forceNoLoss(int x, int y, int width, int heigth) -
getCompressedWholeArea
-
getCompressorControl
-
getGzipCompressorControl
-
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
-
setQuantAlgorithm
-
getNullableColumn
private <T> T getNullableColumn(Header header, Class<T> class1, String columnName) throws FitsException - Throws:
FitsException
-
initializeCompressionControl
private void initializeCompressionControl() -
initImageOptions
private void initImageOptions() -
processAllTiles
private void processAllTiles() -
readAxis
- Throws:
FitsException
-
readBaseType
-
readCompressionHeaders
-
readTileAxis
- Throws:
FitsException
-
setInColumn
private <T> Object setInColumn(Object column, boolean predicate, TileCompressionOperation tileOperation, Class<T> clazz, T value) -
writeColumns
- Throws:
FitsException
-
writeHeader
- Throws:
FitsException
-
getBinaryTable
-
getImageNullPixelMask
-
initializeQuantAlgorithm
protected void initializeQuantAlgorithm()
-