Skip to content

colorspace: generalize pl_white_from_temp to low temp blackbodies

Niklas Haas requested to merge haasn/libplacebo:kang2002 into master

pl_white_from_temp() was defined to refer only to CIE D-series standard daylight illuminants. This, however, is insufficient for general purpose color temperature adaptation, which may need to go down to e.g. 1800K for candlelit scenes.

To fix it, rename pl_white_from_temp() to pl_daylight_from_temp(), and introduce pl_blackbody_from_temp() alongside it, then turn pl_white_from_temp() into a wrapper that smoothly fades from the daylight formule to the blackbody formula in the range [2500,4000], which is about where the daylight formula loses accuracy.

Blackbody formula taken from Kang, Moon, Hong, Lee, Cho and Kim (2002)

Merge request reports

Loading