[babl] Revert "replace gamma functions with #defines"



commit 8998c925f216a28977bc453b0665b2444eba115c
Author: Ãyvind KolÃs <pippin gimp org>
Date:   Tue Apr 24 01:26:30 2012 +0200

    Revert "replace gamma functions with #defines"
    
    This reverts commit fd11d181d043e56168572c08f932f6d0379615e3.

 babl/base/util.h |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/babl/base/util.h b/babl/base/util.h
index a9d2049..a229894 100644
--- a/babl/base/util.h
+++ b/babl/base/util.h
@@ -67,21 +67,20 @@ static inline double xpow512 (double x)
 }
 
 
-#if 0
 static inline double
 linear_to_gamma_2_2 (double value)
 {
+#if 0
   if (value > 0.0030402477F)
     return 1.055F * pow (value, (1.0F/2.4F)) - 0.055F;
   return 12.92F * value;
-}
 #else
-
-#define linear_to_gamma_2_2(value) \
-  ((value > 0.0030402477F)? 1.055F * xpow512 (value) - 0.055F: 12.92F * value)
+  if (value > 0.0030402477F)
+    return 1.055F * xpow512 (value) - 0.055F;
+  return 12.92F * value;
 #endif
+}
 
-#if 0
 static inline double
 gamma_2_2_to_linear (double value)
 {
@@ -89,10 +88,6 @@ gamma_2_2_to_linear (double value)
     return pow ((value + 0.055F) / 1.055F, 2.4F);
   return value / 12.92F;
 }
-#else
-#define gamma_2_2_to_linear(value) \
-  ((value > 0.03928F) ?  pow ((value + 0.055F) / 1.055F, 2.4F):value / 12.92F)
-#endif
 
 #else
   #define linear_to_gamma_2_2(value) (pow((value), (1.0F/2.2F)))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]