[gimp] app: migrate gegl-mask-combine to new iterator api



commit fcf113a39cd93390136bf40ca2d0a50c35200b13
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Sep 11 00:36:12 2018 +0200

    app: migrate gegl-mask-combine to new iterator api

 app/gegl/gimp-gegl-mask-combine.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/app/gegl/gimp-gegl-mask-combine.c b/app/gegl/gimp-gegl-mask-combine.c
index abedf61de9..9ab093fe8c 100644
--- a/app/gegl/gimp-gegl-mask-combine.c
+++ b/app/gegl/gimp-gegl-mask-combine.c
@@ -20,6 +20,7 @@
 #include <string.h>
 
 #include <gio/gio.h>
+#define GEGL_ITERATOR2_API
 #include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -205,12 +206,12 @@ gimp_gegl_mask_combine_ellipse_rect (GeglBuffer     *mask,
   iter = gegl_buffer_iterator_new (mask,
                                    GEGL_RECTANGLE (x0, y0, width, height), 0,
                                    babl_format ("Y float"),
-                                   GEGL_ACCESS_READWRITE, GEGL_ABYSS_NONE);
-  roi = &iter->roi[0];
+                                   GEGL_ACCESS_READWRITE, GEGL_ABYSS_NONE, 1);
+  roi = &iter->items[0].roi;
 
   while (gegl_buffer_iterator_next (iter))
     {
-      gfloat *data = iter->data[0];
+      gfloat *data = iter->items[0].data;
       gint    py;
 
       for (py = roi->y;
@@ -411,7 +412,7 @@ gimp_gegl_mask_combine_buffer (GeglBuffer     *mask,
 
   iter = gegl_buffer_iterator_new (mask, &rect, 0,
                                    mask_format,
-                                   GEGL_ACCESS_READWRITE, GEGL_ABYSS_NONE);
+                                   GEGL_ACCESS_READWRITE, GEGL_ABYSS_NONE, 2);
 
   rect.x -= off_x;
   rect.y -= off_y;
@@ -443,8 +444,8 @@ gimp_gegl_mask_combine_buffer (GeglBuffer     *mask,
     case GIMP_CHANNEL_OP_REPLACE:
       while (gegl_buffer_iterator_next (iter))
         {
-          gfloat       *mask_data   = iter->data[0];
-          const gfloat *add_on_data = iter->data[1];
+          gfloat       *mask_data   = iter->items[0].data;
+          const gfloat *add_on_data = iter->items[1].data;
           gint          count       = iter->length;
 
           while (count--)
@@ -462,8 +463,8 @@ gimp_gegl_mask_combine_buffer (GeglBuffer     *mask,
     case GIMP_CHANNEL_OP_SUBTRACT:
       while (gegl_buffer_iterator_next (iter))
         {
-          gfloat       *mask_data   = iter->data[0];
-          const gfloat *add_on_data = iter->data[1];
+          gfloat       *mask_data   = iter->items[0].data;
+          const gfloat *add_on_data = iter->items[1].data;
           gint          count       = iter->length;
 
           while (count--)
@@ -482,8 +483,8 @@ gimp_gegl_mask_combine_buffer (GeglBuffer     *mask,
     case GIMP_CHANNEL_OP_INTERSECT:
       while (gegl_buffer_iterator_next (iter))
         {
-          gfloat       *mask_data   = iter->data[0];
-          const gfloat *add_on_data = iter->data[1];
+          gfloat       *mask_data   = iter->items[0].data;
+          const gfloat *add_on_data = iter->items[1].data;
           gint          count       = iter->length;
 
           while (count--)


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