From: Øyvind Kolås Date: Thu, 23 Aug 2012 08:26:29 +0000 (+0200) Subject: Adjust constants used for sRGB gamma X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~21^2~558 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1cec819c3070c21d90eac9a7ab27717499e75239;p=babl.git Adjust constants used for sRGB gamma Spotted by Elle Stone and clarified by Graeme Gill, now updated to Current IEC specification values. --- diff --git a/babl/base/util.h b/babl/base/util.h index edb3105..6888ddc 100644 --- a/babl/base/util.h +++ b/babl/base/util.h @@ -60,11 +60,11 @@ static inline double linear_to_gamma_2_2 (double value) { #if 0 - if (value > 0.0030402477F) + if (value > 0.003130804954) return 1.055F * pow (value, (1.0F/2.4F)) - 0.055F; return 12.92F * value; #else - if (value > 0.0030402477F) + if (value > 0.003130804954) return 1.055F * babl_pow_1_24 (value) - 0.055F; return 12.92F * value; #endif @@ -74,11 +74,11 @@ static inline double gamma_2_2_to_linear (double value) { #if 0 - if (value > 0.03928F) + if (value > 0.04045F) return pow ((value + 0.055F) / 1.055F, 2.4F); return value / 12.92F; #else - if (value > 0.03928F) + if (value > 0.04045F) return babl_pow_24 ((value + 0.055F) / 1.055F); return value / 12.92F; #endif