[gimp] app: migrate gimpoperationcagecoefcalc to new iterator api



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

    app: migrate gimpoperationcagecoefcalc to new iterator api

 app/operations/gimpoperationcagecoefcalc.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/app/operations/gimpoperationcagecoefcalc.c b/app/operations/gimpoperationcagecoefcalc.c
index 30e7f49681..66e7527341 100644
--- a/app/operations/gimpoperationcagecoefcalc.c
+++ b/app/operations/gimpoperationcagecoefcalc.c
@@ -20,6 +20,7 @@
 #include "config.h"
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#define GEGL_ITERATOR2_API
 #include <gegl.h>
 
 #include "libgimpmath/gimpmath.h"
@@ -212,17 +213,17 @@ gimp_operation_cage_coef_calc_process (GeglOperation       *operation,
   n_cage_vertices   = gimp_cage_config_get_n_points (config);
 
   it = gegl_buffer_iterator_new (output, roi, 0, format,
-                                 GEGL_ACCESS_READWRITE, GEGL_ABYSS_NONE);
+                                 GEGL_ACCESS_READWRITE, GEGL_ABYSS_NONE, 1);
 
   while (gegl_buffer_iterator_next (it))
     {
       /* iterate inside the roi */
       gint  n_pixels = it->length;
-      gint  x = it->roi->x; /* initial x                   */
-      gint  y = it->roi->y; /*           and y coordinates */
+      gint  x = it->items[0].roi.x; /* initial x                   */
+      gint  y = it->items[0].roi.y; /*           and y coordinates */
       gint  j;
 
-      gfloat      *coef = it->data[0];
+      gfloat      *coef = it->items[0].data;
 
       while(n_pixels--)
         {
@@ -282,9 +283,9 @@ gimp_operation_cage_coef_calc_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]