[gegl] buffer: add abyss policy to iterator
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] buffer: add abyss policy to iterator
- Date: Mon, 26 Mar 2012 17:30:48 +0000 (UTC)
commit 87f6b30fa705646f4897a00741c9455ea58f150b
Author: Ãyvind KolÃs <pippin gimp org>
Date: Mon Mar 26 18:03:21 2012 +0100
buffer: add abyss policy to iterator
gegl/buffer/gegl-buffer-access.c | 12 ++++++++----
gegl/buffer/gegl-buffer-iterator.c | 18 ++++++++++--------
gegl/buffer/gegl-buffer-iterator.h | 7 ++++---
gegl/operation/gegl-operation-point-composer.c | 6 +++---
gegl/operation/gegl-operation-point-composer3.c | 10 +++++-----
gegl/operation/gegl-operation-point-filter.c | 4 ++--
gegl/operation/gegl-operation-point-render.c | 2 +-
operations/affine/affine.c | 2 +-
operations/common/map-absolute.c | 6 +++---
operations/common/map-relative.c | 6 +++---
operations/workshop/warp.c | 4 ++--
11 files changed, 42 insertions(+), 35 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 5a0cb67..6651159 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -1172,8 +1172,10 @@ gegl_buffer_copy (GeglBuffer *src,
dest_rect_r.width = src_rect->width;
dest_rect_r.height = src_rect->height;
- i = gegl_buffer_iterator_new (dst, &dest_rect_r, 0, dst->soft_format, GEGL_BUFFER_WRITE);
- read = gegl_buffer_iterator_add (i, src, src_rect, 0, src->soft_format, GEGL_BUFFER_READ);
+ i = gegl_buffer_iterator_new (dst, &dest_rect_r, 0, dst->soft_format,
+ GEGL_BUFFER_WRITE, GEGL_ABYSS_NONE);
+ read = gegl_buffer_iterator_add (i, src, src_rect, 0, src->soft_format,
+ GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (i))
babl_process (fish, i->data[read], i->data[0], i->length);
}
@@ -1204,7 +1206,8 @@ gegl_buffer_clear (GeglBuffer *dst,
/* FIXME: this can be even further optimized by special casing it so
* that fully voided tiles are dropped.
*/
- i = gegl_buffer_iterator_new (dst, dst_rect, 0, dst->soft_format, GEGL_BUFFER_WRITE);
+ i = gegl_buffer_iterator_new (dst, dst_rect, 0, dst->soft_format,
+ GEGL_BUFFER_WRITE, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (i))
{
memset (((guchar*)(i->data[0])), 0, i->length * pxsize);
@@ -1279,7 +1282,8 @@ void gegl_buffer_set_color (GeglBuffer *dst,
/* FIXME: this can be even further optimized by special casing it so
* that fully filled tiles are shared.
*/
- i = gegl_buffer_iterator_new (dst, dst_rect, 0, dst->soft_format, GEGL_BUFFER_WRITE);
+ i = gegl_buffer_iterator_new (dst, dst_rect, 0, dst->soft_format,
+ GEGL_BUFFER_WRITE, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (i))
{
int j;
diff --git a/gegl/buffer/gegl-buffer-iterator.c b/gegl/buffer/gegl-buffer-iterator.c
index 9d26657..71285c8 100644
--- a/gegl/buffer/gegl-buffer-iterator.c
+++ b/gegl/buffer/gegl-buffer-iterator.c
@@ -248,14 +248,14 @@ static glong in_direct_write = 0;
#endif
-
gint
gegl_buffer_iterator_add (GeglBufferIterator *iterator,
GeglBuffer *buffer,
const GeglRectangle *roi,
gint level,
const Babl *format,
- guint flags)
+ guint flags,
+ GeglAbyssPolicy abyss_policy)
{
GeglBufferIterators *i = (gpointer)iterator;
gint self = 0;
@@ -555,17 +555,19 @@ gegl_buffer_iterator_next (GeglBufferIterator *iterator)
return result;
}
-GeglBufferIterator *gegl_buffer_iterator_new (GeglBuffer *buffer,
- const GeglRectangle *roi,
- gint level,
- const Babl *format,
- guint flags)
+GeglBufferIterator *
+gegl_buffer_iterator_new (GeglBuffer *buffer,
+ const GeglRectangle *roi,
+ gint level,
+ const Babl *format,
+ guint flags,
+ GeglAbyssPolicy abyss_policy)
{
GeglBufferIterator *i = (gpointer)g_slice_new0 (GeglBufferIterators);
/* Because the iterator is nulled above, we can forgo explicitly setting
* i->is_finished to FALSE. */
i->level = level;
- gegl_buffer_iterator_add (i, buffer, roi, level, format, flags);
+ gegl_buffer_iterator_add (i, buffer, roi, level, format, flags, abyss_policy);
return i;
}
diff --git a/gegl/buffer/gegl-buffer-iterator.h b/gegl/buffer/gegl-buffer-iterator.h
index 6dd2408..54ebef1 100644
--- a/gegl/buffer/gegl-buffer-iterator.h
+++ b/gegl/buffer/gegl-buffer-iterator.h
@@ -58,7 +58,8 @@ GeglBufferIterator * gegl_buffer_iterator_new (GeglBuffer *buffer,
const GeglRectangle *roi,
gint level,
const Babl *format,
- guint flags);
+ guint flags,
+ GeglAbyssPolicy abyss_policy);
/**
@@ -82,8 +83,8 @@ gint gegl_buffer_iterator_add (GeglBufferIterator *iterator,
const GeglRectangle *roi,
gint level,
const Babl *format,
- guint flags);
-
+ guint flags,
+ GeglAbyssPolicy abyss_policy);
/**
* gegl_buffer_iterator_stop:
diff --git a/gegl/operation/gegl-operation-point-composer.c b/gegl/operation/gegl-operation-point-composer.c
index b5a8276..16d2711 100644
--- a/gegl/operation/gegl-operation-point-composer.c
+++ b/gegl/operation/gegl-operation-point-composer.c
@@ -233,15 +233,15 @@ gegl_operation_point_composer_process (GeglOperation *operation,
}
{
- GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, level, out_format, GEGL_BUFFER_WRITE);
- gint read = /*output == input ? 0 :*/ gegl_buffer_iterator_add (i, input, result, level, in_format, GEGL_BUFFER_READ);
+ GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, level, out_format, GEGL_BUFFER_WRITE, GEGL_ABYSS_NONE);
+ gint read = /*output == input ? 0 :*/ gegl_buffer_iterator_add (i, input, result, level, in_format, GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
/* using separate read and write iterators for in-place ideally a single
* readwrite indice would be sufficient
*/
if (aux)
{
- gint foo = gegl_buffer_iterator_add (i, aux, result, level, aux_format, GEGL_BUFFER_READ);
+ gint foo = gegl_buffer_iterator_add (i, aux, result, level, aux_format, GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (i))
{
diff --git a/gegl/operation/gegl-operation-point-composer3.c b/gegl/operation/gegl-operation-point-composer3.c
index 173a58f..4f66587 100644
--- a/gegl/operation/gegl-operation-point-composer3.c
+++ b/gegl/operation/gegl-operation-point-composer3.c
@@ -160,15 +160,15 @@ gegl_operation_point_composer3_process (GeglOperation *operation,
if ((result->width > 0) && (result->height > 0))
{
- GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, level, out_format, GEGL_BUFFER_WRITE);
- gint read = gegl_buffer_iterator_add (i, input, result, level, in_format, GEGL_BUFFER_READ);
+ GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, level, out_format, GEGL_BUFFER_WRITE, GEGL_ABYSS_NONE);
+ gint read = gegl_buffer_iterator_add (i, input, result, level, in_format, GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
if (aux)
{
- gint foo = gegl_buffer_iterator_add (i, aux, result, level, aux_format, GEGL_BUFFER_READ);
+ gint foo = gegl_buffer_iterator_add (i, aux, result, level, aux_format, GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
if (aux2)
{
- gint bar = gegl_buffer_iterator_add (i, aux2, result, level, aux2_format, GEGL_BUFFER_READ);
+ gint bar = gegl_buffer_iterator_add (i, aux2, result, level, aux2_format, GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (i))
{
@@ -187,7 +187,7 @@ gegl_operation_point_composer3_process (GeglOperation *operation,
{
if (aux2)
{
- gint bar = gegl_buffer_iterator_add (i, aux2, result, level, aux2_format, GEGL_BUFFER_READ);
+ gint bar = gegl_buffer_iterator_add (i, aux2, result, level, aux2_format, GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (i))
{
point_composer3_class->process (operation, i->data[read], NULL, i->data[bar], i->data[0], i->length, &(i->roi[0]), level);
diff --git a/gegl/operation/gegl-operation-point-filter.c b/gegl/operation/gegl-operation-point-filter.c
index 5eb22bb..9fc117f 100644
--- a/gegl/operation/gegl-operation-point-filter.c
+++ b/gegl/operation/gegl-operation-point-filter.c
@@ -152,8 +152,8 @@ gegl_operation_point_filter_process (GeglOperation *operation,
}
{
- GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, level, out_format, GEGL_BUFFER_WRITE);
- gint read = /*output == input ? 0 :*/ gegl_buffer_iterator_add (i, input, result, level, in_format, GEGL_BUFFER_READ);
+ GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, level, out_format, GEGL_BUFFER_WRITE, GEGL_ABYSS_NONE);
+ gint read = /*output == input ? 0 :*/ gegl_buffer_iterator_add (i, input, result, level, in_format, GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
/* using separate read and write iterators for in-place ideally a single
* readwrite indice would be sufficient
*/
diff --git a/gegl/operation/gegl-operation-point-render.c b/gegl/operation/gegl-operation-point-render.c
index e794530..5ba595b 100644
--- a/gegl/operation/gegl-operation-point-render.c
+++ b/gegl/operation/gegl-operation-point-render.c
@@ -97,7 +97,7 @@ 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_BUFFER_WRITE);
+ GeglBufferIterator *i = gegl_buffer_iterator_new (output, result, level, out_format, GEGL_BUFFER_WRITE, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (i))
point_render_class->process (operation, i->data[0], i->length, &i->roi[0], level);
diff --git a/operations/affine/affine.c b/operations/affine/affine.c
index 88fab60..ba7465a 100644
--- a/operations/affine/affine.c
+++ b/operations/affine/affine.c
@@ -673,7 +673,7 @@ affine_generic (GeglBuffer *dest,
dest_extent = gegl_buffer_get_extent (dest);
- i = gegl_buffer_iterator_new (dest, dest_extent, level, format, GEGL_BUFFER_WRITE);
+ i = gegl_buffer_iterator_new (dest, dest_extent, level, format, GEGL_BUFFER_WRITE, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (i))
{
GeglRectangle *roi = &i->roi[0];
diff --git a/operations/common/map-absolute.c b/operations/common/map-absolute.c
index a9e9042..68cac1a 100644
--- a/operations/common/map-absolute.c
+++ b/operations/common/map-absolute.c
@@ -73,11 +73,11 @@ process (GeglOperation *operation,
if (aux != NULL)
{
- it = gegl_buffer_iterator_new (output, result, level, format_io, GEGL_BUFFER_WRITE);
+ it = gegl_buffer_iterator_new (output, result, level, format_io, GEGL_BUFFER_WRITE, GEGL_ABYSS_NONE);
index_out = 0;
- index_coords = gegl_buffer_iterator_add (it, aux, result, level, format_coords, GEGL_BUFFER_READ);
- index_in = gegl_buffer_iterator_add (it, input, result, level, format_io, GEGL_BUFFER_READ);
+ index_coords = gegl_buffer_iterator_add (it, aux, result, level, format_coords, GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
+ index_in = gegl_buffer_iterator_add (it, input, result, level, format_io, GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (it))
{
diff --git a/operations/common/map-relative.c b/operations/common/map-relative.c
index 1adb105..0fadda1 100644
--- a/operations/common/map-relative.c
+++ b/operations/common/map-relative.c
@@ -77,11 +77,11 @@ process (GeglOperation *operation,
if (aux != NULL)
{
- it = gegl_buffer_iterator_new (output, result, level, format_io, GEGL_BUFFER_WRITE);
+ it = gegl_buffer_iterator_new (output, result, level, format_io, GEGL_BUFFER_WRITE, GEGL_ABYSS_NONE);
index_out = 0;
- index_coords = gegl_buffer_iterator_add (it, aux, result, level, format_coords, GEGL_BUFFER_READ);
- index_in = gegl_buffer_iterator_add (it, input, result, level, format_io, GEGL_BUFFER_READ);
+ index_coords = gegl_buffer_iterator_add (it, aux, result, level, format_coords, GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
+ index_in = gegl_buffer_iterator_add (it, input, result, level, format_io, GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (it))
{
diff --git a/operations/workshop/warp.c b/operations/workshop/warp.c
index be20020..b150e58 100644
--- a/operations/workshop/warp.c
+++ b/operations/workshop/warp.c
@@ -218,7 +218,7 @@ stamp (GeglChantO *o,
{
gint pixel_count = 0;
- it = gegl_buffer_iterator_new (priv->buffer, &area, 0, format, GEGL_BUFFER_READ);
+ it = gegl_buffer_iterator_new (priv->buffer, &area, 0, format, GEGL_BUFFER_READ, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (it))
{
@@ -237,7 +237,7 @@ stamp (GeglChantO *o,
y_mean /= pixel_count;
}
- it = gegl_buffer_iterator_new (priv->buffer, &area, 0, format, GEGL_BUFFER_READWRITE);
+ it = gegl_buffer_iterator_new (priv->buffer, &area, 0, format, GEGL_BUFFER_READWRITE, GEGL_ABYSS_NONE);
while (gegl_buffer_iterator_next (it))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]