Skip to main content

Module deflate

Module deflate 

Source
Expand description

Deflate (zlib) payloads and TIFF/DNG predictors.

DNG compression 8 stores tiles as zlib streams, optionally with predictor 2 (horizontal integer differencing), 34892-34894 (2/4-sample horizontal differencing) or 3/34894-34895 (floating-point byte-plane differencing).

Functions§

decode_float_row
Decode one row of DNG floating-point samples straight into out.
f16_to_f32
Convert half-float bits to f32.
f24_to_f32
Convert 24-bit DNG float (1/7/16) bits to f32.
float_bytes_to_f32
Decode big-endian float samples of bps_bytes (2, 3 or 4) into out.
inflate_zlib
Inflate a zlib stream, refusing to produce more than max_out bytes.
inflate_zlib_into
Inflate a zlib stream into out, returning the number of bytes produced. Decodes in place into caller memory (no allocation); errors on corrupt data. Output beyond the stream’s length is left untouched; a stream larger than out is an error.
undo_float_predictor
Undo DNG floating-point predictor (TIFF predictor 3) for one row: bytes were split into byte planes (most significant first) and then byte-differenced. row holds width * cpp * bytes_per_sample bytes; output is native samples in big-endian byte order ready for float_bytes_to_f32.
undo_horizontal_u16
Undo horizontal integer differencing on u16 samples, in place, for one row of width pixels with cpp interleaved samples and difference factor (1 for TIFF predictor 2; 2 or 4 for DNG predictors 34892/34893).