[gegl/meta-json] meta-json: Can connect nodes of subgraph
- From: Jon Nordby <jonnor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl/meta-json] meta-json: Can connect nodes of subgraph
- Date: Sun, 28 Dec 2014 18:41:35 +0000 (UTC)
commit ea6b0f2698828091b54e51083a353dab65954cc4
Author: Jon Nordby <jononor gmail com>
Date: Sun Dec 28 19:40:21 2014 +0100
meta-json: Can connect nodes of subgraph
operations/core/json.c | 10 +++++++---
operations/json/dropshadow2.fbp | 2 +-
operations/json/dropshadow2.json | 3 +++
3 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/operations/core/json.c b/operations/core/json.c
index c8246b0..1dc0ca2 100644
--- a/operations/core/json.c
+++ b/operations/core/json.c
@@ -189,7 +189,6 @@ attach (GeglOperation *operation)
}
g_list_free(process_names);
-/*
// Connections
JsonArray *connections = json_object_get_array_member(root, "connections");
g_assert(connections);
@@ -198,6 +197,8 @@ attach (GeglOperation *operation)
JsonObject *tgt = json_object_get_object_member(conn, "tgt");
const gchar *tgt_proc = json_object_get_string_member(tgt, "process");
const gchar *tgt_port = json_object_get_string_member(tgt, "port");
+ GeglNode *tgt_node = g_hash_table_lookup(self->nodes, tgt_proc);
+ g_assert(tgt_node);
JsonNode *srcnode = json_object_get_member(conn, "src");
if (srcnode) {
@@ -205,8 +206,12 @@ attach (GeglOperation *operation)
JsonObject *src = json_object_get_object_member(conn, "src");
const gchar *src_proc = json_object_get_string_member(src, "process");
const gchar *src_port = json_object_get_string_member(src, "port");
+ GeglNode *src_node = g_hash_table_lookup(self->nodes, src_proc);
+
+ g_print("connecting %s,%s to %s,%s\n", src_proc, src_port, tgt_port, tgt_proc);
+ g_assert(src_node);
- gegl_node_connect_from (over, "aux", input, "output");
+ gegl_node_connect_to (src_node, src_port, tgt_node, tgt_port);
} else {
// IIP
JsonNode *datanode = json_object_get_member(conn, "data");
@@ -217,7 +222,6 @@ attach (GeglOperation *operation)
g_value_unset(&value);
}
}
-*/
// TODO: go over the exported ports and redirect them
// gegl_operation_meta_redirect (operation, "radius", blur, "std-dev-x");
diff --git a/operations/json/dropshadow2.fbp b/operations/json/dropshadow2.fbp
index b51fe67..9eef14a 100644
--- a/operations/json/dropshadow2.fbp
+++ b/operations/json/dropshadow2.fbp
@@ -11,6 +11,6 @@ OUTPORT=over.OUTPUT:OUTPUT
input(gegl/nop) OUTPUT -> INPUT darken(gegl/src_in) OUTPUT -> INPUT blur(gegl/gaussian_blur) OUTPUT -> INPUT
opacity(gegl/opacity) OUTPUT -> INPUT translate(gegl/translate) OUTPUT -> INPUT over(gegl/over)
input OUTPUT -> AUX over
-color OUTPUT -> AUX darken
+color(gegl/color) OUTPUT -> AUX darken
'rgb(0.0,0.0,0.0)' -> VALUE color
diff --git a/operations/json/dropshadow2.json b/operations/json/dropshadow2.json
index 5c09c6d..332c80f 100644
--- a/operations/json/dropshadow2.json
+++ b/operations/json/dropshadow2.json
@@ -18,6 +18,9 @@
"opacity": {
"component": "gegl/opacity"
},
+ "color": {
+ "component": "gegl/color"
+ },
"translate": {
"component": "gegl/translate"
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]