Picasso API  2.2
Functions
Geometry
Graphic Functions

Functions

PEXPORT void PICAPI ps_new_path (ps_context *ctx)
 Create a new empty path in the graphic context, clear the old one.
PEXPORT void PICAPI ps_new_sub_path (ps_context *ctx)
 Close the current path, and add a new empty sub path in the graphic context.
PEXPORT void PICAPI ps_add_sub_path (ps_context *ctx, const ps_path *path)
 Add a new sub path to current path in the graphic context.
PEXPORT void PICAPI ps_set_path (ps_context *ctx, const ps_path *path)
 Replace the current path in the graphic context.
PEXPORT ps_bool PICAPI ps_get_path (ps_context *ctx, ps_path *path)
 Get the current path in the graphic context.
PEXPORT void PICAPI ps_close_path (ps_context *ctx)
 Close the current path in the graphic context.
PEXPORT void PICAPI ps_move_to (ps_context *ctx, const ps_point *point)
 Begin a new sub path, and set the current point.
PEXPORT void PICAPI ps_line_to (ps_context *ctx, const ps_point *point)
 Add a line to the current path from the current point to given point.
PEXPORT void PICAPI ps_bezier_curve_to (ps_context *ctx, const ps_point *fcp, const ps_point *scp, const ps_point *ep)
 Add a cubic bezier spline to the current path from current point to end point.
PEXPORT void PICAPI ps_quad_curve_to (ps_context *ctx, const ps_point *cp, const ps_point *ep)
 Add a quadratic bezier spline to the current path from current point to end point.
PEXPORT void PICAPI ps_arc (ps_context *ctx, const ps_point *cp, float radius, float sangle, float eangle, ps_bool clockwise)
 Add a circular arc to the current path.
PEXPORT void PICAPI ps_tangent_arc (ps_context *ctx, const ps_rect *rect, float sangle, float sweep)
 Add a circular arc which is inner tangent from a rectangle.
PEXPORT void PICAPI ps_rectangle (ps_context *ctx, const ps_rect *rect)
 Add a rectangle to the current path.
PEXPORT void PICAPI ps_rounded_rect (ps_context *ctx, 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 current path.
PEXPORT void PICAPI ps_ellipse (ps_context *ctx, const ps_rect *rect)
 Adds an ellipse to the current path which fits inside the specified rectangle.

Function Documentation

void ps_add_sub_path ( ps_context ctx,
const ps_path path 
)

Add a new sub path to current path in the graphic context.

Parameters:
ctxPointer to an existing context object.
pathThe path will be add to graphic context.
See also:
ps_new_path, ps_new_sub_path, ps_set_path, ps_get_path, ps_close_path
void ps_arc ( ps_context ctx,
const ps_point cp,
float  radius,
float  sangle,
float  eangle,
ps_bool  clockwise 
)

Add a circular arc to the current path.

Parameters:
ctxPointer to an existing context object.
cpThe center point of the arc.
radiusThe radius of the arc.
sangleThe start angle, in radians.
eangleThe end angle, in radians.
clockwiseTrue is clockwise, False is counter clockwise.
See also:
ps_move_to, ps_line_to, ps_bezier_curve_to, ps_quad_curve_to, ps_tangent_arc, ps_rectangle, ps_rounded_rect, ps_ellipse
void ps_bezier_curve_to ( ps_context ctx,
const ps_point fcp,
const ps_point scp,
const ps_point ep 
)

Add a cubic bezier spline to the current path from current point to end point.

Parameters:
ctxPointer to an existing context object.
fcpThe first control point of the curve.
scpThe second control point of the curve.
epThe end point of the curve.
See also:
ps_move_to, ps_line_to, ps_quad_curve_to, ps_arc, ps_tangent_arc, ps_rectangle, ps_rounded_rect, ps_ellipse
void ps_close_path ( ps_context ctx)

Close the current path in the graphic context.

Parameters:
ctxPointer to an existing context object.
See also:
ps_new_path, ps_new_sub_path, ps_set_path, ps_get_path, ps_add_sub_path
void ps_ellipse ( ps_context ctx,
const ps_rect rect 
)

Adds an ellipse to the current path which fits inside the specified rectangle.

Parameters:
ctxPointer to an existing context object.
rectThe rectangle which the ellipse to fit in.
See also:
ps_move_to, ps_line_to, ps_bezier_curve_to, ps_quad_curve_to, ps_arc, ps_tangent_arc, ps_rectangle, ps_rounded_rect
ps_bool ps_get_path ( ps_context ctx,
ps_path path 
)

Get the current path in the graphic context.

Parameters:
ctxPointer to an existing context object.
pathPointer to a object to receiving the path.
Returns:
True if is success, otherwise False.
See also:
ps_new_path, ps_new_sub_path, ps_close_path, ps_set_path, ps_add_sub_path
void ps_line_to ( ps_context ctx,
const ps_point point 
)

Add a line to the current path from the current point to given point.

Parameters:
ctxPointer to an existing context object.
pointThe point which will line to.
See also:
ps_move_to, ps_bezier_curve_to, ps_quad_curve_to ps_arc, ps_tangent_arc, ps_rectangle, ps_rounded_rect, ps_ellipse
void ps_move_to ( ps_context ctx,
const ps_point point 
)

Begin a new sub path, and set the current point.

Parameters:
ctxPointer to an existing context object.
pointThe point which will be set.
See also:
ps_line_to, ps_bezier_curve_to, ps_quad_curve_to ps_arc, ps_tangent_arc, ps_rectangle, ps_rounded_rect, ps_ellipse
void ps_new_path ( ps_context ctx)

Create a new empty path in the graphic context, clear the old one.

Parameters:
ctxPointer to an existing context object.
See also:
ps_new_sub_path, ps_set_path, ps_get_path, ps_close_path, ps_add_sub_path
void ps_new_sub_path ( ps_context ctx)

Close the current path, and add a new empty sub path in the graphic context.

Parameters:
ctxPointer to an existing context object.
See also:
ps_new_path, ps_set_path, ps_get_path, ps_close_path, ps_add_sub_path
void ps_quad_curve_to ( ps_context ctx,
const ps_point cp,
const ps_point ep 
)

Add a quadratic bezier spline to the current path from current point to end point.

Parameters:
ctxPointer to an existing context object.
cpThe control point of the curve.
epThe end point of the curve.
See also:
ps_move_to, ps_line_to, ps_bezier_curve_to, ps_arc, ps_tangent_arc, ps_rectangle, ps_rounded_rect, ps_ellipse
void ps_rectangle ( ps_context ctx,
const ps_rect rect 
)

Add a rectangle to the current path.

Parameters:
ctxPointer to an existing context object.
rectThe rectangle which will be added.
See also:
ps_move_to, ps_line_to, ps_bezier_curve_to, ps_quad_curve_to, ps_arc, ps_tangent_arc, ps_rounded_rect, ps_ellipse
void ps_rounded_rect ( ps_context ctx,
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 current path.

Parameters:
ctxPointer to an existing context object.
rectThe rectangle which will be added.
ltxThe left top horizontal radius.
ltyThe left top vertical radius.
rtxThe right top horizontal radius.
rtyThe right top vertical radius.
lbxThe left bottom horizontal radius.
lbyThe left bottom vertical radius.
rbxThe right bottom horizontal radius.
rbyThe right bottom vertical radius.
See also:
ps_move_to, ps_line_to, ps_bezier_curve_to, ps_quad_curve_to, ps_arc, ps_tangent_arc, ps_rectangle, ps_ellipse
void ps_set_path ( ps_context ctx,
const ps_path path 
)

Replace the current path in the graphic context.

Parameters:
ctxPointer to an existing context object.
pathThe path will be set to graphic context.
See also:
ps_new_path, ps_new_sub_path, ps_get_path, ps_close_path, ps_add_sub_path
void ps_tangent_arc ( ps_context ctx,
const ps_rect rect,
float  sangle,
float  sweep 
)

Add a circular arc which is inner tangent from a rectangle.

Parameters:
ctxPointer to an existing context object.
rectThe rectangle which the arc to fit in.
sangleThe start angle, in radians.
sweepThe sweep angle, in radians.
See also:
ps_move_to, ps_line_to, ps_bezier_curve_to, ps_quad_curve_to, ps_arc, ps_rectangle, ps_rounded_rect, ps_ellipse