[gegl] gegl-tester: improve default composition
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl-tester: improve default composition
- Date: Fri, 23 May 2014 11:58:38 +0000 (UTC)
commit 2820f8057671626ed8dd40b423257181a2114302
Author: Øyvind Kolås <pippin gimp org>
Date: Fri May 23 04:33:54 2014 +0200
gegl-tester: improve default composition
Make it easier to see results of composer operations by adding a transparency
gradient on the left side of standard-input.png, and compositing the result of
the operation on top of a checkerboard.
bin/gegl-tester.c | 26 +++++++++++++++++++++++---
docs/images/standard-input.png | Bin 86445 -> 107385 bytes
2 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/bin/gegl-tester.c b/bin/gegl-tester.c
index 6d4387e..201e6d9 100644
--- a/bin/gegl-tester.c
+++ b/bin/gegl-tester.c
@@ -167,7 +167,8 @@ test_operation (const gchar *op_name,
static void
standard_output (const gchar *op_name)
{
- GeglNode *composition, *input, *aux, *operation, *crop, *output;
+ GeglNode *composition, *input, *aux, *operation, *crop, *output, *translate;
+ GeglNode *background, *over;
gchar *input_path = g_build_path (G_DIR_SEPARATOR_S, data_dir,
"standard-input.png", NULL);
gchar *aux_path = g_build_path (G_DIR_SEPARATOR_S, data_dir,
@@ -183,6 +184,11 @@ standard_output (const gchar *op_name)
"operation", "gegl:load",
"path", input_path,
NULL);
+ translate = gegl_node_new_child (composition,
+ "operation", "gegl:translate",
+ "x", 0.0,
+ "y", 80.0,
+ NULL);
aux = gegl_node_new_child (composition,
"operation", "gegl:load",
"path", aux_path,
@@ -197,14 +203,28 @@ standard_output (const gchar *op_name)
"compression", 9,
"path", output_path,
NULL);
+ background = gegl_node_new_child (composition,
+ "operation", "gegl:checkerboard",
+ "color1", gegl_color_new ("rgb(0.75,0.75,0.75)"),
+ "color2", gegl_color_new ("rgb(0.25,0.25,0.25)"),
+ NULL);
+ over = gegl_node_new_child (composition, "operation", "gegl:over", NULL);
- gegl_node_link_many (operation, crop, output, NULL);
if (gegl_node_has_pad (operation, "input"))
gegl_node_link (input, operation);
if (gegl_node_has_pad (operation, "aux"))
- gegl_node_connect_to (aux, "output", operation, "aux");
+ {
+ gegl_node_connect_to (aux, "output", translate, "input");
+ gegl_node_connect_to (translate, "output", operation, "aux");
+ }
+
+ gegl_node_connect_to (background, "output", over, "input");
+ gegl_node_connect_to (operation, "output", over, "aux");
+ gegl_node_connect_to (over, "output", crop, "input");
+ gegl_node_connect_to (crop, "output", output, "input");
+
gegl_node_process (output);
}
diff --git a/docs/images/standard-input.png b/docs/images/standard-input.png
index 339ccd1..9ebced7 100644
Binary files a/docs/images/standard-input.png and b/docs/images/standard-input.png differ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]