[gegl/gegl-0-2] operations, opencl: Follow up on the changes for babl Y conversions.



commit 5cb96d0bece8eb89437fd4b25cba08e349b169c2
Author: Michael Henning <drawoc darkrefraction com>
Date:   Fri Oct 11 17:36:00 2013 -0400

    operations,opencl: Follow up on the changes for babl Y conversions.
    
    See d3e75895a994fa87640cf04c27314b1ff935675c in babl.

 opencl/colors.cl                     |   21 +++------------------
 opencl/colors.cl.h                   |   21 +++------------------
 operations/common/snn-mean.c         |   11 -----------
 operations/workshop/snn-percentile.c |    7 ++++---
 4 files changed, 10 insertions(+), 50 deletions(-)
---
diff --git a/opencl/colors.cl b/opencl/colors.cl
index 8f43a61..e99c1de 100644
--- a/opencl/colors.cl
+++ b/opencl/colors.cl
@@ -398,24 +398,9 @@ __kernel void yu8_to_yf (__global const uchar * in,
 /* -- YA float -- */
 
 /* babl reference file: babl/base/rgb-constants.h */
-#if 0
-#define CONTEMPORARY_MONITOR
-#endif
-
-#ifdef CONTEMPORARY_MONITOR
-  /* source: http://www.poynton.com/ColorFAQ.html */
-  #define RGB_LUMINANCE_RED    (0.212671f)
-  #define RGB_LUMINANCE_GREEN  (0.715160f)
-  #define RGB_LUMINANCE_BLUE   (0.072169f)
-#else
-  /* this is not correct, but the constants are kept around */
-  #define RGB_LUMA_RED         (0.299)
-  #define RGB_LUMA_GREEN       (0.587)
-  #define RGB_LUMA_BLUE        (0.114)
-  #define RGB_LUMINANCE_RED    RGB_LUMA_RED
-  #define RGB_LUMINANCE_GREEN  RGB_LUMA_GREEN
-  #define RGB_LUMINANCE_BLUE   RGB_LUMA_BLUE
-#endif
+#define RGB_LUMINANCE_RED    (0.222491)
+#define RGB_LUMINANCE_GREEN  (0.716888)
+#define RGB_LUMINANCE_BLUE   (0.060621)
 
 /* RGBA float -> YA float */
 __kernel void rgbaf_to_yaf (__global const float4 * in,
diff --git a/opencl/colors.cl.h b/opencl/colors.cl.h
index 60dd747..9aa7c3b 100644
--- a/opencl/colors.cl.h
+++ b/opencl/colors.cl.h
@@ -399,24 +399,9 @@ static const char* colors_cl_source =
 "/* -- YA float -- */                                                          \n"
 "                                                                              \n"
 "/* babl reference file: babl/base/rgb-constants.h */                          \n"
-"#if 0                                                                         \n"
-"#define CONTEMPORARY_MONITOR                                                  \n"
-"#endif                                                                        \n"
-"                                                                              \n"
-"#ifdef CONTEMPORARY_MONITOR                                                   \n"
-"  /* source: http://www.poynton.com/ColorFAQ.html */                          \n"
-"  #define RGB_LUMINANCE_RED    (0.212671f)                                    \n"
-"  #define RGB_LUMINANCE_GREEN  (0.715160f)                                    \n"
-"  #define RGB_LUMINANCE_BLUE   (0.072169f)                                    \n"
-"#else                                                                         \n"
-"  /* this is not correct, but the constants are kept around */                \n"
-"  #define RGB_LUMA_RED         (0.299)                                        \n"
-"  #define RGB_LUMA_GREEN       (0.587)                                        \n"
-"  #define RGB_LUMA_BLUE        (0.114)                                        \n"
-"  #define RGB_LUMINANCE_RED    RGB_LUMA_RED                                   \n"
-"  #define RGB_LUMINANCE_GREEN  RGB_LUMA_GREEN                                 \n"
-"  #define RGB_LUMINANCE_BLUE   RGB_LUMA_BLUE                                  \n"
-"#endif                                                                        \n"
+"#define RGB_LUMINANCE_RED    (0.222491)                                       \n"
+"#define RGB_LUMINANCE_GREEN  (0.716888)                                       \n"
+"#define RGB_LUMINANCE_BLUE   (0.060621)                                       \n"
 "                                                                              \n"
 "/* RGBA float -> YA float */                                                  \n"
 "__kernel void rgbaf_to_yaf (__global const float4 * in,                       \n"
diff --git a/operations/common/snn-mean.c b/operations/common/snn-mean.c
index 52d320c..0fe7294 100644
--- a/operations/common/snn-mean.c
+++ b/operations/common/snn-mean.c
@@ -93,17 +93,6 @@ process (GeglOperation       *operation,
   return  TRUE;
 }
 
-#define RGB_LUMINANCE_RED    (0.212671)
-#define RGB_LUMINANCE_GREEN  (0.715160)
-#define RGB_LUMINANCE_BLUE   (0.072169)
-
-static inline gfloat rgb2luminance (gfloat *pix)
-{
-  return pix[0] * RGB_LUMINANCE_RED +
-         pix[1] * RGB_LUMINANCE_GREEN +
-         pix[2] * RGB_LUMINANCE_BLUE;
-}
-
 #define POW2(a)((a)*(a))
 
 static inline gfloat colordiff (gfloat *pixA,
diff --git a/operations/workshop/snn-percentile.c b/operations/workshop/snn-percentile.c
index 4164ccd..c8e9a3c 100644
--- a/operations/workshop/snn-percentile.c
+++ b/operations/workshop/snn-percentile.c
@@ -41,10 +41,11 @@ gegl_chant_double (percentile, _("Percentile"), 0.0, 100.0, 50.0,
 #include "gegl-chant.h"
 #include <math.h>
 
-#define RGB_LUMINANCE_RED    (0.212671)
-#define RGB_LUMINANCE_GREEN  (0.715160)
-#define RGB_LUMINANCE_BLUE   (0.072169)
+#define RGB_LUMINANCE_RED    (0.222491)
+#define RGB_LUMINANCE_GREEN  (0.716888)
+#define RGB_LUMINANCE_BLUE   (0.060621)
 
+/* XXX: Use babl for this? */
 static inline gfloat rgb2luminance (gfloat *pix)
 {
   return pix[0] * RGB_LUMINANCE_RED +


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