[gimp/gimp-2-10] app: migrate heal to new iterator api



commit 645a9456477bbf665a023fd3ead7c179ad050f81
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Sep 11 01:33:59 2018 +0200

    app: migrate heal to new iterator api
    
    (cherry picked from commit 24fbdfb5917e0db3b312bc413eef1469811253d5)

 app/paint/gimpheal.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/app/paint/gimpheal.c b/app/paint/gimpheal.c
index 0c2a0f3c0a..140baf0504 100644
--- a/app/paint/gimpheal.c
+++ b/app/paint/gimpheal.c
@@ -25,6 +25,7 @@
 #include <string.h>
 
 #include <gdk-pixbuf/gdk-pixbuf.h>
+#define GEGL_ITERATOR2_API
 #include <gegl.h>
 
 #include "libgimpbase/gimpbase.h"
@@ -205,7 +206,7 @@ gimp_heal_sub (GeglBuffer          *top_buffer,
     g_return_if_reached ();
 
   iter = gegl_buffer_iterator_new (top_buffer, top_rect, 0, format,
-                                   GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
+                                   GEGL_ACCESS_READ, GEGL_ABYSS_NONE, 3);
 
   gegl_buffer_iterator_add (iter, bottom_buffer, bottom_rect, 0, format,
                             GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
@@ -216,9 +217,9 @@ gimp_heal_sub (GeglBuffer          *top_buffer,
 
   while (gegl_buffer_iterator_next (iter))
     {
-      gfloat *t      = iter->data[0];
-      gfloat *b      = iter->data[1];
-      gfloat *r      = iter->data[2];
+      gfloat *t      = iter->items[0].data;
+      gfloat *b      = iter->items[1].data;
+      gfloat *r      = iter->items[2].data;
       gint    length = iter->length * n_components;
 
       while (length--)
@@ -250,7 +251,7 @@ gimp_heal_add (GeglBuffer          *first_buffer,
   iter = gegl_buffer_iterator_new (first_buffer, first_rect, 0,
                                    babl_format_n (babl_type ("float"),
                                                   n_components),
-                                   GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
+                                   GEGL_ACCESS_READ, GEGL_ABYSS_NONE, 3);
 
   gegl_buffer_iterator_add (iter, second_buffer, second_rect, 0, format,
                             GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
@@ -260,9 +261,9 @@ gimp_heal_add (GeglBuffer          *first_buffer,
 
   while (gegl_buffer_iterator_next (iter))
     {
-      gfloat *f      = iter->data[0];
-      gfloat *s      = iter->data[1];
-      gfloat *r      = iter->data[2];
+      gfloat *f      = iter->items[0].data;
+      gfloat *s      = iter->items[1].data;
+      gfloat *r      = iter->items[2].data;
       gint    length = iter->length * n_components;
 
       while (length--)


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