[gegl] color-enhance: use new iterator api



commit d4c171d5aee6d7038c970b97dbaa064a0cfd437d
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon Sep 10 22:36:23 2018 +0200

    color-enhance: use new iterator api

 operations/common/color-enhance.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/operations/common/color-enhance.c b/operations/common/color-enhance.c
index eb829b421..d9ac3748a 100644
--- a/operations/common/color-enhance.c
+++ b/operations/common/color-enhance.c
@@ -19,6 +19,7 @@
  *
  * Thomas Manni <thomas manni free fr>
  */
+#define GEGL_ITERATOR2_API
 
 #include "config.h"
 #include <glib/gi18n-lib.h>
@@ -48,7 +49,7 @@ buffer_get_min_max (GeglOperation       *operation,
   gegl_operation_progress (operation, 0.0, "");
 
   gi = gegl_buffer_iterator_new (buffer, result, 0, format,
-                                 GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
+                                 GEGL_ACCESS_READ, GEGL_ABYSS_NONE, 1);
 
   *min = G_MAXDOUBLE;
   *max = -G_MAXDOUBLE;
@@ -56,7 +57,7 @@ buffer_get_min_max (GeglOperation       *operation,
   while (gegl_buffer_iterator_next (gi))
     {
       gint o;
-      gfloat *buf = gi->data[0];
+      gfloat *buf = gi->items[0].data;
 
       for (o = 0; o < gi->length; o++)
         {
@@ -147,7 +148,7 @@ process (GeglOperation       *operation,
   gegl_operation_progress (operation, 0.5, "");
 
   gi = gegl_buffer_iterator_new (input, result, 0, format,
-                                 GEGL_ACCESS_READ, GEGL_ABYSS_NONE);
+                                 GEGL_ACCESS_READ, GEGL_ABYSS_NONE, 2);
 
   gegl_buffer_iterator_add (gi, output, result, 0, format,
                             GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
@@ -165,8 +166,8 @@ process (GeglOperation       *operation,
     {
       while (gegl_buffer_iterator_next (gi))
         {
-          gfloat *in  = gi->data[0];
-          gfloat *out = gi->data[1];
+          gfloat *in  = gi->items[0].data;
+          gfloat *out = gi->items[1].data;
 
           gint i;
           for (i = 0; i < gi->length; i++)
@@ -193,8 +194,8 @@ process (GeglOperation       *operation,
     {
        while (gegl_buffer_iterator_next (gi))
         {
-          gfloat *in  = gi->data[0];
-          gfloat *out = gi->data[1];
+          gfloat *in  = gi->items[0].data;
+          gfloat *out = gi->items[1].data;
 
           gint i;
           for (i = 0; i < gi->length; i++)


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