RSS/Atom feed Twitter
Site is read-only, email is disabled

Weighted Blend code example

This discussion is connected to the gegl-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

1 of 1 message available
Toggle history

Please log in to manage your subscriptions.

Weighted Blend code example saeed 06 Oct 09:12
saeed
2014-10-06 09:12:34 UTC (over 9 years ago)

Weighted Blend code example

hi,
Can someone post a code example on how to use the "gegl:weighted-blend" operations in c Code not gegl (terminal) with xml files (filters) .

I started using gegl library , it fit my needs perfectly , but i can't seem to find a good documentations (the website is good but not detailed). If it helps here is my trial of using gegl:weighted-blend :

GeglNode *gegl = gegl_node_new ();

GeglNode *display = gegl_node_create_child (gegl, "gegl:display"); GeglNode *over = gegl_node_new_child (gegl,"operation", "gegl:over",NULL);
GeglNode *c2g = gegl_node_new_child (gegl,"operation", "gegl:c2g",NULL); GeglNode *blur = gegl_node_new_child (gegl,"operation", "gegl:gaussian-blur","std- dev-x",1.0,"std-dev-y",1.0,NULL);

GeglNode *img = gegl_node_new_child (gegl,"operation", "gegl:load","path","test.jpg",NULL); GeglBuffer *buffer = NULL;
GeglNode *sink = gegl_node_new_child (gegl,"operation", "gegl:buffer-sink","buffer", &buffer,NULL); gegl_node_link_many (img , c2g , sink, NULL); gegl_node_process (sink);
GeglNode *blend = gegl_node_new_child (gegl,"operation", "gegl:weighted-blend","aux",buffer,"value",0.0,NULL);

gegl_node_link_many(img, blend, display, NULL); //gegl_node_process (blend);
//gegl_node_link_many(blend, display, NULL); gegl_node_process (display);

a bit info , in this example i have a test.jpg image , i apply a c2g filter on it , then i try to blend it with itself without the c2g filter. the c2g and gegl:buffer-sink parts work , meaning i can display the image with grayscale and the buffer is filled with the image in grayscale colors . what am i doing wrong , cause the output of this with combination of gegl:weighted-blend is a blank screen .