public class CodecFloat extends Object implements ICompressionEncoder, ICompressionDecoder
Constructor and Description |
---|
CodecFloat() |
Modifier and Type | Method and Description |
---|---|
void |
analyze(int nRows,
int nColumns,
byte[] packing)
Analyzes the content of the packing to collect statistics on the
compression.
|
void |
clearAnalysisData()
Clears all accumulated analysis data.
|
int[] |
decode(int nRows,
int nColumns,
byte[] packing)
Decodes the content of the packing and populates an
integer array to store the data.
|
float[] |
decodeFloats(int nRows,
int nColumns,
byte[] packing)
Decodes the content of the packing and populates an
integer array to store the data.
|
byte[] |
encode(int codecIndex,
int nRows,
int nCols,
int[] values)
Encodes the specified tile data in a compressed form.
|
byte[] |
encodeFloats(int codecIndex,
int nRows,
int nColumns,
float[] values)
Encodes the specified tile data in a compressed form.
|
boolean |
implementsFloatingPointEncoding()
Indicates whether the implementation can encode floating-point values
|
boolean |
implementsIntegerEncoding()
Indicates whether the implementation can encode integral data types
|
void |
reportAnalysisData(PrintStream ps,
int nTilesInRaster)
Prints analysis results (if any) to specified print stream
|
public int[] decode(int nRows, int nColumns, byte[] packing) throws IOException
ICompressionDecoder
decode
in interface ICompressionDecoder
nRows
- a value of 1 or greater giving the number of rows in the
tilenColumns
- a value of 1 or greater giving the number of columns in
thepacking
- an array of bytes containing the encoded data to be
decompressedIOException
- in the event of an incompatible packingpublic byte[] encode(int codecIndex, int nRows, int nCols, int[] values)
ICompressionEncoder
encode
in interface ICompressionEncoder
codecIndex
- the index assigned by the application to
associate a codec with an entry in the raster file.nRows
- a value of 1 or greater giving the number of rows in the
tilenCols
- a value of 1 or greater giving the number of columns in the
tilevalues
- the values of the tile in row-major orderpublic void analyze(int nRows, int nColumns, byte[] packing) throws IOException
ICompressionDecoder
This method is intended to be used when assessing the results of data compression. It may be used for a single tile or for a collection of multiple tiles. When used for multiple tiles, the results are assumed to be cumulative. Thus an implementation is expected to maintain statistics as state data (class member data).
analyze
in interface ICompressionDecoder
nRows
- the number of rows in the tile to be analyzed.nColumns
- the number of columns in the tile to be analyzed.packing
- a valid packing for the associated codec implementationIOException
- in the event of an incompatible packingpublic void reportAnalysisData(PrintStream ps, int nTilesInRaster)
ICompressionDecoder
reportAnalysisData
in interface ICompressionDecoder
ps
- a valid print stream.nTilesInRaster
- the number of tiles in the rasterpublic void clearAnalysisData()
ICompressionDecoder
clearAnalysisData
in interface ICompressionDecoder
public byte[] encodeFloats(int codecIndex, int nRows, int nColumns, float[] values)
ICompressionEncoder
encodeFloats
in interface ICompressionEncoder
codecIndex
- the index assigned by the application to
associate a codec with an entry in the raster file.nRows
- a value of 1 or greater giving the number of rows in the
tilenColumns
- a value of 1 or greater giving the number of columns in the
tilevalues
- the values of the tile in row-major orderpublic float[] decodeFloats(int nRows, int nColumns, byte[] packing) throws IOException
ICompressionDecoder
decodeFloats
in interface ICompressionDecoder
nRows
- a value of 1 or greater giving the number of rows in the
tilenColumns
- a value of 1 or greater giving the number of columns in
thepacking
- an array of bytes containing the encoded data to be
decompressedIOException
- in the event of an incompatible packingpublic boolean implementsFloatingPointEncoding()
ICompressionEncoder
implementsFloatingPointEncoding
in interface ICompressionEncoder
public boolean implementsIntegerEncoding()
ICompressionEncoder
implementsIntegerEncoding
in interface ICompressionEncoder
Copyright © 2022. All rights reserved.