[gegl] photocopy: use new iterator api



commit ff1ddcbeef76e607b9ef4709120dcb140c2f64b3
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon Sep 10 16:49:05 2018 +0200

    photocopy: use new iterator api

 operations/common-gpl3+/photocopy.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/operations/common-gpl3+/photocopy.c b/operations/common-gpl3+/photocopy.c
index 850d79d41..5dfd69710 100644
--- a/operations/common-gpl3+/photocopy.c
+++ b/operations/common-gpl3+/photocopy.c
@@ -17,6 +17,8 @@
  * Copyright 2011 Hans Lo <hansshulo gmail com>
  */
 
+#define GEGL_ITERATOR2_API
+
 #include "config.h"
 #include <glib/gi18n-lib.h>
 
@@ -144,7 +146,7 @@ compute_ramp (GeglBuffer          *dest1,
   iter = gegl_buffer_iterator_new (dest1, roi, 0,
                                    babl_format ("Y float"),
                                    GEGL_ACCESS_READ,
-                                   GEGL_ABYSS_NONE);
+                                   GEGL_ABYSS_NONE, 2);
   gegl_buffer_iterator_add (iter, dest2, roi, 0,
                             babl_format ("Y float"),
                             GEGL_ACCESS_READ,
@@ -157,8 +159,8 @@ compute_ramp (GeglBuffer          *dest1,
   while (gegl_buffer_iterator_next (iter))
   {
     gint n_pixels = iter->length;
-    gfloat *ptr1  = iter->data[0];
-    gfloat *ptr2  = iter->data[1];
+    gfloat *ptr1  = iter->items[0].data;
+    gfloat *ptr2  = iter->items[1].data;
 
     while (n_pixels--)
       {
@@ -253,7 +255,7 @@ process (GeglOperation       *operation,
   iter = gegl_buffer_iterator_new (dest1, result, 0,
                                    babl_format ("Y float"),
                                    GEGL_ACCESS_READ,
-                                   GEGL_ABYSS_NONE);
+                                   GEGL_ABYSS_NONE, 4);
   gegl_buffer_iterator_add (iter, dest2, result, 0,
                             babl_format ("Y float"),
                             GEGL_ACCESS_READ,
@@ -266,9 +268,9 @@ process (GeglOperation       *operation,
   while (gegl_buffer_iterator_next (iter))
     {
       gint    n_pixels  = iter->length;
-      gfloat *ptr1      = iter->data[0];
-      gfloat *ptr2      = iter->data[1];
-      gfloat *out_pixel = iter->data[2];
+      gfloat *ptr1      = iter->items[0].data;
+      gfloat *ptr2      = iter->items[1].data;
+      gfloat *out_pixel = iter->items[2].data;
 
       while (n_pixels--)
         {


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