[gegl] buffer: use scaled rects for creation of iterators
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] buffer: use scaled rects for creation of iterators
- Date: Fri, 10 Feb 2017 15:36:46 +0000 (UTC)
commit db11bb0fe64ab1c095ae4ba52ea1d0c28b180bee
Author: Øyvind Kolås <pippin gimp org>
Date: Thu Feb 9 20:01:33 2017 +0100
buffer: use scaled rects for creation of iterators
Also make corresponding change for point op/filter/composer etc baseclasses.
Instead of passing 1:1 level rects to gegl_buffer_iterator_new/_add , and doing
immediate scaling there. This fits better with the rest of the gegl_buffer api
use of coordinates.
Not that API compatibility would really matter since there should be no code
external to GEGL really on the levels.
gegl/buffer/gegl-buffer-iterator.c | 12 ------------
gegl/operation/gegl-operation-point-composer.c | 10 ++++++++++
gegl/operation/gegl-operation-point-composer3.c | 9 +++++++++
gegl/operation/gegl-operation-point-filter.c | 10 ++++++++++
gegl/operation/gegl-operation-point-render.c | 10 ++++++++++
5 files changed, 39 insertions(+), 12 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-iterator.c b/gegl/buffer/gegl-buffer-iterator.c
index 63be5cf..feef676 100644
--- a/gegl/buffer/gegl-buffer-iterator.c
+++ b/gegl/buffer/gegl-buffer-iterator.c
@@ -127,18 +127,6 @@ gegl_buffer_iterator_add (GeglBufferIterator *iter,
int index;
SubIterState *sub;
- //level = 0; // XXX - this disables mipmapping for iteration while it
- // is known to be broken
-
- if (level)
- {
- roi2.x = roi->x >> level;
- roi2.y = roi->y >> level;
- roi2.width = roi->width >> level;
- roi2.height = roi->height >> level;
- roi = &roi2;
- }
-
g_return_val_if_fail (priv->num_buffers < GEGL_BUFFER_MAX_ITERATORS, 0);
index = priv->num_buffers++;
diff --git a/gegl/operation/gegl-operation-point-composer.c b/gegl/operation/gegl-operation-point-composer.c
index ba5afc1..e6a86f9 100644
--- a/gegl/operation/gegl-operation-point-composer.c
+++ b/gegl/operation/gegl-operation-point-composer.c
@@ -109,6 +109,16 @@ gegl_operation_composer_process (GeglOperation *operation,
GeglBuffer *output;
gboolean success = FALSE;
+ GeglRectangle scaled_result = *result;
+ if (level)
+ {
+ scaled_result.x >>= level;
+ scaled_result.y >>= level;
+ scaled_result.width >>= level;
+ scaled_result.height >>= level;
+ result = &scaled_result;
+ }
+
if (strcmp (output_prop, "output"))
{
g_warning ("requested processing of %s pad on a composer", output_prop);
diff --git a/gegl/operation/gegl-operation-point-composer3.c b/gegl/operation/gegl-operation-point-composer3.c
index 9b2499c..705fa9b 100644
--- a/gegl/operation/gegl-operation-point-composer3.c
+++ b/gegl/operation/gegl-operation-point-composer3.c
@@ -220,6 +220,15 @@ gegl_operation_point_composer3_process (GeglOperation *operation,
const Babl *aux2_format = gegl_operation_get_format (operation, "aux2");
const Babl *out_format = gegl_operation_get_format (operation, "output");
+ GeglRectangle scaled_result = *result;
+ if (level)
+ {
+ scaled_result.x >>= level;
+ scaled_result.y >>= level;
+ scaled_result.width >>= level;
+ scaled_result.height >>= level;
+ result = &scaled_result;
+ }
if ((result->width > 0) && (result->height > 0))
{
diff --git a/gegl/operation/gegl-operation-point-filter.c b/gegl/operation/gegl-operation-point-filter.c
index 8c76aa4..18118bc 100644
--- a/gegl/operation/gegl-operation-point-filter.c
+++ b/gegl/operation/gegl-operation-point-filter.c
@@ -103,6 +103,16 @@ gegl_operation_filter_process (GeglOperation *operation,
GeglBuffer *output;
gboolean success = FALSE;
+ GeglRectangle scaled_result = *result;
+ if (level)
+ {
+ scaled_result.x >>= level;
+ scaled_result.y >>= level;
+ scaled_result.width >>= level;
+ scaled_result.height >>= level;
+ result = &scaled_result;
+ }
+
if (strcmp (output_prop, "output"))
{
g_warning ("requested processing of %s pad on a filter", output_prop);
diff --git a/gegl/operation/gegl-operation-point-render.c b/gegl/operation/gegl-operation-point-render.c
index ca94b1f..d202fea 100644
--- a/gegl/operation/gegl-operation-point-render.c
+++ b/gegl/operation/gegl-operation-point-render.c
@@ -80,6 +80,16 @@ gegl_operation_point_render_process (GeglOperation *operation,
const Babl *out_format;
GeglOperationPointRenderClass *point_render_class;
+ GeglRectangle scaled_result = *result;
+ if (level)
+ {
+ scaled_result.x >>= level;
+ scaled_result.y >>= level;
+ scaled_result.width >>= level;
+ scaled_result.height >>= level;
+ result = &scaled_result;
+ }
+
point_render_class = GEGL_OPERATION_POINT_RENDER_GET_CLASS (operation);
out_format = gegl_operation_get_format (operation, "output");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]