[Gegl-developer] Weighted Blend code example

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 .

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]