[gegl] operations: fix misleading indentation in panorama-projection.c



commit 6123f869d06536c2454eec6fb84004761dfcc03d
Author: Michael Natterer <mitch gimp org>
Date:   Sat Aug 6 20:00:03 2016 +0200

    operations: fix misleading indentation in panorama-projection.c
    
    Found by -Wmisleading-indentation. And some trailing whitespace in c2g.c

 operations/common/c2g.c                 |    6 +-
 operations/common/panorama-projection.c |  142 ++++++++++++++++---------------
 2 files changed, 75 insertions(+), 73 deletions(-)
---
diff --git a/operations/common/c2g.c b/operations/common/c2g.c
index d6a6ed0..a26a096 100644
--- a/operations/common/c2g.c
+++ b/operations/common/c2g.c
@@ -35,7 +35,7 @@ property_int (radius, _("Radius"), 300)
 
 property_int  (samples, _("Samples"), 4)
   description (_("Number of samples to do per iteration looking for the range of colors"))
-  value_range (1, 1000) 
+  value_range (1, 1000)
   ui_range    (3, 17)
 
 property_int (iterations, _("Iterations"), 10)
@@ -75,7 +75,7 @@ static void c2g (GeglOperation       *op,
 
   if (dst_rect->width > 0 && dst_rect->height > 0)
   {
-    /* XXX: compute total pixels and progress by consumption 
+    /* XXX: compute total pixels and progress by consumption
      */
     GeglBufferIterator *i = gegl_buffer_iterator_new (dst, dst_rect, 0, babl_format("YA float"),
                                                       GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
@@ -138,7 +138,7 @@ static void c2g (GeglOperation       *op,
                 dst_offset+=2;
               }
             }
-      
+
             pix_done += i->roi[0].width;
           }
 #if 0
diff --git a/operations/common/panorama-projection.c b/operations/common/panorama-projection.c
index 1e43915..233e6d5 100644
--- a/operations/common/panorama-projection.c
+++ b/operations/common/panorama-projection.c
@@ -389,84 +389,86 @@ process (GeglOperation       *operation,
       sampler_type == GEGL_SAMPLER_LOHALO)
     scale = &scale_matrix;
 
-    {
-      float   ud = ((1.0/transform.width)*factor);
-      float   vd = ((1.0/transform.height)*factor);
-      it = gegl_buffer_iterator_new (output, result, level, format_io,
-                                     GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
-
-      while (gegl_buffer_iterator_next (it))
-        {
-          gint i;
-          gint n_pixels = it->length;
-          gint x = it->roi->x; /* initial x                   */
-          gint y = it->roi->y; /*           and y coordinates */
-
-          float   u0 = (((x*factor)/transform.width) - transform.xoffset);
-          float   u, v;
-
-          float *out = it->data[0];
-
-          u = u0;
-          v = ((y*factor/transform.height) - 0.5);
-
-          if (scale)
-            {
-              for (i=0; i<n_pixels; i++)
-                {
-                  float cx, cy;
-#define gegl_unmap(xx,yy,ud,vd) { \
-                  float rx, ry;\
-                  transform.xy2ll (&transform, xx, yy, &rx, &ry);\
+  {
+    float   ud = ((1.0/transform.width)*factor);
+    float   vd = ((1.0/transform.height)*factor);
+
+    it = gegl_buffer_iterator_new (output, result, level, format_io,
+                                   GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
+
+    while (gegl_buffer_iterator_next (it))
+      {
+        gint i;
+        gint n_pixels = it->length;
+        gint x = it->roi->x; /* initial x                   */
+        gint y = it->roi->y; /*           and y coordinates */
+
+        float   u0 = (((x*factor)/transform.width) - transform.xoffset);
+        float   u, v;
+
+        float *out = it->data[0];
+
+        u = u0;
+        v = ((y*factor/transform.height) - 0.5);
+
+        if (scale)
+          {
+            for (i=0; i<n_pixels; i++)
+              {
+                float cx, cy;
+#define gegl_unmap(xx,yy,ud,vd) {                                       \
+                  float rx, ry;                                         \
+                  transform.xy2ll (&transform, xx, yy, &rx, &ry);       \
                   ud = rx;vd = ry;}
-                  gegl_sampler_compute_scale (scale_matrix, u, v);
-                  gegl_unmap(u,v, cx, cy);
+                gegl_sampler_compute_scale (scale_matrix, u, v);
+                gegl_unmap(u,v, cx, cy);
 #undef gegl_unmap
 
-                  gegl_sampler_get (sampler,
-                                    cx * in_rect.width, cy * in_rect.height,
-                                    scale, out, GEGL_ABYSS_LOOP);
-                  out += 4;
-
-                  /* update x, y and u,v coordinates */
-                  x++;
-                  u+=ud;
-                  if (x >= (it->roi->x + it->roi->width))
-                    {
-                      x = it->roi->x;
-                      y++;
-                      u = u0;
-                      v += vd;
-                    }
-                }
+                gegl_sampler_get (sampler,
+                                  cx * in_rect.width, cy * in_rect.height,
+                                  scale, out, GEGL_ABYSS_LOOP);
+                out += 4;
+
+                /* update x, y and u,v coordinates */
+                x++;
+                u+=ud;
+                if (x >= (it->roi->x + it->roi->width))
+                  {
+                    x = it->roi->x;
+                    y++;
+                    u = u0;
+                    v += vd;
+                  }
               }
-            else
+          }
+        else
+          {
+            for (i=0; i<n_pixels; i++)
               {
-                for (i=0; i<n_pixels; i++)
+                float cx, cy;
+
+                transform.xy2ll (&transform, u, v, &cx, &cy);
+
+                gegl_sampler_get (sampler,
+                                  cx * in_rect.width, cy * in_rect.height,
+                                  scale, out, GEGL_ABYSS_LOOP);
+                out += 4;
+
+                /* update x, y and u,v coordinates */
+                x++;
+                u+=ud;
+                if (x >= (it->roi->x + it->roi->width))
                   {
-                    float cx, cy;
-
-                    transform.xy2ll (&transform, u, v, &cx, &cy);
-
-                    gegl_sampler_get (sampler,
-                                      cx * in_rect.width, cy * in_rect.height,
-                                      scale, out, GEGL_ABYSS_LOOP);
-                    out += 4;
-
-                    /* update x, y and u,v coordinates */
-                    x++;
-                    u+=ud;
-                    if (x >= (it->roi->x + it->roi->width))
-                      {
-                        x = it->roi->x;
-                        u = u0;
-                        y++;
-                        v += vd;
-                      }
+                    x = it->roi->x;
+                    u = u0;
+                    y++;
+                    v += vd;
                   }
               }
-        }
-    }
+          }
+      }
+  }
+
   g_object_unref (sampler);
 
 #if 0


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