Skip to main content

Module leaf

Module leaf 

Source
Expand description

Restart-interval parallel lossless JPEG, as written by Leaf (and Phase One-era Leaf/Mamiya backs) for MOS files.

Leaf streams carry a DRI marker whose interval is a whole number of JPEG rows, so each restart interval is an independently decodable band (predictors reset at a restart). The scan is split at RSTn markers and the bands decode in parallel straight into the output, which is filled as one linear sample stream mapped onto raw rows in order.

Functionsยง

decode_linear
Decode a lossless JPEG stream as a linear sample stream into out (row-major out.len() samples), decoding restart intervals in parallel when they cover whole rows. Samples beyond out are dropped; missing samples are left untouched.
restart_segments
Start offsets (into data) of every restart interval of the scan.