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 BinaryTablebinaryTableprivate java.lang.StringcompressAlgorithmZCMPTYPE name of the algorithm that was used to compressprivate java.nio.ByteBuffercompressedWholeAreaprivate ICompressorControlcompressorControlprivate ICompressorControlgzipCompressorControlprivate ImageNullPixelMaskimageNullPixelMaskprivate ICompressOptionimageOptionsprivate java.lang.StringquantAlgorithmZQUANTIZ 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 voidaddColumnToTable(BinaryTableHDU hdu, java.lang.Object column, java.lang.String columnName)voidcompress(BinaryTableHDU hdu)ICompressOptioncompressOptions()java.nio.Bufferdecompress()voidforceNoLoss(int x, int y, int width, int heigth)protected BinaryTablegetBinaryTable()java.nio.ByteBuffergetCompressedWholeArea()ICompressorControlgetCompressorControl()ICompressorControlgetGzipCompressorControl()protected ImageNullPixelMaskgetImageNullPixelMask()private <T> TgetNullableColumn(Header header, java.lang.Class<T> class1, java.lang.String columnName)private voidinitializeCompressionControl()protected voidinitializeQuantAlgorithm()private voidinitImageOptions()TiledImageCompressionOperationprepareUncompressedData(java.nio.Buffer buffer)ImageNullPixelMaskpreserveNulls(long nullValue, java.lang.String compressionAlgorithm)preserve null values, where the value representing null is specified as a parameter.private voidprocessAllTiles()TiledImageCompressionOperationread(Header header)private voidreadAxis(Header header)private voidreadBaseType(Header header)private voidreadCompressionHeaders(Header header)voidreadPrimaryHeaders(Header header)private voidreadTileAxis(Header header)TiledImageCompressionOperationsetCompressAlgorithm(HeaderCard compressAlgorithmCard)private <T> java.lang.ObjectsetInColumn(java.lang.Object column, boolean predicate, TileCompressionOperation tileOperation, java.lang.Class<T> clazz, T value)private static voidsetNullEntries(java.lang.Object column, java.lang.Object defaultValue)TiledImageCompressionOperationsetQuantAlgorithm(HeaderCard quantAlgorithmCard)private voidwriteColumns(BinaryTableHDU hdu)private voidwriteHeader(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()
-
-