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
Fields Modifier and Type Field Description private BinaryTable
binaryTable
private java.lang.String
compressAlgorithm
ZCMPTYPE name of the algorithm that was used to compressprivate java.nio.ByteBuffer
compressedWholeArea
private ICompressorControl
compressorControl
private ICompressorControl
gzipCompressorControl
private ImageNullPixelMask
imageNullPixelMask
private ICompressOption
imageOptions
private java.lang.String
quantAlgorithm
ZQUANTIZ name of the algorithm that was used to quantize
-
Constructor Summary
Constructors Constructor Description TiledImageCompressionOperation(BinaryTable binaryTable)
create a TiledImageCompressionOperation based on a compressed image data.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static void
addColumnToTable(BinaryTableHDU hdu, java.lang.Object column, java.lang.String columnName)
void
compress(BinaryTableHDU hdu)
ICompressOption
compressOptions()
java.nio.Buffer
decompress()
void
forceNoLoss(int x, int y, int width, int heigth)
protected BinaryTable
getBinaryTable()
java.nio.ByteBuffer
getCompressedWholeArea()
ICompressorControl
getCompressorControl()
ICompressorControl
getGzipCompressorControl()
protected ImageNullPixelMask
getImageNullPixelMask()
private <T> T
getNullableColumn(Header header, java.lang.Class<T> class1, java.lang.String columnName)
private void
initializeCompressionControl()
protected void
initializeQuantAlgorithm()
private void
initImageOptions()
TiledImageCompressionOperation
prepareUncompressedData(java.nio.Buffer buffer)
ImageNullPixelMask
preserveNulls(long nullValue, java.lang.String compressionAlgorithm)
preserve null values, where the value representing null is specified as a parameter.private void
processAllTiles()
TiledImageCompressionOperation
read(Header header)
private void
readAxis(Header header)
private void
readBaseType(Header header)
private void
readCompressionHeaders(Header header)
void
readPrimaryHeaders(Header header)
private void
readTileAxis(Header header)
TiledImageCompressionOperation
setCompressAlgorithm(HeaderCard compressAlgorithmCard)
private <T> java.lang.Object
setInColumn(java.lang.Object column, boolean predicate, TileCompressionOperation tileOperation, java.lang.Class<T> clazz, T value)
private static void
setNullEntries(java.lang.Object column, java.lang.Object defaultValue)
TiledImageCompressionOperation
setQuantAlgorithm(HeaderCard quantAlgorithmCard)
private void
writeColumns(BinaryTableHDU hdu)
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 Detail
-
compressAlgorithm
private java.lang.String compressAlgorithm
ZCMPTYPE name of the algorithm that was used to compress
-
binaryTable
private final BinaryTable binaryTable
-
compressedWholeArea
private java.nio.ByteBuffer compressedWholeArea
-
compressorControl
private ICompressorControl compressorControl
-
gzipCompressorControl
private ICompressorControl gzipCompressorControl
-
quantAlgorithm
private java.lang.String quantAlgorithm
ZQUANTIZ name of the algorithm that was used to quantize
-
imageOptions
private ICompressOption imageOptions
-
imageNullPixelMask
private ImageNullPixelMask imageNullPixelMask
-
-
Constructor Detail
-
TiledImageCompressionOperation
public TiledImageCompressionOperation(BinaryTable binaryTable)
create a TiledImageCompressionOperation based on a compressed image data.- Parameters:
binaryTable
- the compressed image data.
-
-
Method Detail
-
addColumnToTable
private static void addColumnToTable(BinaryTableHDU hdu, java.lang.Object column, java.lang.String columnName) throws FitsException
- Throws:
FitsException
-
setNullEntries
private static void setNullEntries(java.lang.Object column, java.lang.Object defaultValue)
-
compress
public void compress(BinaryTableHDU hdu) throws FitsException
- Throws:
FitsException
-
compressOptions
public ICompressOption compressOptions()
-
decompress
public java.nio.Buffer decompress()
-
forceNoLoss
public void forceNoLoss(int x, int y, int width, int heigth)
-
getCompressedWholeArea
public java.nio.ByteBuffer getCompressedWholeArea()
-
getCompressorControl
public ICompressorControl getCompressorControl()
-
getGzipCompressorControl
public ICompressorControl getGzipCompressorControl()
-
prepareUncompressedData
public TiledImageCompressionOperation prepareUncompressedData(java.nio.Buffer buffer) throws FitsException
- Throws:
FitsException
-
preserveNulls
public ImageNullPixelMask preserveNulls(long nullValue, java.lang.String compressionAlgorithm)
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
public TiledImageCompressionOperation read(Header header) throws FitsException
- Throws:
FitsException
-
readPrimaryHeaders
public void readPrimaryHeaders(Header header) throws FitsException
- Throws:
FitsException
-
setCompressAlgorithm
public TiledImageCompressionOperation setCompressAlgorithm(HeaderCard compressAlgorithmCard)
-
setQuantAlgorithm
public TiledImageCompressionOperation setQuantAlgorithm(HeaderCard quantAlgorithmCard)
-
getNullableColumn
private <T> T getNullableColumn(Header header, java.lang.Class<T> class1, java.lang.String columnName) throws FitsException
- Throws:
FitsException
-
initializeCompressionControl
private void initializeCompressionControl()
-
initImageOptions
private void initImageOptions()
-
processAllTiles
private void processAllTiles()
-
readAxis
private void readAxis(Header header) throws FitsException
- Throws:
FitsException
-
readBaseType
private void readBaseType(Header header)
-
readCompressionHeaders
private void readCompressionHeaders(Header header)
-
readTileAxis
private void readTileAxis(Header header) throws FitsException
- Throws:
FitsException
-
setInColumn
private <T> java.lang.Object setInColumn(java.lang.Object column, boolean predicate, TileCompressionOperation tileOperation, java.lang.Class<T> clazz, T value)
-
writeColumns
private void writeColumns(BinaryTableHDU hdu) throws FitsException
- Throws:
FitsException
-
writeHeader
private void writeHeader(Header header) throws FitsException
- Throws:
FitsException
-
getBinaryTable
protected BinaryTable getBinaryTable()
-
getImageNullPixelMask
protected ImageNullPixelMask getImageNullPixelMask()
-
initializeQuantAlgorithm
protected void initializeQuantAlgorithm()
-
-