[gegl] operations: move red-eye-removal from workshop/ to common/



commit 594de11bad528c1783dc6c9551cc0c989bed5fd9
Author: Michael Natterer <mitch gimp org>
Date:   Sun May 19 20:46:56 2013 +0200

    operations: move red-eye-removal from workshop/ to common/
    
    and some more minor cleanup.

 operations/{workshop => common}/red-eye-removal.c |   25 ++++++++++-----------
 po/POTFILES.in                                    |    6 ++--
 2 files changed, 15 insertions(+), 16 deletions(-)
---
diff --git a/operations/workshop/red-eye-removal.c b/operations/common/red-eye-removal.c
similarity index 84%
rename from operations/workshop/red-eye-removal.c
rename to operations/common/red-eye-removal.c
index e8210cd..81aac57 100644
--- a/operations/workshop/red-eye-removal.c
+++ b/operations/common/red-eye-removal.c
@@ -18,8 +18,8 @@
  *
  * Based on a GIMP 1.2 Perl plugin by Geoff Kuenning
  *
- * Copyright (C) 2004  Robert Merkel <robert merkel benambra org>
- * Copyright (C) 2006  Andreas Røsdal <andrearo stud ntnu no>
+ * Copyright (C) 2004 Robert Merkel <robert merkel benambra org>
+ * Copyright (C) 2006 Andreas Røsdal <andrearo stud ntnu no>
  * Copyright (C) 2011 Robert Sasu <sasu robert gmail com>
  */
 
@@ -28,13 +28,14 @@
 
 #ifdef GEGL_CHANT_PROPERTIES
 
-gegl_chant_double (threshold, _("Threshold"), 0.0, 0.8, 0.4,
-                   _("The value of the threshold"))
+gegl_chant_double (threshold, _("Threshold"),
+                   0.0, 0.8, 0.4,
+                   _("Red eye threshold"))
 
 #else
 
 #define GEGL_CHANT_TYPE_FILTER
-#define GEGL_CHANT_C_FILE       "red-eye-removal.c"
+#define GEGL_CHANT_C_FILE "red-eye-removal.c"
 
 #include "gegl-chant.h"
 #include <stdio.h>
@@ -46,7 +47,8 @@ gegl_chant_double (threshold, _("Threshold"), 0.0, 0.8, 0.4,
 
 #define SCALE_WIDTH   100
 
-static void prepare (GeglOperation *operation)
+static void
+prepare (GeglOperation *operation)
 {
   gegl_operation_set_format (operation, "input",
                              babl_format ("R'G'B'A float"));
@@ -70,10 +72,10 @@ red_eye_reduction (gfloat *src,
   gfloat dest;
 
   if (adjusted_red >= adjusted_green - adjusted_threshold &&
-      adjusted_red >= adjusted_blue - adjusted_threshold)
+      adjusted_red >= adjusted_blue  - adjusted_threshold)
     {
-      dest = CLAMP (((gdouble) (adjusted_green + adjusted_blue)
-                     / (2.0  * RED_FACTOR)), 0.0, 1.0);
+      dest = (gdouble) (adjusted_green + adjusted_blue) / (2.0  * RED_FACTOR);
+      dest = CLAMP (dest, 0.0, 1.0);
     }
   else
     {
@@ -83,8 +85,6 @@ red_eye_reduction (gfloat *src,
   src[offset] = dest;
 }
 
-
-
 static gboolean
 process (GeglOperation       *operation,
          GeglBuffer          *input,
@@ -113,7 +113,6 @@ process (GeglOperation       *operation,
   return  TRUE;
 }
 
-
 static void
 gegl_chant_class_init (GeglChantClass *klass)
 {
@@ -129,7 +128,7 @@ gegl_chant_class_init (GeglChantClass *klass)
   gegl_operation_class_set_keys (operation_class,
     "categories"  , "enhance",
     "name"        , "gegl:red-eye-removal",
-    "description" , _("Performs red-eye-removal on the image"),
+    "description" , _("Remove the red eye effect caused by camera flashes"),
     NULL);
 }
 
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 8c16050..380d0d4 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -66,12 +66,11 @@ operations/common/polar-coordinates.c
 operations/common/posterize.c
 operations/common/raw-load.c
 operations/common/rectangle.c
+operations/common/red-eye-removal.c
 operations/common/reinhard05.c
 operations/common/remap.c
 operations/common/ripple.c
 operations/common/save.c
-operations/seamless-clone/seamless-clone.c
-operations/seamless-clone/seamless-clone-compose.c
 operations/common/shift.c
 operations/common/snn-mean.c
 operations/common/softglow.c
@@ -143,6 +142,8 @@ operations/generated/src-over.c
 operations/generated/subtract.c
 operations/generated/svg-multiply.c
 operations/generated/xor.c
+operations/seamless-clone/seamless-clone.c
+operations/seamless-clone/seamless-clone-compose.c
 operations/transform/reflect.c
 operations/transform/rotate.c
 operations/transform/scale.c
@@ -184,7 +185,6 @@ operations/workshop/noise-spread.c
 operations/workshop/plasma.c
 operations/workshop/radial-gradient.c
 operations/workshop/rawbayer-load.c
-operations/workshop/red-eye-removal.c
 operations/workshop/snn-percentile.c
 operations/workshop/warp.c
 operations/workshop/whirl-pinch.c


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