[gimp] plug-ins: migrate print-draw-page to new iterator api



commit 49c53568d7e9b865f5b49be8f052d783511c90c7
Author: Øyvind Kolås <pippin gimp org>
Date:   Tue Sep 11 02:04:47 2018 +0200

    plug-ins: migrate print-draw-page to new iterator api

 plug-ins/print/print-draw-page.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/plug-ins/print/print-draw-page.c b/plug-ins/print/print-draw-page.c
index 250114f508..26a2ac96a8 100644
--- a/plug-ins/print/print-draw-page.c
+++ b/plug-ins/print/print-draw-page.c
@@ -15,6 +15,7 @@
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
+#define GEGL_ITERATOR2_API
 #include "config.h"
 
 #include <string.h>
@@ -140,23 +141,23 @@ print_surface_from_drawable (gint32   drawable_ID,
   iter = gegl_buffer_iterator_new (buffer,
                                    GEGL_RECTANGLE (0, 0, width, height), 0,
                                    format,
-                                   GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
+                                   GEGL_ACCESS_READ, GEGL_ABYSS_NONE, 1);
 
   while (gegl_buffer_iterator_next (iter))
     {
-      const guchar *src  = iter->data[0];
-      guchar       *dest = pixels + iter->roi->y * stride + iter->roi->x * 4;
+      const guchar *src  = iter->items[0].data;
+      guchar       *dest = pixels + iter->items[0].roi.y * stride + iter->items[0].roi.x * 4;
       gint          y;
 
-      for (y = 0; y < iter->roi->height; y++)
+      for (y = 0; y < iter->items[0].roi.height; y++)
         {
-          memcpy (dest, src, iter->roi->width * 4);
+          memcpy (dest, src, iter->items[0].roi.width * 4);
 
-          src  += iter->roi->width * 4;
+          src  += iter->items[0].roi.width * 4;
           dest += stride;
         }
 
-      done += iter->roi->height * iter->roi->width;
+      done += iter->items[0].roi.height * iter->items[0].roi.width;
 
       if (count++ % 16 == 0)
         gimp_progress_update ((gdouble) done / (width * height));


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