Picasso API  2.8
Typedefs | Enumerations | Functions

Typedefs

typedef enum _ps_line_cap ps_line_cap
 Styles for rendering the endpoint of a stroked line.
 
typedef enum _ps_line_join ps_line_join
 Junction types for stroked lines.
 
typedef enum _ps_line_inner_join ps_line_inner_join
 Inner junction types for stroked lines.
 

Enumerations

enum  _ps_line_cap { LINE_CAP_BUTT, LINE_CAP_ROUND, LINE_CAP_SQUARE }
 Styles for rendering the endpoint of a stroked line. More...
 
enum  _ps_line_join {
  LINE_JOIN_MITER, LINE_JOIN_MITER_REVERT, LINE_JOIN_MITER_ROUND, LINE_JOIN_ROUND,
  LINE_JOIN_BEVEL
}
 Junction types for stroked lines. More...
 
enum  _ps_line_inner_join { LINE_INNER_MITER, LINE_INNER_BEVEL, LINE_INNER_JAG, LINE_INNER_ROUND }
 Inner junction types for stroked lines. More...
 

Functions

PEXPORT void PICAPI ps_set_line_cap (ps_context *ctx, ps_line_cap line_cap)
 Set the style for the endpoint of lines in a graphics context. More...
 
PEXPORT void PICAPI ps_set_line_join (ps_context *ctx, ps_line_join line_join)
 Set the style for the joins of connected lines in a graphics context. More...
 
PEXPORT void PICAPI ps_set_line_inner_join (ps_context *ctx, ps_line_inner_join line_inner_join)
 Set the style for the inner joins of connected lines in a graphics context. More...
 
PEXPORT float PICAPI ps_set_line_width (ps_context *ctx, float width)
 Set the line width for a graphics context. More...
 
PEXPORT float PICAPI ps_set_miter_limit (ps_context *ctx, float limit)
 Set the miter limit for the joins of connected lines in a graphics context. More...
 
PEXPORT void PICAPI ps_set_stroke_color (ps_context *ctx, const ps_color *color)
 Set a color to the context, it is used to stroke a graphic object. More...
 
PEXPORT void PICAPI ps_set_stroke_image (ps_context *ctx, const ps_image *image)
 Set a image to the context, it is used to stroke a graphic object. More...
 
PEXPORT void PICAPI ps_set_stroke_pattern (ps_context *ctx, const ps_pattern *pattern)
 Set a pattern to the context, it is used to stroke a graphic object. More...
 
PEXPORT void PICAPI ps_set_stroke_gradient (ps_context *ctx, const ps_gradient *gradient)
 Set a gradient to the context, it is used to stroke a graphic object. More...
 
PEXPORT void PICAPI ps_set_stroke_canvas (ps_context *ctx, const ps_canvas *canvas)
 Set a canvas to the context, it is used to stroke a graphic object. More...
 
PEXPORT void PICAPI ps_set_line_dash (ps_context *ctx, float start, const float *dashes, unsigned int num_dashes)
 Set the pattern for dashed lines in the context. More...
 
PEXPORT void PICAPI ps_reset_line_dash (ps_context *ctx)
 Clear the dashs from the context, and set to solid. More...
 

Detailed Description

Enumeration Type Documentation

◆ _ps_line_cap

Styles for rendering the endpoint of a stroked line.

Enumerator
LINE_CAP_BUTT 

A line with a squared-off end. The line to extend only to the endpoint.(Default)

LINE_CAP_ROUND 

A line with a rounded end. The line to extend beyond the endpoint.

LINE_CAP_SQUARE 

A line with a squared-off end. The line to extend beyond the endpoint.

Definition at line 1231 of file picasso.h.

◆ _ps_line_inner_join

Inner junction types for stroked lines.

Enumerator
LINE_INNER_MITER 

A inner join with a sharp corner.(Default)

LINE_INNER_BEVEL 

A inner join with a squared-off end.

LINE_INNER_JAG 

A inner join with a jag end.

LINE_INNER_ROUND 

A inner join with a rounded end.

Definition at line 1299 of file picasso.h.

◆ _ps_line_join

Junction types for stroked lines.

Enumerator
LINE_JOIN_MITER 

A join with a sharp corner.(Default)

LINE_JOIN_MITER_REVERT 

A join with a sharp corner revert.

LINE_JOIN_MITER_ROUND 

A join with a miter rounded end.

LINE_JOIN_ROUND 

A join with a rounded end.

LINE_JOIN_BEVEL 

A join with a squared-off end.

Definition at line 1261 of file picasso.h.

Function Documentation

◆ ps_reset_line_dash()

void ps_reset_line_dash ( ps_context ctx)

Clear the dashs from the context, and set to solid.

Parameters
ctxPointer to an existing context object.
See also
ps_set_line_cap, ps_set_line_join, ps_set_line_width, ps_set_miter_limit, ps_set_stroke_color, ps_set_line_dash, ps_set_line_inner_join

◆ ps_set_line_cap()

void ps_set_line_cap ( ps_context ctx,
ps_line_cap  line_cap 
)

Set the style for the endpoint of lines in a graphics context.

Parameters
ctxPointer to an existing context object.
line_capThe cap style of the lines.
See also
ps_set_line_join, ps_set_line_width, ps_set_miter_limit, ps_set_stroke_color, ps_set_line_dash, ps_reset_line_dash, ps_set_line_inner_join

◆ ps_set_line_dash()

void ps_set_line_dash ( ps_context ctx,
float  start,
const float *  dashes,
unsigned int  num_dashes 
)

Set the pattern for dashed lines in the context.

Parameters
ctxPointer to an existing context object.
startA value that specifies how far into the dash pattern the line start.
dashesAn array of values that specify the length of the painted segments and unpainted segments.
num_dashesThe number of elements in the array.
See also
ps_set_line_cap, ps_set_line_join, ps_set_line_width, ps_set_miter_limit, ps_set_stroke_color, ps_reset_line_dash, ps_set_line_inner_join

◆ ps_set_line_inner_join()

void ps_set_line_inner_join ( ps_context ctx,
ps_line_inner_join  line_inner_join 
)

Set the style for the inner joins of connected lines in a graphics context.

Parameters
ctxPointer to an existing context object.
line_inner_joinThe inner join style of the lines.
See also
ps_set_line_cap, ps_set_line_width, ps_set_miter_limit, ps_set_stroke_color, ps_set_line_dash, ps_reset_line_dash, ps_set_line_join

◆ ps_set_line_join()

void ps_set_line_join ( ps_context ctx,
ps_line_join  line_join 
)

Set the style for the joins of connected lines in a graphics context.

Parameters
ctxPointer to an existing context object.
line_joinThe join style of the lines.
See also
ps_set_line_cap, ps_set_line_width, ps_set_miter_limit, ps_set_stroke_color, ps_set_line_dash, ps_reset_line_dash, ps_set_line_inner_join

◆ ps_set_line_width()

float ps_set_line_width ( ps_context ctx,
float  width 
)

Set the line width for a graphics context.

Parameters
ctxPointer to an existing context object.
widthThe line width to use, in pixels, must be greater than 0. Default value is 1.
Returns
If the function succeeds, the return value is the old width. If the function fails, the return value is 0.
Note
To get extended error information, call ps_last_status.
See also
ps_set_line_cap, ps_set_line_join, ps_set_miter_limit, ps_set_stroke_color, ps_set_line_dash, ps_reset_line_dash, ps_set_line_inner_join

◆ ps_set_miter_limit()

float ps_set_miter_limit ( ps_context ctx,
float  limit 
)

Set the miter limit for the joins of connected lines in a graphics context.

Parameters
ctxPointer to an existing context object.
limitThe miter limit to use, must be greater than 0. Default value is 4.
Returns
If the function succeeds, the return value is the old miter limit. If the function fails, the return value is 0.
Note
To get extended error information, call ps_last_status.
See also
ps_set_line_cap, ps_set_line_join, ps_set_line_width, ps_set_stroke_color, ps_set_line_dash, ps_reset_line_dash, ps_set_line_inner_join

◆ ps_set_stroke_canvas()

void ps_set_stroke_canvas ( ps_context ctx,
const ps_canvas canvas 
)

Set a canvas to the context, it is used to stroke a graphic object.

Parameters
ctxPointer to an existing context object.
canvasThe canvas to be set.
See also
ps_set_line_cap, ps_set_line_join, ps_set_line_width, ps_set_miter_limit, ps_set_line_dash, ps_reset_line_dash, ps_set_line_inner_join, ps_set_stroke_color ps_set_stroke_image, ps_set_stroke_pattern, ps_set_stroke_gradient

◆ ps_set_stroke_color()

void ps_set_stroke_color ( ps_context ctx,
const ps_color color 
)

Set a color to the context, it is used to stroke a graphic object.

Parameters
ctxPointer to an existing context object.
colorThe color to be set.
See also
ps_set_line_cap, ps_set_line_join, ps_set_line_width, ps_set_miter_limit, ps_set_line_dash, ps_reset_line_dash, ps_set_line_inner_join, ps_set_stroke_image ps_set_stroke_pattern, ps_set_stroke_gradient, ps_set_stroke_canvas

◆ ps_set_stroke_gradient()

void ps_set_stroke_gradient ( ps_context ctx,
const ps_gradient gradient 
)

Set a gradient to the context, it is used to stroke a graphic object.

Parameters
ctxPointer to an existing context object.
gradientThe gradient to be set.
See also
ps_set_line_cap, ps_set_line_join, ps_set_line_width, ps_set_miter_limit, ps_set_line_dash, ps_reset_line_dash, ps_set_line_inner_join, ps_set_stroke_color ps_set_stroke_image, ps_set_stroke_pattern, ps_set_stroke_canvas

◆ ps_set_stroke_image()

void ps_set_stroke_image ( ps_context ctx,
const ps_image image 
)

Set a image to the context, it is used to stroke a graphic object.

Parameters
ctxPointer to an existing context object.
imageThe image to be set.
See also
ps_set_line_cap, ps_set_line_join, ps_set_line_width, ps_set_miter_limit, ps_set_line_dash, ps_reset_line_dash, ps_set_line_inner_join, ps_set_stroke_color ps_set_stroke_pattern, ps_set_stroke_gradient, ps_set_stroke_canvas

◆ ps_set_stroke_pattern()

void ps_set_stroke_pattern ( ps_context ctx,
const ps_pattern pattern 
)

Set a pattern to the context, it is used to stroke a graphic object.

Parameters
ctxPointer to an existing context object.
patternThe pattern to be set.
See also
ps_set_line_cap, ps_set_line_join, ps_set_line_width, ps_set_miter_limit, ps_set_line_dash, ps_reset_line_dash, ps_set_line_inner_join, ps_set_stroke_color ps_set_stroke_image, ps_set_stroke_gradient, ps_set_stroke_canvas