public class LsDecoder08 extends Object implements ICompressionDecoder
The LS decoder and encoder are separated into separate packages and separate modules in order to manage code dependencies. The encoding process requires solving a 9-variable linear system. Doing so requires the use of a 3rd party Java library, so an implementation that uses the LS format introduces an additional dependency to the code base. But the decoding process does not use any operations that would require an external dependency. Thus the decoder is specified as part of the Gridfour core module, while the encoder is not.
Constructor and Description |
---|
LsDecoder08() |
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.
|
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 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 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 packingCopyright © 2022. All rights reserved.