Skip to main content

Module nikon_packed

Module nikon_packed 

Source
Expand description

The “load flags” family of bit-packed layouts.

Many Nikon, Pentax and Samsung uncompressed raws are described by a handful of “load flags” rather than by standard TIFF packing:

flag bitsmeaning
1one padding byte after every 10 samples (Nikon D100 “compressed”)
2rows stored as two interlaced fields (even rows, then odd rows)
4the second field starts at a separate offset
8 | 16bits are gathered in little-endian units of 16/24/32 bits, MSB first
64swap each pair of output columns
128rows are padded to an even number of bytes

PackedSpec::fast_layout maps the common combinations onto crate::packed (parallel, SIMD); everything else uses the exact sequential path in decode, which is the specification.

Structs§

PackedSpec
A load-flags packed raster description.

Functions§

decode
Decode src into out (rows of stride samples). Truncated input is an error (decoding aborts at the first row that starts past EOF) unless lenient (recovering truncated data): then every complete sample is decoded and the rest are left zero (out must be zeroed).
decode_exact
Exact sequential decode of any load-flags layout (the specification).