Add new comment

unpack() is affected by

unpack() is affected by camera_wb only in some (very rare) cases (I can not remember the details, it affects very small set of cameras, may be old Kodaks and/or foveon /old ones, before Sigma Merill).
For modern cameras unpack is not affected by color setting (but default for 'use_camera_matrix' for some cameras depends on wb settings)

subtract_black and scale_colors works with image[][4] array, so you need to call raw2image() before subtract_black().

Also, there is single call for raw2image and subtract_black:

int LibRaw::raw2image_ex(int do_subtract_black);


will put black-subtracted and white-balanced image in image[][4]

-- Alex Tutubalin @LibRaw LLC