libzarr
Header-only C++17 Zarr v2/v3, WASM-compatible
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | List of all members
zarr::CodecPipeline Class Reference

#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)
 

Detailed Description

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.

Member Function Documentation

◆ decode()

Bytes zarr::CodecPipeline::decode ( Bytes  stored) const
inline

Decodes stored chunk bytes to a native, C-order full chunk of exactly decoded_chunk_bytes() bytes; anything inconsistent is a zarr::error.

◆ decode_range()

Bytes zarr::CodecPipeline::decode_range ( Bytes  raw) const
inline

Post-processes a partial (byte-range) chunk read; valid only when supports_partial_read(). The sole possible transform is a byteswap.

◆ encode()

Bytes zarr::CodecPipeline::encode ( Bytes  chunk) const
inline

Encodes a native, C-order full chunk. The buffer must be exactly decoded_chunk_bytes() long.

◆ is_identity()

bool zarr::CodecPipeline::is_identity ( ) const
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.

◆ resolve()

static CodecPipeline zarr::CodecPipeline::resolve ( const ArrayMeta meta)
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.

◆ supports_partial_read()

bool zarr::CodecPipeline::supports_partial_read ( ) const
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.


The documentation for this class was generated from the following file: