Gegl.Node¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/c |
Cache policy for this node, the property is inherited by children created from a node. |
||
r/w/c |
Do not cache the result of this operation, the property is inherited by children created from a node. (Deprecated for “cache-policy”.) |
||
r/w/c |
The associated |
||
r/w/c |
The name of the node |
||
r/w/c |
The type of associated |
||
r/w/c |
Act as a nop, passing input unmodifed through to ouput. |
||
r/w/c |
Use the OpenCL version of this operation if available, this property is inherited by children created from a node. |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
Fields¶
- Inherited:
Class Details¶
- class Gegl.Node(**kwargs)¶
- Bases:
- Abstract:
No
- classmethod new()¶
- Returns:
A new top level
Gegl.Node(which can be used as a graph). When you are done using this graph instance it should be unreferenced withGObject.Object.unref. This will also free any sub nodes created from this node.- Return type:
Create a new graph that can contain further processing nodes.
- classmethod new_from_file(path)¶
- Parameters:
path (
str) – the path to a file on the local file system to be parsed.- Returns:
a
Gegl.Nodecontaining the parsed XML as a subgraph.- Return type:
The
Gegl.Nodereturned 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.
- classmethod new_from_serialized(chaindata, path_root)¶
- classmethod new_from_xml(xmldata, path_root)¶
- Parameters:
- Returns:
a
Gegl.Nodecontaining the parsed XML as a subgraph.- Return type:
The
Gegl.Nodereturned 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.
- add_child(child)¶
-
Make the
Gegl.Nodeself, take a reference on child. This reference will be dropped when the reference count on the graph reaches zero.
- blit_buffer(buffer, roi, level, abyss_policy)¶
- Parameters:
buffer (
Gegl.BufferorNone) – theGegl.Bufferto render to.roi (
Gegl.RectangleorNone) – the rectangle to render.level (
int) – mipmap level to render (0 for all)abyss_policy (
Gegl.AbyssPolicy) –
Render a rectangular region from a node to the given buffer.
- connect(a_pad_name, b, b_pad_name)¶
- Parameters:
- Return type:
Makes a connection between the pads of two nodes, one pad should be a source pad the other a sink pad, order does not matter.
Returns
Trueif the connection was successfully made.
- connect_from(input_pad_name, source, output_pad_name)¶
- Parameters:
- Return type:
Makes a connection between the pads of two nodes.
Returns
Trueif the connection was successfully made.
- connect_to(output_pad_name, sink, input_pad_name)¶
- Parameters:
- Return type:
Makes a connection between the pads of two nodes.
Returns
Trueif the connection was successfully made.
- create_child(operation)¶
- Parameters:
operation (
str) – the type of node to create.- Returns:
a newly created node. The node will be destroyed by the parent. Calling
GObject.Object.unrefon a node will cause the node to be dropped by the parent. (You may also add additional references usingGObject.Object.ref/GObject.Object.unref, but in general relying on the parents reference counting is easiest.)- Return type:
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.
- detect(x, y)¶
- Parameters:
- Returns:
the
Gegl.Nodeproviding the data ending up at x,`y` in the output of self.- Return type:
Performs hit detection by returning the node providing data at a given coordinate pair. Currently operates only on bounding boxes and not pixel data.
- disconnect(input_pad)¶
-
Disconnects node connected to input_pad of self (if any).
Returns
Trueif a connection was broken.
- find_property(property_name)¶
- Parameters:
property_name (
str) – the name of the property to get a paramspec for.- Returns:
the
GObject.ParamSpecof property orNoneif no such property exists.- Return type:
- get_bounding_box()¶
- Returns:
pointer a
Gegl.Rectangle- Return type:
Returns the position and dimensions of a rectangle spanning the area defined by a node.
- get_children()¶
- get_consumers(output_pad)¶
- Parameters:
output_pad (
str) – the output pad we want to know who uses.- Returns:
- nodes:
optional return location for array of nodes.
- pads:
optional return location for array of pad names.
- Return type:
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
None. If they are nonNoneboth should be freed withGLib.free. The arrays areNoneterminated.Returns the number of consumers connected to this output_pad.
- get_gegl_operation()¶
- Returns:
The operation object associated with this node or
Noneif there is no op associated.- Return type:
- get_input_proxy(pad_name)¶
- Parameters:
pad_name (
str) – the name of the pad.- Returns:
Returns an input proxy for the named pad. If no input proxy exists with this name a new one will be created.
- Return type:
Proxies are used to route between nodes of a subgraph contained within a node.
- get_operation()¶
- get_output_proxy(pad_name)¶
- Parameters:
pad_name (
str) – the name of the pad.- Returns:
Returns a output proxy for the named pad. If no output proxy exists with this name a new one will be created.
- Return type:
Proxies are used to route between nodes of a subgraph contained within a node.
- get_pad_description(pad_name)¶
- get_pad_label(pad_name)¶
- get_producer(input_pad_name, output_pad_name)¶
- Parameters:
- Returns:
the node providing data or
Noneif no node is connected to the input_pad.- Return type:
- get_property(property_name)¶
- Parameters:
property_name (
str) – the name of the property to get- Returns:
pointer to a
GObject.Valuecontaining the value of the property- Return type:
- link(sink)¶
- Parameters:
sink (
Gegl.Node) – the consumer of data.
This is equivalent to
Gegl.Node.connect(source, “output”, sink, “input”);
- list_input_pads()¶
- Return type:
[
str]
If the node has any input pads this function returns a null terminated array of pad names, otherwise it returns
None. The return value can be freed withGLib.strfreev().
- list_output_pads()¶
- Return type:
[
str]
If the node has any output pads this function returns a null terminated array of pad names, otherwise it returns
None. The return value can be freed withGLib.strfreev().
- new_processor(rectangle)¶
- Parameters:
rectangle (
Gegl.Rectangle) – theGegl.Rectangleto work on orNoneto work on all available data.- Returns:
a new
Gegl.Processor.- Return type:
- process()¶
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
Gegl.Processorin a single blocking function call. If you need a non-blocking operation, then make a direct use ofGegl.Processor.work. SeeGegl.Processor.—
Gegl.Node*gegl;Gegl.Rectangleroi;Gegl.Node*png_save; unsignedstr*buffer;gegl = gegl_parse_xml (xml_data); roi =
Gegl.Node.get_bounding_box(gegl);- create png_save from the graph, the parent/child relationship
- only mean anything when it comes to memory management.
png_save = gegl_node_new_child (gegl, “operation”, “gegl:png-save”, “path”, “output.png”,
None);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.BlitFlags.DEFAULT);
- remove_child(child)¶
-
Removes a child from a
Gegl.Node. The reference previously held will be dropped so increase the reference count before removing when reparenting a child between two graphs.
- set_property(property_name, value)¶
- Parameters:
property_name (
str) – the name of the property to setvalue (
GObject.Value) – aGObject.Valuecontaining the value to be set in the property.
This is mainly included for language bindings. Using #gegl_node_set is more convenient when programming in C.
- set_time(time)¶
- Parameters:
time (
float) – the time to set the properties which have keyfraes attached to
Sets the right value in animated properties of this node and all its dependendcies to be the specified time position.
- to_xml(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.
- to_xml_full(tail, path_root)¶
- Parameters:
- Returns:
XML serialization of a graph segment.
- Return type:
Returns a freshly allocated \0 terminated string containing a XML serialization of a segment of a graph from self to tail nodes. If tail is
Nonethen this behaves just likeGegl.Node.to_xml.
Signal Details¶
- Gegl.Node.signals.computed(node, object)¶
- Signal Name:
computed- Flags:
- Parameters:
node (
Gegl.Node) – The object which received the signalobject (
Gegl.Rectangle) –
- Gegl.Node.signals.invalidated(node, object)¶
- Signal Name:
invalidated- Flags:
- Parameters:
node (
Gegl.Node) – The object which received the signalobject (
Gegl.Rectangle) –
Property Details¶
- Gegl.Node.props.cache_policy¶
- Name:
cache-policy- Type:
- Default Value:
- Flags:
Cache policy for this node, the property is inherited by children created from a node.
- Gegl.Node.props.dont_cache¶
-
Do not cache the result of this operation, the property is inherited by children created from a node. (Deprecated for “cache-policy”.)
- Gegl.Node.props.gegl_operation¶
- Name:
gegl-operation- Type:
- Default Value:
- Flags:
The associated
Gegl.Operationinstance
- Gegl.Node.props.name¶
-
The name of the node
- Gegl.Node.props.operation¶
-
The type of associated
Gegl.Operation
- Gegl.Node.props.passthrough¶
-
Act as a nop, passing input unmodifed through to ouput.