Top | ![]() |
![]() |
![]() |
![]() |
GeglNode *
gegl_node_new (void
);
Create a new graph that can contain further processing nodes.
GeglNode * gegl_node_new_child (GeglNode *parent
,const gchar *first_property_name
,...
);
Creates a new processing node that performs the specified operation with a NULL terminated list of key/value pairs for initial parameter values configuring the operation. Usually the first pair should be "operation" and the type of operation to be associated. If no operation is provided the node doesn't have an initial operation and can be used to construct a subgraph with special middle-man routing nodes created with gegl_node_get_output_proxy and gegl_node_get_input_proxy.
parent |
a GeglNode |
|
first_property_name |
the first property name |
|
... |
first property value, optionally followed by more key/value pairs, terminated with NULL. |
A newly created GeglNode. The node will be destroyed by the parent. Calling g_object_unref on a node will cause the node to be dropped by the parent. (You may also add additional references using g_object_ref/g_object_unref, but in general relying on the parents reference counting is easiest.).
gboolean gegl_node_connect_from (GeglNode *sink
,const gchar *input_pad_name
,GeglNode *source
,const gchar *output_pad_name
);
Makes a connection between the pads of two nodes.
Returns TRUE if the connection was successfully made.
gboolean gegl_node_connect_to (GeglNode *source
,const gchar *output_pad_name
,GeglNode *sink
,const gchar *input_pad_name
);
Makes a connection between the pads of two nodes.
Returns TRUE if the connection was successfully made.
void gegl_node_link (GeglNode *source
,GeglNode *sink
);
Synthetic sugar for linking the "output" pad of source
to the "input"
pad of sink
.
void gegl_node_link_many (GeglNode *source
,GeglNode *first_sink
,...
);
Synthetic sugar for linking a chain of nodes with "input"->"output". The list is NULL terminated.
gboolean gegl_node_disconnect (GeglNode *node
,const gchar *input_pad
);
Disconnects node connected to input_pad
of node
(if any).
Returns TRUE if a connection was broken.
void gegl_node_set (GeglNode *node
,const gchar *first_property_name
,...
);
Set properties on a node, possible properties to be set are the properties of the currently set operations as well as <em>"name"</em> and
<em>"operation"</em>. <em>"operation"</em> changes the current operationsset for the node, <em>"name"</em> doesn't have any role internally in GEGL. --- gegl_node_set (node, "brightness", -0.2, "contrast", 2.0, NULL);
void gegl_node_set_valist (GeglNode *node
,const gchar *first_property_name
,va_list args
);
valist version of gegl_node_set
void gegl_node_get (GeglNode *node
,const gchar *first_property_name
,...
);
Gets properties of a GeglNode. --- double level; char *path;
gegl_node_get (png_save, "path", &path, NULL); gegl_node_get (threshold, "level", &level, NULL);
void gegl_node_get_valist (GeglNode *node
,const gchar *first_property_name
,va_list args
);
valist version of gegl_node_get
void gegl_node_blit (GeglNode *node
,gdouble scale
,const GeglRectangle *roi
,const Babl *format
,gpointer destination_buf
,gint rowstride
,GeglBlitFlags flags
);
Render a rectangular region from a node.
[skip]
node |
a GeglNode |
|
scale |
the scale to render at 1.0 is default, other values changes the width/height of the sampled region. |
|
roi |
the rectangle to render from the node, the coordinate system used is coordinates after scale has been applied. |
|
format |
the BablFormat desired. |
|
destination_buf |
a memory buffer large enough to contain the data, can be left as NULL when forcing a rendering of a region. |
|
rowstride |
rowstride in bytes, or GEGL_AUTO_ROWSTRIDE to compute the rowstride based on the width and bytes per pixel for the specified format. |
|
flags |
an or'ed combination of GEGL_BLIT_DEFAULT, GEGL_BLIT_CACHE and GEGL_BLIT_DIRTY. if cache is enabled, a cache will be set up for subsequent requests of image data from this node. By passing in GEGL_BLIT_DIRTY the function will return with the latest rendered results in the cache without regard to wheter the regions has been rendered or not. |
void gegl_node_blit_buffer (GeglNode *node
,GeglBuffer *buffer
,const GeglRectangle *roi
,int level
,GeglAbyssPolicy abyss_policy
);
Render a rectangular region from a node to the given buffer.
node |
a GeglNode |
|
buffer |
the GeglBuffer to render to. |
[transfer none][allow-none] |
roi |
the rectangle to render. |
[allow-none] |
level |
mipmap level to render (0 for all) |
void
gegl_node_process (GeglNode *sink_node
);
Render a composition. This can be used for instance on a node with a "png-save" operation to render all necessary data, and make it be written to file. This function wraps the usage of a GeglProcessor in a single blocking function call. If you need a non-blocking operation, then make a direct use of gegl_processor_work. See GeglProcessor.
--- GeglNode *gegl; GeglRectangle roi; GeglNode *png_save; unsigned char *buffer;
gegl = gegl_parse_xml (xml_data); roi = gegl_node_get_bounding_box (gegl);
png_save = gegl_node_new_child (gegl, "operation", "gegl:png-save", "path", "output.png", NULL);
gegl_node_link (gegl, png_save); gegl_node_process (png_save);
buffer = malloc (roi.w*roi.h*4); gegl_node_blit (gegl, 1.0, &roi, babl_format("R'G'B'A u8"), buffer, GEGL_AUTO_ROWSTRIDE, GEGL_BLIT_DEFAULT);
GeglNode * gegl_node_add_child (GeglNode *graph
,GeglNode *child
);
Make the GeglNode graph
, take a reference on child. This reference
will be dropped when the reference count on the graph reaches zero.
GeglNode * gegl_node_remove_child (GeglNode *graph
,GeglNode *child
);
Removes a child from a GeglNode. The reference previously held will be dropped so increase the reference count before removing when reparenting a child between two graphs.
GeglNode *
gegl_node_get_parent (GeglNode *node
);
Returns a GeglNode that keeps a reference on a child.
GeglNode * gegl_node_detect (GeglNode *node
,gint x
,gint y
);
Performs hit detection by returning the node providing data at a given coordinate pair. Currently operates only on bounding boxes and not pixel data.
GParamSpec * gegl_node_find_property (GeglNode *node
,const gchar *property_name
);
GeglRectangle
gegl_node_get_bounding_box (GeglNode *node
);
Returns the position and dimensions of a rectangle spanning the area defined by a node.
[skip]
GSList *
gegl_node_get_children (GeglNode *node
);
a list
of the nodes contained within a GeglNode that is a subgraph.
Use g_list_free()
on the list when done.
[element-type Gegl.Node][transfer container]
gint gegl_node_get_consumers (GeglNode *node
,const gchar *output_pad
,GeglNode ***nodes
,const gchar ***pads
);
Retrieve which pads on which nodes are connected to a named output_pad, and the number of connections. Both the location for the generated nodes array and pads array can be left as NULL. If they are non NULL both should be freed with g_free. The arrays are NULL terminated.
Returns the number of consumers connected to this output_pad.
node |
the node we are querying. |
|
output_pad |
the output pad we want to know who uses. |
|
nodes |
optional return location for array of nodes. |
[out callee-allocates][array zero-terminated=1][allow-none] |
pads |
optional return location for array of pad names. |
[out callee-allocates][array zero-terminated=1][allow-none] |
GeglNode * gegl_node_get_input_proxy (GeglNode *node
,const gchar *pad_name
);
Proxies are used to route between nodes of a subgraph contained within a node.
GeglOperation *
gegl_node_get_gegl_operation (GeglNode *node
);
GeglNode * gegl_node_get_output_proxy (GeglNode *node
,const gchar *pad_name
);
Proxies are used to route between nodes of a subgraph contained within a node.
GeglNode * gegl_node_get_producer (GeglNode *node
,const gchar *input_pad_name
,gchar **output_pad_name
);
node |
the node we are querying |
|
input_pad_name |
the input pad we want to get the producer for |
|
output_pad_name |
optional pointer to a location where we can store a freshly allocated string with the name of the output pad. |
[allow-none] |
gboolean gegl_node_has_pad (GeglNode *node
,const gchar *pad_name
);
Returns TRUE if the node has a pad with the specified name
gchar **
gegl_node_list_input_pads (GeglNode *node
);
If the node has any input pads this function returns a null terminated
array of pad names, otherwise it returns NULL. The return value can be
freed with g_strfreev()
.
gchar **
gegl_node_list_output_pads (GeglNode *node
);
If the node has any output pads this function returns a null terminated
array of pad names, otherwise it returns NULL. The return value can be
freed with g_strfreev()
.
GeglNode * gegl_node_create_child (GeglNode *parent
,const gchar *operation
);
Creates a new processing node that performs the specified operation. All properties of the operation will have their default values. This is included as an addition to gegl_node_new_child in the public API to have a non varargs entry point for bindings as well as sometimes simpler more readable code.
void gegl_node_get_property (GeglNode *node
,const gchar *property_name
,GValue *value
);
This is mainly included for language bindings. Using gegl_node_get is more convenient when programming in C.
[skip]
node |
the node to get a property from |
|
property_name |
the name of the property to get |
|
value |
pointer to a GValue where the value of the property should be stored. |
[out] |
void gegl_node_set_property (GeglNode *object
,const gchar *property_name
,const GValue *value
);
This is mainly included for language bindings. Using gegl_node_set is more convenient when programming in C.
node |
a GeglNode |
|
property_name |
the name of the property to set |
|
value |
a GValue containing the value to be set in the property. |
[in] |
GeglNode * gegl_node_new_from_xml (const gchar *xmldata
,const gchar *path_root
);
The GeglNode returned contains the graph described by the tree of stacks in the XML document. The tree is connected to the "output" pad of the returned node and thus can be used directly for processing.
GeglNode *
gegl_node_new_from_file (const gchar *path
);
The GeglNode returned contains the graph described by the tree of stacks in the XML document. The tree is connected to the "output" pad of the returned node and thus can be used directly for processing.
gchar * gegl_node_to_xml (GeglNode *gegl
,const gchar *path_root
);
Returns a freshly allocated \0 terminated string containing a XML serialization of the composition produced by a node (and thus also the nodes contributing data to the specified node). To export a gegl graph, connect the internal output node to an output proxy (see gegl_node_get_output_proxy.) and use the proxy node as the basis for the serialization.
gchar * gegl_node_to_xml_full (GeglNode *head
,GeglNode *tail
,const gchar *path_root
);
Returns a freshly allocated \0 terminated string containing a XML
serialization of a segment of a graph from head
to tail
nodes.
If tail
is NULL
then this behaves just like gegl_node_to_xml.
head |
a GeglNode |
|
tail |
a GeglNode. |
[allow-none] |
path_root |
filesystem path to construct relative paths from. |