public class LsEncoder08 extends Object implements ICompressionEncoder
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, but the encoder is not.
Constructor and Description |
---|
LsEncoder08() |
Modifier and Type | Method and Description |
---|---|
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 nCols,
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
|
public 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 byte[] encodeFloats(int codecIndex, int nRows, int nCols, 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
tilenCols
- a value of 1 or greater giving the number of columns in the
tilevalues
- the values of the tile in row-major orderpublic boolean implementsFloatingPointEncoding()
ICompressionEncoder
implementsFloatingPointEncoding
in interface ICompressionEncoder
public boolean implementsIntegerEncoding()
ICompressionEncoder
implementsIntegerEncoding
in interface ICompressionEncoder
Copyright © 2022. All rights reserved.