Commit d2fdda2b authored by Daniel Sabo's avatar Daniel Sabo

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.
parent 909755d7
......@@ -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
......
......@@ -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);
......
......@@ -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))
{
......
......@@ -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))
{
......
......@@ -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)
{
......
......@@ -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))
{
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment