[gegl] reinhard05: pass-through on infinite planes (issue #179)
- From: Thomas Manni <tmanni src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] reinhard05: pass-through on infinite planes (issue #179)
- Date: Wed, 31 Jul 2019 18:00:12 +0000 (UTC)
commit b02a196b406b6a3da62fbf70843e333a0803c156
Author: Thomas Manni <thomas manni free fr>
Date: Wed Jul 31 19:55:59 2019 +0200
reinhard05: pass-through on infinite planes (issue #179)
operations/common/reinhard05.c | 51 ++++++++++++++++++++++++++++++++----------
1 file changed, 39 insertions(+), 12 deletions(-)
---
diff --git a/operations/common/reinhard05.c b/operations/common/reinhard05.c
index 88ad84388..3d4b5fe1f 100644
--- a/operations/common/reinhard05.c
+++ b/operations/common/reinhard05.c
@@ -62,21 +62,24 @@ reinhard05_prepare (GeglOperation *operation)
}
static GeglRectangle
-reinhard05_get_required_for_output (GeglOperation *operation,
- const gchar *input_pad,
- const GeglRectangle *roi)
+reinhard05_get_cached_region (GeglOperation *operation,
+ const GeglRectangle *roi)
{
- GeglRectangle result = *gegl_operation_source_get_bounding_box (operation,
- "input");
- return result;
-}
+ const GeglRectangle *in_rect =
+ gegl_operation_source_get_bounding_box (operation, "input");
+ if (in_rect && ! gegl_rectangle_is_infinite_plane (in_rect))
+ return *in_rect;
+
+ return *roi;
+}
static GeglRectangle
-reinhard05_get_cached_region (GeglOperation *operation,
- const GeglRectangle *roi)
+reinhard05_get_required_for_output (GeglOperation *operation,
+ const gchar *input_pad,
+ const GeglRectangle *roi)
{
- return *gegl_operation_source_get_bounding_box (operation, "input");
+ return reinhard05_get_cached_region (operation, roi);
}
static void
@@ -252,9 +255,32 @@ reinhard05_process (GeglOperation *operation,
return TRUE;
}
+static gboolean
+reinhard05_operation_process (GeglOperation *operation,
+ GeglOperationContext *context,
+ const gchar *output_prop,
+ const GeglRectangle *result,
+ gint level)
+{
+ GeglOperationClass *operation_class;
+
+ const GeglRectangle *in_rect =
+ gegl_operation_source_get_bounding_box (operation, "input");
+
+ if (in_rect && gegl_rectangle_is_infinite_plane (in_rect))
+ {
+ gpointer in = gegl_operation_context_get_object (context, "input");
+ gegl_operation_context_take_object (context, "output",
+ g_object_ref (G_OBJECT (in)));
+ return TRUE;
+ }
+
+ operation_class = GEGL_OPERATION_CLASS (gegl_op_parent_class);
+
+ return operation_class->process (operation, context, output_prop, result,
+ gegl_operation_context_get_level (context));
+}
-/*
- */
static void
gegl_op_class_init (GeglOpClass *klass)
{
@@ -267,6 +293,7 @@ gegl_op_class_init (GeglOpClass *klass)
filter_class->process = reinhard05_process;
operation_class->prepare = reinhard05_prepare;
+ operation_class->process = reinhard05_operation_process;
operation_class->get_required_for_output = reinhard05_get_required_for_output;
operation_class->get_cached_region = reinhard05_get_cached_region;
operation_class->threaded = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]