[gegl] color-to-alpha: Indent code to our style (contd.)



commit 23121ffbfcd2ae3cc35945fba973ab56c0e430e9
Author: Mukund Sivaraman <muks banu com>
Date:   Wed Aug 31 19:03:25 2011 +0530

    color-to-alpha: Indent code to our style (contd.)

 operations/workshop/color-to-alpha.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)
---
diff --git a/operations/workshop/color-to-alpha.c b/operations/workshop/color-to-alpha.c
index 789037f..9ddc6b8 100644
--- a/operations/workshop/color-to-alpha.c
+++ b/operations/workshop/color-to-alpha.c
@@ -91,16 +91,17 @@ color_to_alpha (gfloat     *color,
   temp[3] = src[offset + 3];
   src[offset+3] = temp[3];
 
-
   for (i=0; i<3; i++)
-    if (color[i] < 0.0001)
-      temp[i] = src[offset+i];
-    else if (src[offset+i] > color[i])
-      temp[i] = (src[offset+i] - color[i]) / (1.0 - color[i]);
-    else if (src[offset+i] < color[i])
-      temp[i] = (color[i] - src[offset+i]) / color[i];
-    else
-      temp[i] = 0.0;
+    {
+      if (color[i] < 1.e-4f)
+        temp[i] = src[offset+i];
+      else if (src[offset+i] > color[i])
+        temp[i] = (src[offset+i] - color[i]) / (1.0 - color[i]);
+      else if (src[offset+i] < color[i])
+        temp[i] = (color[i] - src[offset+i]) / color[i];
+      else
+        temp[i] = 0.0;
+    }
 
   if (temp[0] > temp[1])
     {
@@ -114,13 +115,13 @@ color_to_alpha (gfloat     *color,
   else
     src[offset+3] = temp[2];
 
-  if (src[offset+3] < 0.0001)
+  if (src[offset+3] < 1.e-4f)
     return;
 
   for (i=0; i<3; i++)
     src[offset+i] = (src[offset+i] - color[i]) / src[offset+3] + color[i];
 
-  src[offset+3] *=temp[3];
+  src[offset+3] *= temp[3];
 }
 
 
@@ -131,11 +132,10 @@ process (GeglOperation       *operation,
          GeglBuffer          *output,
          const GeglRectangle *result)
 {
-  GeglChantO              *o            = GEGL_CHANT_PROPERTIES (operation);
-  Babl                    *format       = babl_format ("RGBA float");
-
-  gfloat *src_buf, color[4];
-  gint    x;
+  GeglChantO *o      = GEGL_CHANT_PROPERTIES (operation);
+  Babl       *format = babl_format ("RGBA float");
+  gfloat     *src_buf, color[4];
+  gint        x;
 
   src_buf = g_new0 (gfloat, result->width * result->height * 4);
 
@@ -150,7 +150,7 @@ process (GeglOperation       *operation,
 
   g_free (src_buf);
 
-  return  TRUE;
+  return TRUE;
 }
 
 



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