[gegl] red-eye-removal: Use f suffix for float constants



commit bd9f98e2b0c4add1325a62a88260fbd01cab6143
Author: Jan Vesely <jan vesely rutgers edu>
Date:   Sun Apr 20 17:31:31 2014 -0400

    red-eye-removal: Use f suffix for float constants

 opencl/red-eye-removal.cl   |    8 ++++----
 opencl/red-eye-removal.cl.h |    8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/opencl/red-eye-removal.cl b/opencl/red-eye-removal.cl
index 3de51d5..537666b 100644
--- a/opencl/red-eye-removal.cl
+++ b/opencl/red-eye-removal.cl
@@ -16,9 +16,9 @@
  * Copyright 2013 Carlos Zubieta <czubieta dev gmail com>
  */
 
-#define RED_FACTOR    0.5133333
+#define RED_FACTOR    0.5133333f
 #define GREEN_FACTOR  1
-#define BLUE_FACTOR   0.1933333
+#define BLUE_FACTOR   0.1933333f
 
 __kernel void cl_red_eye_removal(__global const float4 *in,
                                  __global       float4 *out,
@@ -29,13 +29,13 @@ __kernel void cl_red_eye_removal(__global const float4 *in,
   float adjusted_red       = in_v.x * RED_FACTOR;
   float adjusted_green     = in_v.y * GREEN_FACTOR;
   float adjusted_blue      = in_v.z * BLUE_FACTOR;
-  float adjusted_threshold = (threshold - 0.4) * 2;
+  float adjusted_threshold = (threshold - 0.4f) * 2;
   float tmp;
 
   if (adjusted_red >= adjusted_green - adjusted_threshold &&
       adjusted_red >= adjusted_blue  - adjusted_threshold)
     {
-      tmp = (adjusted_green + adjusted_blue) / (2.0 * RED_FACTOR);
+      tmp = (adjusted_green + adjusted_blue) / (2.0f * RED_FACTOR);
       in_v.x = clamp(tmp, 0.0f, 1.0f);
     }
   out[gid]  = in_v;
diff --git a/opencl/red-eye-removal.cl.h b/opencl/red-eye-removal.cl.h
index 0c517b5..66eeeed 100644
--- a/opencl/red-eye-removal.cl.h
+++ b/opencl/red-eye-removal.cl.h
@@ -17,9 +17,9 @@ static const char* red_eye_removal_cl_source =
 " * Copyright 2013 Carlos Zubieta <czubieta dev gmail com>                     \n"
 " */                                                                           \n"
 "                                                                              \n"
-"#define RED_FACTOR    0.5133333                                               \n"
+"#define RED_FACTOR    0.5133333f                                              \n"
 "#define GREEN_FACTOR  1                                                       \n"
-"#define BLUE_FACTOR   0.1933333                                               \n"
+"#define BLUE_FACTOR   0.1933333f                                              \n"
 "                                                                              \n"
 "__kernel void cl_red_eye_removal(__global const float4 *in,                   \n"
 "                                 __global       float4 *out,                  \n"
@@ -30,13 +30,13 @@ static const char* red_eye_removal_cl_source =
 "  float adjusted_red       = in_v.x * RED_FACTOR;                             \n"
 "  float adjusted_green     = in_v.y * GREEN_FACTOR;                           \n"
 "  float adjusted_blue      = in_v.z * BLUE_FACTOR;                            \n"
-"  float adjusted_threshold = (threshold - 0.4) * 2;                           \n"
+"  float adjusted_threshold = (threshold - 0.4f) * 2;                          \n"
 "  float tmp;                                                                  \n"
 "                                                                              \n"
 "  if (adjusted_red >= adjusted_green - adjusted_threshold &&                  \n"
 "      adjusted_red >= adjusted_blue  - adjusted_threshold)                    \n"
 "    {                                                                         \n"
-"      tmp = (adjusted_green + adjusted_blue) / (2.0 * RED_FACTOR);            \n"
+"      tmp = (adjusted_green + adjusted_blue) / (2.0f * RED_FACTOR);           \n"
 "      in_v.x = clamp(tmp, 0.0f, 1.0f);                                        \n"
 "    }                                                                         \n"
 "  out[gid]  = in_v;                                                           \n"


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