Gegl.Path¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Gegl.Path(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod add_type(type, items, description)¶
- Parameters:
Adds a new type to the path system, FIXME this should probably return something on registration conflicts, for now it expects all registered paths to be aware of each other.
- classmethod new()¶
- Return type:
Creates a new
Gegl.Path
with no nodes.Returns the newly created
Gegl.Path
- classmethod new_from_string(instructions)¶
-
Creates a new
Gegl.Path
with the nodes described in the string instructions. SeeGegl.Path.parse_string
() for details of the format of the string.Returns the newly created
Gegl.Path
- calc(pos)¶
- Parameters:
pos (
float
) – how far along the path.- Returns:
- x:
return location for x coordinate.
- y:
return location for y coordinate
- Return type:
Compute the coordinates of the path at the position (length measured from start of path, not including discontinuities).
- calc_y_for_x(x)¶
- Parameters:
x (
float
) – x coordinate to compute for- Returns:
- y:
return location for y coordinate
- Return type:
Compute a corresponding y coordinate for a given x input coordinate, returns 0 if computed correctly and -1 if the path doesn’t exist for the specified x coordinate.
- clear()¶
Remove all nods from a self.
- closest_point(x, y)¶
- Parameters:
- Returns:
- on_path_x:
return location for x coordinate on the path that was closest
- on_path_y:
return location for y coordinate on the path that was closest
- node_pos_before:
the node position interpreted before this position was deemed the closest coordinate.
- Return type:
(
float
, on_path_x:float
, on_path_y:float
, node_pos_before:int
)
Figure out what and where on a path is closest to arbitrary coordinates.
Returns the length along the path where the closest point was encountered.
- dirty()¶
Marks the path as dirty and issues an invalidation for the path rendering, use this if modifying the values of a
Gegl.PathPoint
inline.
- foreach(each_item, *user_data)¶
- Parameters:
each_item (
Gegl.NodeFunction
) – a function to call for each node in the path.user_data (
object
orNone
) – user data to pass to the function (in addition to theGegl.PathItem
).
Execute a provided function for every node in the path (useful for drawing and otherwise traversing a path.)
- foreach_flat(each_item, *user_data)¶
- Parameters:
each_item (
Gegl.NodeFunction
) – a function to call for each node in the path.
Execute a provided function for the segments of a poly line approximating the path.
- freeze()¶
Make the GeglPath stop firing signals as it changes must be paired with a
Gegl.Path.thaw
() for the signals to start again.
- get_bounds()¶
- Returns:
- min_x:
return location for minimum x coordinate
- max_x:
return location for maximum x coordinate
- min_y:
return location for minimum y coordinate
- max_y:
return location for maximum y coordinate
- Return type:
Compute the bounding box of a path.
- get_length()¶
- Returns:
the length of the path.
- Return type:
Returns the total length of the path.
- get_matrix()¶
- Returns:
a
Gegl.Matrix3
to copy the matrix into- Return type:
matrix:
Gegl.Matrix3
Get the transformation matrix of the path.
- get_n_nodes()¶
- Returns:
the number of nodes in the path.
- Return type:
Retrieves the number of nodes in the path.
- get_node(index)¶
- Parameters:
index (
int
) – the node number to retrieve- Returns:
- node:
a pointer to a
Gegl.PathItem
record to be written.
- Return type:
(
bool
, node:Gegl.PathItem
)
Retrieve the node of the path at position pos.
Returns
True
if the node was successfully retrieved.
- insert_node(pos, node)¶
- Parameters:
pos (
int
) – the position we want the new node to have.node (
Gegl.PathItem
) – pointer to a structure describing theGegl.PathItem
we want to store
Insert the new node node at position pos in self. if pos = -1, the node is added in the last position.
- is_empty()¶
- Return type:
Check if the path contains any nodes.
Returns
True
if the path has no nodes.
- parse_string(instructions)¶
- Parameters:
instructions (
str
) – a string describing a path.
Parses instructions and appends corresponding nodes to path (call gegl_path_clean() first if you want to replace the existing path.
- replace_node(pos, node)¶
- Parameters:
pos (
int
) – the position we want the new node to have.node (
Gegl.PathItem
) – pointer to a structure describing theGegl.PathItem
we want to store.
Replaces the exiting node at position pos in self.
- set_matrix(matrix)¶
- Parameters:
matrix (
Gegl.Matrix3
) – aGegl.Matrix3
to copy the matrix from
Set the transformation matrix of the path.
The path is transformed through this matrix when being evaluated, causing the calculated positions and length to be changed by the transform.
- thaw()¶
Restart firing signals (unless the path has been frozen multiple times).