1
#include "clutter-perl-private.h"
3
MODULE = Clutter::Cogl::Path PACKAGE = Clutter::Cogl::Path PREFIX = cogl_path_
5
=for object Clutter::Cogl::Path - Path primitives for Cogl
8
=for position DESCRIPTION
12
There are three levels on which drawing with Clutter::Cogl can be used.
13
The highest level functions construct various simple primitive shapes
14
to be either filled or stroked. Using a lower-level set of functions
15
more complex and arbitrary paths can be constructed by concatenating
16
straight line, bezier curve and arc segments. Additionally there
17
are utility functions that draw the most common primitives - rectangles
18
and trapezoids - in a maximaly optimized fashion.
20
When constructing arbitrary paths, the current pen location is
21
initialized using the C< move_to > command. The subsequent path segments
22
implicitly use the last pen location as their first vertex and move
23
the pen location to the last vertex they produce at the end. Also
24
there are special versions of functions that allow specifying the
25
vertices of the path segments relative to the last pen location
26
rather then in the absolute coordinates.
31
Fills the constructed shape using the current drawing color
34
cogl_path_fill (class=NULL)
39
Fills the constructed shape using the current drawing color and
40
preserves the path to be used again.
43
cogl_path_fill_preserve (class=NULL)
48
Strokes the constructed shape using the current drawing color
49
and a width of 1 pixel (regardless of the current transformation
53
cogl_path_stroke (class=NULL)
58
Strokes the constructed shape using the current drawing color and
59
preserves the path to be used again.
62
cogl_path_stroke_preserve (class=NULL)
67
Clears the current path and starts a new one.
70
cogl_path_clear (class=NULL)
75
Clears the previously constructed shape and begins a new path
76
contour by moving the pen to the given coordinates
79
cogl_path_move_to (class=NULL, float x, float y)
84
Clears the previously constructed shape and begins a new path
85
contour by moving the pen to the given coordinates relative
86
to the current pen location
89
cogl_path_rel_move_to (class=NULL, float x, float y)
94
Adds a straight line segment to the current path that ends at the
98
cogl_path_line_to (class=NULL, float x, float y)
103
Adds a straight line segment to the current path that ends at the
104
given coordinates relative to the current pen location
107
cogl_path_rel_line_to (class=NULL, float x, float y)
112
Adds an elliptical arc segment to the current path. A straight line
113
segment will link the current pen location with the first vertex
114
of the arc. If you perform a I<move_to> to the arc start just before
115
drawing it you create a free standing arc.
118
cogl_path_arc (class=NULL, center_x, center_y, radius_x, radius_y, angle_start, angle_end)
126
center_x, center_y, radius_x, radius_y, angle_start, angle_end
129
Adds a cubic bezier curve segment to the current path with the given
130
second, third and fourth control points and using current pen location
131
as the first control point.
134
cogl_path_curve_to (class=NULL, x1, y1, x2, y2, x3, y3)
142
x1, y1, x2, y2, x3, y3
145
Adds a cubic bezier curve segment to the current path with the given
146
second, third and fourth control points and using current pen location
147
as the first control point. The given coordinates are relative to the
151
cogl_path_rel_curve_to (class=NULL, x1, y1, x2, y2, x3, y3)
159
x1, y1, x2, y2, x3, y3
162
Closes the path being constructed by adding a straight line segment
163
to it that ends at the first vertex of the path
166
cogl_path_close (class=NULL)
171
Clears the previously constructed shape and constructs a straight
172
line shape start and ending at the given coordinates
175
cogl_path_line (class=NULL, float x1, float y1, float x2, float y2)
180
##Clears the previously constructed shape and constructs a series of straight
181
##line segments, starting from the first given vertex coordinate. Each
182
##subsequent segment stars where the previous one ended and ends at the next
183
##given vertex coordinate.
185
##I<coords> is a reference to an array containing the X and Y coordinates of
188
##C<scalar @coords - 1> lines will be constructed.
191
##cogl_path_polyline (class=NULL, SV *coords)
194
##Clears the previously constructed shape and constructs a polygonal
195
##shape of the given number of vertices.
197
##I<coords> is a reference to an array containing the X and Y coordinates of
200
##C<scalar @coords> lines will be constructed.
203
##cogl_path_polygon (class=NULL, SV *coords)
206
Clears the previously constructed shape and constructs a rectangular
207
shape at the given coordinates
210
cogl_path_rectangle (class=NULL, float x1, float y1, float x2, float y2)
215
Clears the previously constructed shape and constructs an ellipse shape
218
cogl_path_ellipse (class=NULL, float center_x, float center_y, float radius_x, float radius_y)
220
center_x, center_y, radius_x, radius_y
223
Clears the previously constructed shape and constructs a rectangular
224
shape with rounded corners
227
cogl_path_round_rectangle (class=NULL, x1, y1, x2, y2, radius, arc_step)
235
x1, y1, x2, y2, radius, arc_step