[gegl] Add gegl_buffer_cl_iterator_add_aux



commit d2fdda2b0d6cf736c5ce69876ca0f5a211266b45
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Sun Oct 20 20:24:15 2013 -0700

    Add gegl_buffer_cl_iterator_add_aux
    
    Use to add an aux buffer to the iterator without exposing
    the buffer, flags, or abyss parameters; which are invalid
    for aux buffers.

 gegl/buffer/gegl-buffer-cl-iterator.c |   25 +++++++++++++++++++++++--
 gegl/buffer/gegl-buffer-cl-iterator.h |    8 ++++++++
 operations/common/box-blur.c          |   17 +++++++----------
 operations/common/edge-laplace.c      |   17 +++++++----------
 operations/common/gaussian-blur.c     |   17 +++++++----------
 operations/common/noise-reduction.c   |   17 +++++++----------
 operations/common/pixelize.c          |   18 ++++++++----------
 7 files changed, 67 insertions(+), 52 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-cl-iterator.c b/gegl/buffer/gegl-buffer-cl-iterator.c
index 7af2ca6..91fa63a 100644
--- a/gegl/buffer/gegl-buffer-cl-iterator.c
+++ b/gegl/buffer/gegl-buffer-cl-iterator.c
@@ -204,12 +204,33 @@ gegl_buffer_cl_iterator_add_2 (GeglBufferClIterator  *iterator,
 gint
 gegl_buffer_cl_iterator_add (GeglBufferClIterator  *iterator,
                              GeglBuffer            *buffer,
-                             const GeglRectangle   *result,
+                             const GeglRectangle   *roi,
                              const Babl            *format,
                              guint                  flags,
                              GeglAbyssPolicy        abyss_policy)
 {
-  return gegl_buffer_cl_iterator_add_2 (iterator, buffer, result, format, flags, 0,0,0,0, abyss_policy);
+  return gegl_buffer_cl_iterator_add_2 (iterator,
+                                        buffer, roi,
+                                        format, flags,
+                                        0, 0, 0, 0,
+                                        abyss_policy);
+}
+
+gint
+gegl_buffer_cl_iterator_add_aux  (GeglBufferClIterator  *iterator,
+                                  const GeglRectangle   *roi,
+                                  const Babl            *format,
+                                  gint                   left,
+                                  gint                   right,
+                                  gint                   top,
+                                  gint                   bottom)
+{
+  return gegl_buffer_cl_iterator_add_2 (iterator,
+                                        NULL, roi,
+                                        format, GEGL_CL_BUFFER_AUX,
+                                        left, right,
+                                        top, bottom,
+                                        GEGL_ABYSS_NONE);
 }
 
 static void
diff --git a/gegl/buffer/gegl-buffer-cl-iterator.h b/gegl/buffer/gegl-buffer-cl-iterator.h
index 2129794..2c837f5 100644
--- a/gegl/buffer/gegl-buffer-cl-iterator.h
+++ b/gegl/buffer/gegl-buffer-cl-iterator.h
@@ -56,6 +56,14 @@ gint gegl_buffer_cl_iterator_add_2 (GeglBufferClIterator  *iterator,
                                     gint                   bottom,
                                     GeglAbyssPolicy        abyss_policy);
 
+gint gegl_buffer_cl_iterator_add_aux (GeglBufferClIterator  *iterator,
+                                      const GeglRectangle   *roi,
+                                      const Babl            *format,
+                                      gint                   left,
+                                      gint                   right,
+                                      gint                   top,
+                                      gint                   bottom);
+
 gboolean gegl_buffer_cl_iterator_next (GeglBufferClIterator *iterator, gboolean *err);
 
 void gegl_buffer_cl_iterator_stop (GeglBufferClIterator *iterator);
diff --git a/operations/common/box-blur.c b/operations/common/box-blur.c
index 1113194..de21183 100644
--- a/operations/common/box-blur.c
+++ b/operations/common/box-blur.c
@@ -278,16 +278,13 @@ cl_process (GeglOperation       *operation,
                                              op_area->bottom,
                                              GEGL_ABYSS_CLAMP);
 
-  gint aux  = gegl_buffer_cl_iterator_add_2 (i,
-                                             NULL,
-                                             result,
-                                             in_format,
-                                             GEGL_CL_BUFFER_AUX,
-                                             0,
-                                             0,
-                                             op_area->top,
-                                             op_area->bottom,
-                                             GEGL_ABYSS_NONE);
+  gint aux = gegl_buffer_cl_iterator_add_aux (i,
+                                              result,
+                                              in_format,
+                                              0,
+                                              0,
+                                              op_area->top,
+                                              op_area->bottom);
 
   while (gegl_buffer_cl_iterator_next (i, &err))
     {
diff --git a/operations/common/edge-laplace.c b/operations/common/edge-laplace.c
index 769da99..4eed257 100644
--- a/operations/common/edge-laplace.c
+++ b/operations/common/edge-laplace.c
@@ -362,16 +362,13 @@ cl_process (GeglOperation       *operation,
                                              op_area->bottom,
                                              GEGL_ABYSS_CLAMP);
 
-  gint aux  = gegl_buffer_cl_iterator_add_2 (i,
-                                             NULL,
-                                             result,
-                                             in_format,
-                                             GEGL_CL_BUFFER_AUX,
-                                             op_area->left   - 1,
-                                             op_area->right  - 1,
-                                             op_area->top    - 1,
-                                             op_area->bottom - 1,
-                                             GEGL_ABYSS_NONE);
+  gint aux = gegl_buffer_cl_iterator_add_aux (i,
+                                              result,
+                                              in_format,
+                                              op_area->left   - 1,
+                                              op_area->right  - 1,
+                                              op_area->top    - 1,
+                                              op_area->bottom - 1);
 
   while (gegl_buffer_cl_iterator_next (i, &err))
     {
diff --git a/operations/common/gaussian-blur.c b/operations/common/gaussian-blur.c
index c828a56..f42beec 100644
--- a/operations/common/gaussian-blur.c
+++ b/operations/common/gaussian-blur.c
@@ -580,16 +580,13 @@ cl_process (GeglOperation       *operation,
                                              op_area->bottom,
                                              GEGL_ABYSS_NONE);
 
-  gint aux  = gegl_buffer_cl_iterator_add_2 (i,
-                                             NULL,
-                                             result,
-                                             in_format,
-                                             GEGL_CL_BUFFER_AUX,
-                                             0,
-                                             0,
-                                             op_area->top,
-                                             op_area->bottom,
-                                             GEGL_ABYSS_NONE);
+  gint aux = gegl_buffer_cl_iterator_add_aux (i,
+                                              result,
+                                              in_format,
+                                              0,
+                                              0,
+                                              op_area->top,
+                                              op_area->bottom);
 
   while (gegl_buffer_cl_iterator_next (i, &err) && !err)
     {
diff --git a/operations/common/noise-reduction.c b/operations/common/noise-reduction.c
index 469507c..e12655d 100644
--- a/operations/common/noise-reduction.c
+++ b/operations/common/noise-reduction.c
@@ -277,16 +277,13 @@ cl_process (GeglOperation       *operation,
                                              op_area->bottom,
                                              GEGL_ABYSS_NONE);
 
-  gint aux  = gegl_buffer_cl_iterator_add_2 (i,
-                                             NULL,
-                                             result,
-                                             in_format,
-                                             GEGL_CL_BUFFER_AUX,
-                                             op_area->left,
-                                             op_area->right,
-                                             op_area->top,
-                                             op_area->bottom,
-                                             GEGL_ABYSS_NONE);
+  gint aux = gegl_buffer_cl_iterator_add_aux (i,
+                                              result,
+                                              in_format,
+                                              op_area->left,
+                                              op_area->right,
+                                              op_area->top,
+                                              op_area->bottom);
 
   while (gegl_buffer_cl_iterator_next (i, &err))
     {
diff --git a/operations/common/pixelize.c b/operations/common/pixelize.c
index 3766ece..23d1fa7 100644
--- a/operations/common/pixelize.c
+++ b/operations/common/pixelize.c
@@ -312,16 +312,14 @@ cl_process (GeglOperation       *operation,
                                              op_area->bottom,
                                              GEGL_ABYSS_CLAMP);
 
-  gint aux  = gegl_buffer_cl_iterator_add_2 (i,
-                                             NULL,
-                                             roi,
-                                             in_format,
-                                             GEGL_CL_BUFFER_AUX,
-                                             op_area->left,
-                                             op_area->right,
-                                             op_area->top,
-                                             op_area->bottom,
-                                             GEGL_ABYSS_NONE);
+  gint aux = gegl_buffer_cl_iterator_add_aux (i,
+                                              roi,
+                                              in_format,
+                                              op_area->left,
+                                              op_area->right,
+                                              op_area->top,
+                                              op_area->bottom);
+
 
   while (gegl_buffer_cl_iterator_next (i, &err) && !err)
     {


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