Expand description
One codec per chunk type ([spec/03-chunks.md], [spec/09-layer-data.md],
[spec/10-scene-chunks.md]).
Each codec deals in plaintext payload bytes: decryption and the zstd layer are the caller’s business, because whether a chunk carries a zstd frame is a property of its type (section 6.3) while whether it is sealed is a property of its descriptor.
Re-exports§
pub use extd::Extension;pub use head::Head;pub use lhas::LayerHashes;pub use ltbl::LayerEntry;pub use ltbl::LayerTable;pub use preview::Preview;pub use preview::PreviewRole;pub use zdic::ZstdDictionary;
Modules§
- extd
- The
EXTDchunk: vendor and future-standard extensions ([spec/10-scene-chunks.md] section 4.12). - head
- The
HEADchunk: display dimensions, layer count and encoder identity ([spec/04-head.md] section 4.1). - json_
chunks - The JSON chunks:
META,PROFandLROV([spec/05-meta.md], [spec/06-prof.md], [spec/08-print-control.md]). - layr
- The
LAYRchunk: one sector’s mask data for one group of layers, as a single zstd frame ([spec/09-layer-data.md] section 4.9). - lhas
- The
LHASchunk: per-layer leaf hashes and a Merkle root ([spec/09-layer-data.md] section 4.10). - ltbl
- The
LTBLchunk: the layer table ([spec/09-layer-data.md] section 4.7). - preview
- The
PREVchunk: a PNG preview, with its role in the descriptor flags ([spec/08-print-control.md] section 4.6). - voxl
- The
VOXLchunk: an embedded scene, opaque to LUMEN ([spec/10-scene-chunks.md] section 4.11). - zdic
- The
ZDICchunk: the zstd dictionary shared by everyLAYRframe ([spec/09-layer-data.md] section 4.8).
Constants§
- MAX_
ZSTD_ RATIO - The largest expansion zstd can produce for a chunk payload, used as a coarse guard before a bound specific to the chunk is available.
Functions§
- allocation_
bound - The decompressed-size bound a
LAYRchunk’s frame may not exceed. - check_
allocation - Reject a declared size above the bound the file’s own structure allows.
- compress
- Compress a chunk payload into a zstd frame, optionally against a dictionary.
- decompress
- Decompress a zstd frame, checking the result is exactly
uncompressed_size. - decompress_
frame - Decompress a
LAYRframe, sizing its output from the frame’s own header and bounding it bybound. - decompress_
within - Decompress a zstd frame, refusing a declared size above
bound. - dictionary_
id - The dictionary ID a raw dictionary reports.
- frame_
content_ size - The decompressed length a frame’s own header declares.
- frame_
dict_ id - The dictionary ID a frame reports, or
0when the frame used no dictionary. - train_
dictionary - Train a zstd dictionary from layer samples (section 6.2).