[babl] Adjust constants used for sRGB gamma
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] Adjust constants used for sRGB gamma
- Date: Thu, 23 Aug 2012 08:32:59 +0000 (UTC)
commit 1cec819c3070c21d90eac9a7ab27717499e75239
Author: Ãyvind KolÃs <pippin gimp org>
Date: Thu Aug 23 10:26:29 2012 +0200
Adjust constants used for sRGB gamma
Spotted by Elle Stone and clarified by Graeme Gill, now updated to Current IEC
specification values.
babl/base/util.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]