[gegl] operations: softglow is clipping the output to the input extent
- From: Téo Mazars <teom src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] operations: softglow is clipping the output to the input extent
- Date: Sun, 17 Nov 2013 12:56:07 +0000 (UTC)
commit 2d2dbf9b35edc292ad99cbd77ac2f34a797cd3fe
Author: Téo Mazars <teomazars gmail com>
Date: Sun Nov 17 13:53:08 2013 +0100
operations: softglow is clipping the output to the input extent
since it's almost a point op, pixels outside the extent are not defined.
operations/common/softglow.c | 18 ++++++++++++++++--
tests/compositions/softglow.xml | 8 --------
2 files changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/operations/common/softglow.c b/operations/common/softglow.c
index f2860bf..4f2f8aa 100644
--- a/operations/common/softglow.c
+++ b/operations/common/softglow.c
@@ -107,6 +107,19 @@ prepare (GeglOperation *operation)
babl_format ("RGBA float"));
}
+static GeglRectangle
+get_bounding_box (GeglOperation *operation)
+{
+ GeglRectangle *region;
+
+ region = gegl_operation_source_get_bounding_box (operation, "input");
+
+ if (region != NULL)
+ return *region;
+ else
+ return *GEGL_RECTANGLE (0, 0, 0, 0);
+}
+
static gboolean
process (GeglOperation *operation,
GeglBuffer *input,
@@ -241,8 +254,9 @@ gegl_chant_class_init (GeglChantClass *klass)
operation_class = GEGL_OPERATION_CLASS (klass);
filter_class = GEGL_OPERATION_FILTER_CLASS (klass);
- operation_class->prepare = prepare;
- filter_class->process = process;
+ operation_class->prepare = prepare;
+ operation_class->get_bounding_box = get_bounding_box;
+ filter_class->process = process;
gegl_operation_class_set_keys (operation_class,
"name", "gegl:softglow",
diff --git a/tests/compositions/softglow.xml b/tests/compositions/softglow.xml
index 15333de..a65d6de 100644
--- a/tests/compositions/softglow.xml
+++ b/tests/compositions/softglow.xml
@@ -1,13 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<gegl>
- <node operation='gegl:crop'>
- <params>
- <param name='x'>0</param>
- <param name='y'>0</param>
- <param name='width'>512</param>
- <param name='height'>384</param>
- </params>
- </node>
<node operation='gegl:softglow'>
<params>
<param name='glow-radius'>10.0</param>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]