Add new comment

There are two black-level

There are two black-level fields.

Quote from docs: https://www.libraw.org/docs/API-datastruct.html#libraw_colordata_t

unsigned black;
Black level. Depending on the camera, it may be zero (this means that black has been subtracted at the unpacking stage or by the camera itself), calculated at the unpacking stage, read from the RAW file, or hardcoded.

unsigned cblack[4102];
Per-channel black level correction. First 4 values are per-channel correction, next two are black level pattern block size, than cblack[4]*cblack[5] correction values (for indexes [6....6+cblack[4]*cblack[5]).

For Sony files (checked w/ A7R-IV sample), black is 512 and cblack[0..3] are zero after open_file() call.

-- Alex Tutubalin