Commit a3d785a4 authored by Daniel Sabo's avatar Daniel Sabo

operations: Use watch() to clean up the child nodes of meta ops

parent 37363997
......@@ -36,56 +36,37 @@ gegl_chant_double_ui (radius2, _("Radius 2"),
#include "gegl-chant.h"
typedef struct _Priv Priv;
struct _Priv
{
GeglNode *self;
GeglNode *input;
GeglNode *output;
GeglNode *multiply;
GeglNode *subtract;
GeglNode *blur1;
GeglNode *blur2;
};
static void attach (GeglOperation *operation)
{
GeglChantO *o = GEGL_CHANT_PROPERTIES (operation);
Priv *priv = g_new0 (Priv, 1);
o->chant_data = (void*) priv;
GeglNode *gegl = operation->node;
GeglNode *input, *output, *subtract, *blur1, *blur2;
if (!priv->blur1)
{
GeglNode *gegl;
gegl = operation->node;
input = gegl_node_get_input_proxy (gegl, "input");
output = gegl_node_get_output_proxy (gegl, "output");
priv->input = gegl_node_get_input_proxy (gegl, "input");
priv->output = gegl_node_get_output_proxy (gegl, "output");
subtract = gegl_node_new_child (gegl,
"operation", "gegl:subtract",
NULL);
priv->subtract = gegl_node_new_child (gegl,
"operation", "gegl:subtract",
NULL);
blur1 = gegl_node_new_child (gegl,
"operation", "gegl:gaussian-blur",
NULL);
priv->blur1 = gegl_node_new_child (gegl,
"operation", "gegl:gaussian-blur",
NULL);
blur2 = gegl_node_new_child (gegl,
"operation", "gegl:gaussian-blur",
NULL);
priv->blur2 = gegl_node_new_child (gegl,
"operation", "gegl:gaussian-blur",
NULL);
gegl_node_link_many (input, blur1, subtract, output, NULL);
gegl_node_link (input, blur2);
gegl_node_link_many (priv->input, priv->blur1, priv->subtract, priv->output, NULL);
gegl_node_link (priv->input, priv->blur2);
gegl_node_connect_from (subtract, "aux", blur2, "output");
gegl_node_connect_from (priv->subtract, "aux", priv->blur2, "output");
gegl_operation_meta_redirect (operation, "radius1", blur1, "std-dev-x");
gegl_operation_meta_redirect (operation, "radius1", blur1, "std-dev-y");
gegl_operation_meta_redirect (operation, "radius2", blur2, "std-dev-x");
gegl_operation_meta_redirect (operation, "radius2", blur2, "std-dev-y");
gegl_operation_meta_redirect (operation, "radius1", priv->blur1, "std-dev-x");
gegl_operation_meta_redirect (operation, "radius1", priv->blur1, "std-dev-y");
gegl_operation_meta_redirect (operation, "radius2", priv->blur2, "std-dev-x");
gegl_operation_meta_redirect (operation, "radius2", priv->blur2, "std-dev-y");
}
gegl_operation_meta_watch_nodes (operation, subtract, blur1, blur2, NULL);
}
static void
......
......@@ -83,6 +83,11 @@ attach (GeglOperation *operation)
gegl_operation_meta_redirect (operation, "y", translate, "y");
gegl_operation_meta_redirect (operation, "color", color, "value");
gegl_operation_meta_redirect (operation, "opacity", opacity, "value");
gegl_operation_meta_watch_nodes (operation,
over, translate, opacity,
blur, darken, color,
NULL);
}
static void
......
......@@ -56,6 +56,8 @@ attach (GeglOperation *operation)
gegl_operation_meta_redirect (operation, "std-dev", blur, "std-dev-x");
gegl_operation_meta_redirect (operation, "std-dev", blur, "std-dev-y");
gegl_operation_meta_redirect (operation, "contrast", contrast, "contrast");
gegl_operation_meta_watch_nodes (operation, invert, blur, opacity, over, contrast, NULL);
}
static void
......
......@@ -216,6 +216,14 @@ static void attach (GeglOperation *operation)
gegl_node_link_many (self->input, self->composite_op, self->output, NULL);
gegl_node_connect_from (self->composite_op, "aux", self->translate, "output");
gegl_operation_meta_watch_nodes (operation,
self->composite_op,
self->translate,
self->scale,
self->opacity,
self->load,
NULL);
do_setup (operation);
}
......
......@@ -108,6 +108,8 @@ static void attach (GeglOperation *operation)
do_setup (operation, o->path);
gegl_node_link (self->load, self->output);
gegl_operation_meta_watch_node (operation, self->load);
}
static GeglNode *
......
......@@ -53,6 +53,9 @@ static void attach (GeglOperation *operation)
color = gegl_node_new_child (gegl, "operation", "gegl:color", NULL);
crop = gegl_node_new_child (gegl, "operation", "gegl:crop", NULL);
gegl_operation_meta_watch_node (operation, color);
gegl_operation_meta_watch_node (operation, crop);
gegl_node_link_many (color, crop, output, NULL);
gegl_operation_meta_redirect (operation, "color", color, "value");
......
......@@ -60,6 +60,8 @@ attach (GeglOperation *operation)
gegl_operation_meta_redirect (operation, "scale", multiply, "value");
gegl_operation_meta_redirect (operation, "std-dev", blur, "std-dev-x");
gegl_operation_meta_redirect (operation, "std-dev", blur, "std-dev-y");
gegl_operation_meta_watch_nodes (operation, add, multiply, subtract, blur, NULL);
}
static void
......
......@@ -76,6 +76,8 @@ attach (GeglOperation *operation)
gegl_operation_meta_redirect (operation, "xoff", seamless, "xoff");
gegl_operation_meta_redirect (operation, "yoff", seamless, "yoff");
gegl_operation_meta_redirect (operation, "error-msg", seamless, "error-msg");
gegl_operation_meta_watch_nodes (operation, seamless, overlay, NULL);
}
static void
......
......@@ -87,6 +87,8 @@ attach (GeglOperation *operation)
gegl_operation_meta_redirect (operation, "abyss-policy", vblur, "abyss-policy");
gegl_operation_meta_redirect (operation, "filter", vblur, "filter");
gegl_operation_meta_redirect (operation, "clip-extent", vblur, "clip-extent");
gegl_operation_meta_watch_nodes (operation, hblur, vblur, NULL);
}
static void
......
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