Google
  Web www.spinics.net

Re: [Gegl-developer] Path to the GIMP

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


> 
> In libgggl it would be:
> 
> Gggl *gggl = gggl_new ();
> 
> int P, L1, L2, L3, combine1, combine2, combine3, display;
> 
> P  = gggl_node_new_filter (gggl, "blank");
> 
> L1 = gggl_node_new_filter (gggl, "drawable");
> gggl_attribute_set (gggl, L1, "imageptr", gggl_image_ptr);
> 
> L2 = gggl_node_new_filter (gggl, "drawable");
> gggl_attribute_set (gggl, L2, "imageptr", gggl_image_ptr);
> 
> L3 = gggl_node_new_filter (gggl, "drawable");
> gggl_attribute_set (gggl, L3, "imageptr", gggl_image_ptr);
> 
> combine1 = gggl_node_new_filter (gggl, "combine");
> gggl_node_set_input (gggl, combine1, 0, P, 0);  
> gggl_node_set_input (gggl, combine1, 1, L1,                0);
>          /*        node_id--' in_pad-'   `-- source_node   `--  source_pad */
> 
> combine2 = gggl_node_new_filter (gggl, "combine");
> gggl_node_set_input (gggl, combine2, 0, combine1, 0);
> gggl_node_set_input (gggl, combine2, 1, L2, 0);
> 
> combine3 = gggl_node_new_filter (gggl, "combine");
> gggl_node_set_input (gggl, combine3, 0, combine2, 0);
> gggl_node_set_input (gggl, combine3, 1, L3, 0);
> 
> display  = gggl_node_new_filter (gggl, "display");
> gggl_node_set_input (gggl, display, 0, combine3, 0);
> 
> /* this is the actual code I use at the moment,.. setting all display,
>  * save to video etc, as active
>  */
> gggl_clear_active (gggl);
> gggl_set_active (gggl, display);
> gggl_process (gggl);

Interesting. Yes. Very similar.

I like this way of thinking about the graph as
a set of connected properties or attributes of nodes, 
as it meshes well with gobject style properties. 

In fact if we want a very minimal gobject style system, we
can get rid of the "apply" call on the node altogether
and make the pull happen when someone does a regular
gobject get on an output property of a node. 

g_object_get(combine3, "dest", &dest, NULL); 

Thats it! No separate apply call even needed.

So when anyone makes a gobject_get call to an output
property on a node, it triggers the pull of data. 
Of course if everyone is up to date and not dirty
along the set of connected properties it doesnt go
anywhere and just returns the current value of the
output property. 

We need the graph editing UI like you have on 
gggl/bauxite

Perhaps we can build some autogenerated gobject 
style property editors for ops that 
we can hook up to them like you have for your
system. I know there is some versions of this in
gtk/tests and probably in glade somewhere too...
and other places probably now as well.

Also we need some attention to saving properties
of ops, and this should be similar to some of gimps 
serialization code from app/config. 

> 
> I am going to start making libgggl dependant on libgegl pretty soon,.
> and eventually libgggl will disappear from bauxite. At least that is my
> migration plan.
> 
> One thing I would really like about images, is that they are unbounded,.
> that is,. they are an infinite plane, that samples can be requested from
> and placed into,. it would of course have bounding box etc,. and it
> would need attributes about how the parameters are passed,. 

Agreed. They should be unbounded, so you can request any
regions on the image, and it still works. 

Calvin 

[Video For Linux]     [Photo]     [Yosemite News]    [Yosemite Photos]    [gtk]     [GIMP Users]     [KDE]     [Scanner]     [Gimp's Home]     [Gimp on Windows]     [Steve's Art]     [Webcams]