[gimp] app: migrate gimpoperationcagetransform to new iterator api



commit f03a84d607efe64207b7e7586e722130a5416ea9
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Sep 11 01:46:53 2018 +0200

    app: migrate gimpoperationcagetransform to new iterator api

 app/operations/gimpoperationcagetransform.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/app/operations/gimpoperationcagetransform.c b/app/operations/gimpoperationcagetransform.c
index f0467d5088..d2267c8bfa 100644
--- a/app/operations/gimpoperationcagetransform.c
+++ b/app/operations/gimpoperationcagetransform.c
@@ -20,6 +20,7 @@
 #include "config.h"
 
 #include <cairo.h>
+#define GEGL_ITERATOR2_API
 #include <gegl.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
@@ -234,7 +235,7 @@ gimp_operation_cage_transform_process (GeglOperation       *operation,
 
   /* pre-fill the out buffer with no-displacement coordinate */
   it      = gegl_buffer_iterator_new (out_buf, roi, 0, NULL,
-                                      GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
+                                      GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE, 1);
   cage_bb = gimp_cage_config_get_bounding_box (config);
 
   point = &(g_array_index (config->cage_points, GimpCagePoint, 0));
@@ -247,10 +248,10 @@ gimp_operation_cage_transform_process (GeglOperation       *operation,
     {
       /* iterate inside the roi */
       gint    n_pixels = it->length;
-      gfloat *output   = it->data[0];
+      gfloat *output   = it->items[0].data;
 
-      x = it->roi->x; /* initial x         */
-      y = it->roi->y; /* and y coordinates */
+      x = it->items[0].roi.x; /* initial x         */
+      y = it->items[0].roi.y; /* and y coordinates */
 
       while (n_pixels--)
         {
@@ -280,9 +281,9 @@ gimp_operation_cage_transform_process (GeglOperation       *operation,
 
           /* update x and y coordinates */
           x++;
-          if (x >= (it->roi->x + it->roi->width))
+          if (x >= (it->items[0].roi.x + it->items[0].roi.width))
             {
-              x = it->roi->x;
+              x = it->items[0].roi.x;
               y++;
             }
         }


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