Skip to main content

Crate lerc

Crate lerc 

Source
Expand description

Pure Rust implementation of the LERC (Limited Error Raster Compression) format.

Supports encoding and decoding of raster images with configurable lossy or lossless compression. Compatible with ESRI’s LERC2 format specification.

Re-exports§

pub use error::LercError;
pub use error::Result;
pub use types::DataType;
pub use types::Sample;

Modules§

bitmask
Validity bitmask for tracking valid/invalid pixels.
checksum
Fletcher-32 checksum used by the LERC2 format.
error
Error types for LERC encoding and decoding.
types
Pixel data types and the Sample trait for type-safe encoding/decoding.

Structs§

DecodeResult
Metadata returned from a decode-into operation (no owned pixel data).
Image
A decoded raster image with pixel data and validity masks.
LercInfo
Header metadata extracted from a LERC blob without decoding pixel data.

Enums§

Precision
Controls the precision/error tolerance for LERC encoding.
SampleData
Type-erased pixel data container, one variant per supported data type.

Functions§

decode
Decode a LERC blob, returning the image with pixel data and validity masks.
decode_info
Read header metadata from a LERC blob without decoding pixel data.
decode_into
Decode a LERC blob into a pre-allocated buffer, returning metadata.
decode_slice
Decode a single-band, single-depth LERC blob, returning typed pixel data, the validity mask, width, and height.
encode
Encode an image into a LERC blob with the given precision.
encode_slice
Encode a single-band image with all pixels valid.
encode_slice_masked
Encode a single-band image with a validity mask.