In LibRaw::unpack() call, color.maximum is set according to metadata (for DNG and other formats with maximum value in metadata) and/or to camera default if no metadata present.
Also, color.channel_maximum[] is set by *real* image data (real maximum in given channel).
The LibRaw::subtract_black() call recalculates channel_maximum[] for entire image and adjusts color.maximum by common black level.
The subtract_black() is called on postprocessing stage, or may be called by LibRaw user.
More details:
In LibRaw::unpack() call, color.maximum is set according to metadata (for DNG and other formats with maximum value in metadata) and/or to camera default if no metadata present.
Also, color.channel_maximum[] is set by *real* image data (real maximum in given channel).
The LibRaw::subtract_black() call recalculates channel_maximum[] for entire image and adjusts color.maximum by common black level.
The subtract_black() is called on postprocessing stage, or may be called by LibRaw user.