pub struct Codec {
pub name: CodecName,
pub compressed_size: usize,
pub level: i32,
pub shuffle: i32,
pub compressor: i32,
pub original_data_type: NDDataType,
}Expand description
Codec information attached to a compressed NDArray.
name/level/shuffle/compressor mirror C++ Codec_t and
compressed_size mirrors NDArray::compressedSize. original_data_type
folds in C++ NDArray::dataType, which “holds the data type of the
uncompressed data … used for decompression” (NDPluginCodec.cpp:35-36).
The Rust port’s typed NDDataBuffer
collapses to raw bytes (U8) once compressed and so can no longer carry the
element type; because a Codec exists exactly when an array is compressed,
this field is the single source of truth for the original element type on
every compressed array (set by the codec plugin on compress, read on
decompress).
Fields§
§name: CodecName§compressed_size: usize§level: i32§shuffle: i32§compressor: i32§original_data_type: NDDataTypeElement type of the uncompressed data (C++ NDArray::dataType),
retained so decompression can rebuild the correctly-typed buffer.