Picasso API
2.2
|
Typedefs | |
typedef enum _ps_path_cmd | ps_path_cmd |
Path command for vertices. | |
typedef enum _ps_path_op | ps_path_operation |
Path clipping operations. | |
Enumerations | |
enum | _ps_path_cmd { PATH_CMD_STOP = 0, PATH_CMD_MOVE_TO = 1, PATH_CMD_LINE_TO = 2, PATH_CMD_CURVE3 = 3, PATH_CMD_CURVE4 = 4, PATH_CMD_END_POLY = 0x0F } |
Path command for vertices. More... | |
enum | _ps_path_op { PATH_OP_UNION, PATH_OP_INTERSECT, PATH_OP_XOR, PATH_OP_DIFF } |
Path clipping operations. More... | |
Functions | |
PEXPORT ps_path *PICAPI | ps_path_create (void) |
Create a new empty path object. | |
PEXPORT ps_path *PICAPI | ps_path_create_copy (const ps_path *path) |
Create a copy from an existing path object. | |
PEXPORT ps_path *PICAPI | ps_path_ref (ps_path *path) |
Increases the reference count of the path by 1. | |
PEXPORT void PICAPI | ps_path_unref (ps_path *path) |
Decrements the reference count for the path object. If the reference count on the path falls to 0, the path is freed. | |
PEXPORT void PICAPI | ps_path_move_to (ps_path *path, const ps_point *point) |
Begin a new sub path, and set the current point in the path. | |
PEXPORT void PICAPI | ps_path_line_to (ps_path *path, const ps_point *point) |
Add a line to the path from the current point to given point. | |
PEXPORT void PICAPI | ps_path_tangent_arc_to (ps_path *path, float radius, const ps_point *tp, const ps_point *ep) |
Add an arc to the path which tangent at two line. | |
PEXPORT void PICAPI | ps_path_arc_to (ps_path *path, float radiusX, float radiusY, float angle, ps_bool large_arc, ps_bool clockwise, const ps_point *ep) |
Add an arc to the path, using radius, angle and end point. | |
PEXPORT void PICAPI | ps_path_bezier_to (ps_path *path, const ps_point *fcp, const ps_point *scp, const ps_point *ep) |
Add a cubic bezier spline to the path from current point to end point. | |
PEXPORT void PICAPI | ps_path_quad_to (ps_path *path, const ps_point *cp, const ps_point *ep) |
Add a quadratic bezier spline to the path from current point to end point. | |
PEXPORT void PICAPI | ps_path_sub_close (ps_path *path) |
Close the sub path, and begin a new one. | |
PEXPORT float PICAPI | ps_path_get_length (const ps_path *path) |
Return The length of the path. | |
PEXPORT void PICAPI | ps_path_clear (ps_path *path) |
Clear the path to empty. | |
PEXPORT ps_bool PICAPI | ps_path_is_empty (const ps_path *path) |
Checks whether the path is empty. | |
PEXPORT unsigned int PICAPI | ps_path_get_vertex_count (const ps_path *path) |
Return the count of vertices in the path. | |
PEXPORT ps_path_cmd PICAPI | ps_path_get_vertex (const ps_path *path, unsigned int index, ps_point *point) |
Get a vertex from the path by index, and return the vertex command. | |
PEXPORT ps_bool PICAPI | ps_path_bounding_rect (const ps_path *path, ps_rect *rect) |
Get the bounding rectangle of the path. | |
PEXPORT ps_bool PICAPI | ps_path_contains (const ps_path *path, const ps_point *point, ps_fill_rule rule) |
Check whether a point is contained in the path by fill method. | |
PEXPORT ps_bool PICAPI | ps_path_stroke_contains (const ps_path *path, const ps_point *point, float width) |
Check whether a point is contained in the path by stroke method. | |
PEXPORT void PICAPI | ps_path_add_line (ps_path *path, const ps_point *p1, const ps_point *p2) |
Add a line to the path. | |
PEXPORT void PICAPI | ps_path_add_arc (ps_path *path, const ps_point *cp, float radius, float sangle, float eangle, ps_bool clockwise) |
Add a arc to the path. | |
PEXPORT void PICAPI | ps_path_add_rect (ps_path *path, const ps_rect *rect) |
Add a rectangle to the path. | |
PEXPORT void PICAPI | ps_path_add_ellipse (ps_path *path, const ps_rect *rect) |
Add an ellipse to the path. | |
PEXPORT void PICAPI | ps_path_add_rounded_rect (ps_path *path, const ps_rect *rect, float ltx, float lty, float rtx, float rty, float lbx, float lby, float rbx, float rby) |
Add a rounded rectangle to the path. | |
PEXPORT void PICAPI | ps_path_add_sub_path (ps_path *path, const ps_path *spath) |
Add an sub path to the path. | |
PEXPORT void PICAPI | ps_path_clipping (ps_path *result, ps_path_operation op, const ps_path *a, const ps_path *b) |
Clipping two path with the operation and get the result path. |
enum _ps_path_cmd |
enum _ps_path_op |
void ps_path_add_arc | ( | ps_path * | path, |
const ps_point * | cp, | ||
float | radius, | ||
float | sangle, | ||
float | eangle, | ||
ps_bool | clockwise | ||
) |
Add a arc to the path.
path | Pointer to an existing path object. |
cp | The center point of the arc. |
radius | The radius of the arc. |
sangle | The start angle, in radians. |
eangle | The end angle, in radians. |
clockwise | True is clockwise, False is counter clockwise. |
void ps_path_add_ellipse | ( | ps_path * | path, |
const ps_rect * | rect | ||
) |
Add an ellipse to the path.
path | Pointer to an existing path object. |
rect | The rectangle to enclose the ellipse. |
void ps_path_add_line | ( | ps_path * | path, |
const ps_point * | p1, | ||
const ps_point * | p2 | ||
) |
Add a line to the path.
path | Pointer to an existing path object. |
p1 | The start point for the line. |
p2 | The end point for the line. |
void ps_path_add_rect | ( | ps_path * | path, |
const ps_rect * | rect | ||
) |
Add a rectangle to the path.
path | Pointer to an existing path object. |
rect | The rectangle to be added. |
void ps_path_add_rounded_rect | ( | ps_path * | path, |
const ps_rect * | rect, | ||
float | ltx, | ||
float | lty, | ||
float | rtx, | ||
float | rty, | ||
float | lbx, | ||
float | lby, | ||
float | rbx, | ||
float | rby | ||
) |
Add a rounded rectangle to the path.
path | Pointer to an existing path object. |
rect | The rectangle which will be added. |
ltx | The left top horizontal radius. |
lty | The left top vertical radius. |
rtx | The right top horizontal radius. |
rty | The right top vertical radius. |
lbx | The left bottom horizontal radius. |
lby | The left bottom vertical radius. |
rbx | The right bottom horizontal radius. |
rby | The right bottom vertical radius. |
void ps_path_add_sub_path | ( | ps_path * | path, |
const ps_path * | spath | ||
) |
Add an sub path to the path.
path | Pointer to an existing path object. |
spath | The path will be added. |
void ps_path_arc_to | ( | ps_path * | path, |
float | radiusX, | ||
float | radiusY, | ||
float | angle, | ||
ps_bool | large_arc, | ||
ps_bool | clockwise, | ||
const ps_point * | ep | ||
) |
Add an arc to the path, using radius, angle and end point.
path | Pointer to an existing path object. |
radiusX | The horizontal radius of arc. |
radiusY | The vertical radius of arc. |
angle | The angle of arc, in radians. |
large_arc | True is large arc, False is small arc. |
clockwise | True is clockwise, False is counter clockwise. |
ep | The end point of the arc. |
void ps_path_bezier_to | ( | ps_path * | path, |
const ps_point * | fcp, | ||
const ps_point * | scp, | ||
const ps_point * | ep | ||
) |
Add a cubic bezier spline to the path from current point to end point.
path | Pointer to an existing path object. |
fcp | The first control point of the curve. |
scp | The second control point of the curve. |
ep | The end point of the curve. |
ps_bool ps_path_bounding_rect | ( | const ps_path * | path, |
ps_rect * | rect | ||
) |
Get the bounding rectangle of the path.
path | Pointer to an existing path object. |
rect | Pointer to a buffer to receiving the rect. |
void ps_path_clear | ( | ps_path * | path | ) |
Clear the path to empty.
path | Pointer to an existing path object. |
void ps_path_clipping | ( | ps_path * | result, |
ps_path_operation | op, | ||
const ps_path * | a, | ||
const ps_path * | b | ||
) |
Clipping two path with the operation and get the result path.
result | Pointer to an existing path object for result. |
op | The specified operation for clipping. |
a | The source path for clipping. |
b | The path which will be clipping. |
ps_bool ps_path_contains | ( | const ps_path * | path, |
const ps_point * | point, | ||
ps_fill_rule | rule | ||
) |
Check whether a point is contained in the path by fill method.
path | Pointer to an existing path object. |
point | The point to be checked. |
rule | The filling rule for the path. |
ps_path * ps_path_create | ( | void | ) |
Create a new empty path object.
ps_path * ps_path_create_copy | ( | const ps_path * | path | ) |
Create a copy from an existing path object.
path | Pointer to an existing path object. |
float ps_path_get_length | ( | const ps_path * | path | ) |
Return The length of the path.
path | Pointer to an existing path object. |
ps_path_cmd ps_path_get_vertex | ( | const ps_path * | path, |
unsigned int | index, | ||
ps_point * | point | ||
) |
Get a vertex from the path by index, and return the vertex command.
path | Pointer to an existing path object. |
index | The index of the vertex. |
point | Pointer to a structure to receiving the vertex. |
unsigned int ps_path_get_vertex_count | ( | const ps_path * | path | ) |
Return the count of vertices in the path.
path | Pointer to an existing path object. |
ps_bool ps_path_is_empty | ( | const ps_path * | path | ) |
Checks whether the path is empty.
path | Pointer to an existing path object. |
void ps_path_line_to | ( | ps_path * | path, |
const ps_point * | point | ||
) |
Add a line to the path from the current point to given point.
path | Pointer to an existing path object. |
point | The point which will be set. |
void ps_path_move_to | ( | ps_path * | path, |
const ps_point * | point | ||
) |
Begin a new sub path, and set the current point in the path.
path | Pointer to an existing path object. |
point | The point which will be set. |
void ps_path_quad_to | ( | ps_path * | path, |
const ps_point * | cp, | ||
const ps_point * | ep | ||
) |
Add a quadratic bezier spline to the path from current point to end point.
path | Pointer to an existing path object. |
cp | The control point of the curve. |
ep | The end point of the curve. |
ps_path * ps_path_ref | ( | ps_path * | path | ) |
Increases the reference count of the path by 1.
path | Pointer to an existing path object. |
ps_bool ps_path_stroke_contains | ( | const ps_path * | path, |
const ps_point * | point, | ||
float | width | ||
) |
Check whether a point is contained in the path by stroke method.
path | Pointer to an existing path object. |
point | The point to be checked. |
width | The line width to use, in pixels, must be greater than 0. |
void ps_path_sub_close | ( | ps_path * | path | ) |
Close the sub path, and begin a new one.
path | Pointer to an existing path object. |
void ps_path_tangent_arc_to | ( | ps_path * | path, |
float | radius, | ||
const ps_point * | tp, | ||
const ps_point * | ep | ||
) |
Add an arc to the path which tangent at two line.
path | Pointer to an existing path object. |
radius | The radius of the arc. |
tp | The point which the first tangent line from current point to. |
ep | The point which the second tangent line from tp to. |
void ps_path_unref | ( | ps_path * | path | ) |
Decrements the reference count for the path object. If the reference count on the path falls to 0, the path is freed.
path | Pointer to an existing path object. |