[gegl] Use separate iterations indices for read/write when iterating.



commit b0d8f540ca4506cc31d32483c656be39eb8b0319
Author: �yvind Kolås <pippin gimp org>
Date:   Sun Dec 6 17:11:48 2009 +0000

    Use separate iterations indices for read/write when iterating.
    
    (GeglBufferIterator doesn't support reusing the write handle for
    reading)

 gegl/operation/gegl-operation-point-composer.c |    5 ++++-
 gegl/operation/gegl-operation-point-filter.c   |    6 ++++--
 2 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gegl/operation/gegl-operation-point-composer.c b/gegl/operation/gegl-operation-point-composer.c
index 47406b6..50828a0 100644
--- a/gegl/operation/gegl-operation-point-composer.c
+++ b/gegl/operation/gegl-operation-point-composer.c
@@ -146,7 +146,10 @@ gegl_operation_point_composer_process (GeglOperation       *operation,
   if ((result->width > 0) && (result->height > 0))
     {
       GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE);
-      gint read  = input == output ? 0 : gegl_buffer_iterator_add (i, input,  result, in_format, GEGL_BUFFER_READ);
+      gint read = /*output == input ? 0 :*/ gegl_buffer_iterator_add (i, input,  result, in_format, GEGL_BUFFER_READ);
+      /* using separate read and write iterators for in-place ideally a single
+       * readwrite indice would be sufficient
+       */
 
       if (aux)
         {
diff --git a/gegl/operation/gegl-operation-point-filter.c b/gegl/operation/gegl-operation-point-filter.c
index c30adee..8af22a6 100644
--- a/gegl/operation/gegl-operation-point-filter.c
+++ b/gegl/operation/gegl-operation-point-filter.c
@@ -85,7 +85,10 @@ gegl_operation_point_filter_process (GeglOperation       *operation,
 
       {
         GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, out_format, GEGL_BUFFER_WRITE);
-        gint read  = output == input ? 0 : gegl_buffer_iterator_add (i, input,  result, in_format, GEGL_BUFFER_READ);
+        gint read = /*output == input ? 0 :*/ gegl_buffer_iterator_add (i, input,  result, in_format, GEGL_BUFFER_READ);
+        /* using separate read and write iterators for in-place ideally a single
+         * readwrite indice would be sufficient
+         */
           while (gegl_buffer_iterator_next (i))
             point_filter_class->process (operation, i->data[read], i->data[0], i->length, &i->roi[0]);
       }
@@ -115,7 +118,6 @@ gboolean gegl_can_passthrough (GeglOperation       *operation,
 }
 
 
-
 static gboolean gegl_operation_point_filter_op_process
                               (GeglOperation       *operation,
                                GeglOperationContext *context,



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