|
libzarr
Header-only C++17 Zarr v2/v3, WASM-compatible
|
#include <codecs.hpp>
Public Member Functions | |
| std::uint64_t | decoded_chunk_bytes () const |
| Size of a decoded full chunk in bytes. | |
| bool | is_identity () const |
| bool | supports_partial_read () const |
| Bytes | encode (Bytes chunk) const |
| Bytes | decode_range (Bytes raw) const |
| Bytes | decode (Bytes stored) const |
Static Public Member Functions | |
| static CodecPipeline | resolve (const ArrayMeta &meta) |
A codec chain resolved against one array's dtype and chunk shape. encode() maps a native-order, C-layout full chunk to stored bytes; decode() is the exact inverse. Both are whole-buffer and value-based.
Decodes stored chunk bytes to a native, C-order full chunk of exactly decoded_chunk_bytes() bytes; anything inconsistent is a zarr::error.
Post-processes a partial (byte-range) chunk read; valid only when supports_partial_read(). The sole possible transform is a byteswap.
Encodes a native, C-order full chunk. The buffer must be exactly decoded_chunk_bytes() long.
|
inline |
True when stored bytes equal decoded bytes element-for-element (no transpose, no byteswap, no bytes->bytes stage) — the precondition for byte-range sub-chunk reads without post-processing.
|
inlinestatic |
Validates meta.codecs (partition order, exactly one "bytes" stage, known names, well-formed configurations) and builds the plan. Codecs compiled out of this build (e.g. gzip without LIBZARR_HAS_ZLIB) fail here with a precise error, never at link time.
|
inline |
True when the stored byte at a given linear element offset is independent of the rest of the chunk (no bytes->bytes stage) — byte-range reads work, possibly with a byteswap. Transposed layouts do not qualify.