[gegl] gegl: use new iterator API in point op base classes



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

    gegl: use new iterator API in point op base classes

 gegl/operation/gegl-operation-point-composer.c  | 19 +++++++++++--------
 gegl/operation/gegl-operation-point-composer3.c | 21 +++++++++++----------
 gegl/operation/gegl-operation-point-filter.c    | 13 +++++++------
 gegl/operation/gegl-operation-point-render.c    |  5 +++--
 4 files changed, 32 insertions(+), 26 deletions(-)
---
diff --git a/gegl/operation/gegl-operation-point-composer.c b/gegl/operation/gegl-operation-point-composer.c
index ddf64561c..bacc14688 100644
--- a/gegl/operation/gegl-operation-point-composer.c
+++ b/gegl/operation/gegl-operation-point-composer.c
@@ -21,6 +21,8 @@
 
 #include <glib-object.h>
 
+#define GEGL_ITERATOR2_API
+
 #include "gegl.h"
 #include "gegl-debug.h"
 #include "gegl-operation-point-composer.h"
@@ -64,7 +66,8 @@ static void thread_process (gpointer thread_data, gpointer unused)
                                                     data->level,
                                                     data->output_format,
                                                     GEGL_ACCESS_WRITE,
-                                                    GEGL_ABYSS_NONE);
+                                                    GEGL_ABYSS_NONE,
+                                                    4);
 
   if (data->input)
     read = gegl_buffer_iterator_add (i, data->input, &data->result, data->level,
@@ -78,9 +81,9 @@ static void thread_process (gpointer thread_data, gpointer unused)
   while (gegl_buffer_iterator_next (i))
   {
      data->success =
-     data->klass->process (data->operation, data->input?i->data[read]:NULL,
-                           data->aux?i->data[aux]:NULL,
-                           i->data[0], i->length, &(i->roi[0]), data->level);
+     data->klass->process (data->operation, data->input?i->items[read].data:NULL,
+                           data->aux?i->items[aux].data:NULL,
+                           i->items[0].data, i->length, &(i->items[0].roi), data->level);
   }
 
   g_atomic_int_add (data->pending, -1);
@@ -385,7 +388,7 @@ gegl_operation_point_composer_process (GeglOperation       *operation,
       }
       else
       {
-        GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, level, out_format, 
GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
+        GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, level, out_format, 
GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE, 4);
         gint foo = 0, read = 0;
 
         if (input)
@@ -395,9 +398,9 @@ gegl_operation_point_composer_process (GeglOperation       *operation,
 
         while (gegl_buffer_iterator_next (i))
           {
-            point_composer_class->process (operation, input?i->data[read]:NULL,
-                                                      aux?i->data[foo]:NULL,
-                                                      i->data[0], i->length, &(i->roi[0]), level);
+            point_composer_class->process (operation, input?i->items[read].data:NULL,
+                                                      aux?i->items[foo].data:NULL,
+                                                      i->items[0].data, i->length, &(i->items[0].roi), 
level);
           }
         return TRUE;
       }
diff --git a/gegl/operation/gegl-operation-point-composer3.c b/gegl/operation/gegl-operation-point-composer3.c
index f54d2ace4..ebfcd22a5 100644
--- a/gegl/operation/gegl-operation-point-composer3.c
+++ b/gegl/operation/gegl-operation-point-composer3.c
@@ -20,6 +20,7 @@
 #include "config.h"
 
 #include <glib-object.h>
+#define GEGL_ITERATOR2_API
 
 #include "gegl.h"
 #include "gegl-operation-point-composer3.h"
@@ -63,7 +64,7 @@ static void thread_process (gpointer thread_data, gpointer unused)
                                                     data->level,
                                                     data->output_format,
                                                     GEGL_ACCESS_WRITE,
-                                                    GEGL_ABYSS_NONE);
+                                                    GEGL_ABYSS_NONE, 4);
 
   if (data->input)
     read = gegl_buffer_iterator_add (i, data->input, &data->result, data->level,
@@ -82,10 +83,10 @@ static void thread_process (gpointer thread_data, gpointer unused)
   {
      data->success =
      data->klass->process (data->operation,
-                           data->input?i->data[read]:NULL,
-                           data->aux?i->data[aux]:NULL,
-                           data->aux2?i->data[aux2]:NULL,
-                           i->data[0], i->length, &(i->roi[0]), data->level);
+                           data->input?i->items[read].data:NULL,
+                           data->aux?i->items[aux].data:NULL,
+                           data->aux2?i->items[aux2].data:NULL,
+                           i->items[0].data, i->length, &(i->items[0].roi), data->level);
   }
 
   g_atomic_int_add (data->pending, -1);
@@ -307,7 +308,7 @@ gegl_operation_point_composer3_process (GeglOperation       *operation,
       else
       {
         GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, level, out_format,
-                                                          GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
+                                                          GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE, 4);
         gint foo = 0, bar = 0, read = 0;
 
         if (input)
@@ -322,10 +323,10 @@ gegl_operation_point_composer3_process (GeglOperation       *operation,
 
         while (gegl_buffer_iterator_next (i))
           {
-            point_composer3_class->process (operation, input?i->data[read]:NULL,
-                                                       aux?i->data[foo]:NULL,
-                                                       aux2?i->data[bar]:NULL,
-                                                       i->data[0], i->length, &(i->roi[0]), level);
+            point_composer3_class->process (operation, input?i->items[read].data:NULL,
+                                                       aux?i->items[foo].data:NULL,
+                                                       aux2?i->items[bar].data:NULL,
+                                                       i->items[0].data, i->length, &(i->items[0].roi), 
level);
           }
         return TRUE;
       }
diff --git a/gegl/operation/gegl-operation-point-filter.c b/gegl/operation/gegl-operation-point-filter.c
index 399e6f39a..6fffa74a1 100644
--- a/gegl/operation/gegl-operation-point-filter.c
+++ b/gegl/operation/gegl-operation-point-filter.c
@@ -21,6 +21,7 @@
 
 #include <glib-object.h>
 
+#define GEGL_ITERATOR2_API
 #include "gegl.h"
 #include "gegl-debug.h"
 #include "gegl-operation-point-filter.h"
@@ -59,7 +60,7 @@ static void thread_process (gpointer thread_data, gpointer unused)
                                                     data->level,
                                                     data->output_format,
                                                     GEGL_ACCESS_WRITE,
-                                                    GEGL_ABYSS_NONE);
+                                                    GEGL_ABYSS_NONE, 4);
   gint read = 0;
   if (data->input)
     read = gegl_buffer_iterator_add (i, data->input, &data->result, data->level,
@@ -69,8 +70,8 @@ static void thread_process (gpointer thread_data, gpointer unused)
   while (gegl_buffer_iterator_next (i))
   {
      data->success =
-     data->klass->process (data->operation, data->input?i->data[read]:NULL,
-                           i->data[0], i->length, &(i->roi[0]), data->level);
+     data->klass->process (data->operation, data->input?i->items[read].data:NULL,
+                           i->items[0].data, i->length, &(i->items[0].roi), data->level);
   }
 
   g_atomic_int_add (data->pending, -1);
@@ -344,7 +345,7 @@ gegl_operation_point_filter_process (GeglOperation       *operation,
       else
       {
         GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, level, out_format,
-                                                          GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
+                                                          GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE, 4);
         gint read = 0;
 
         if (input)
@@ -353,8 +354,8 @@ gegl_operation_point_filter_process (GeglOperation       *operation,
 
         while (gegl_buffer_iterator_next (i))
           {
-            point_filter_class->process (operation, input?i->data[read]:NULL,
-                                                    i->data[0], i->length, &(i->roi[0]), level);
+            point_filter_class->process (operation, input?i->items[read].data:NULL,
+                                                    i->items[0].data, i->length, &(i->items[0].roi), level);
           }
         return TRUE;
       }
diff --git a/gegl/operation/gegl-operation-point-render.c b/gegl/operation/gegl-operation-point-render.c
index 1be7d43df..7c40508ac 100644
--- a/gegl/operation/gegl-operation-point-render.c
+++ b/gegl/operation/gegl-operation-point-render.c
@@ -21,6 +21,7 @@
 
 #include <glib-object.h>
 
+#define GEGL_ITERATOR2_API
 #include "gegl.h"
 #include "gegl-operation-point-render.h"
 #include "gegl-operation-context.h"
@@ -100,10 +101,10 @@ gegl_operation_point_render_process (GeglOperation       *operation,
   if ((result->width > 0) && (result->height > 0))
     {
       GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, level, out_format,
-                                                        GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE);
+                                                        GEGL_ACCESS_WRITE, GEGL_ABYSS_NONE, 2);
 
       while (gegl_buffer_iterator_next (i))
-          point_render_class->process (operation, i->data[0], i->length, &i->roi[0], level);
+          point_render_class->process (operation, i->items[0].data, i->length, &i->items[0].roi, level);
     }
 
   return TRUE;


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