Picasso API 2.5

Functions

PEXPORT void PICAPI ps_translate (ps_context *ctx, float tx, float ty)
 Changes the origin of the user coordinate system in graphic context.
 
PEXPORT void PICAPI ps_scale (ps_context *ctx, float sx, float sy)
 Changes the scale of the user coordinate system in graphic context.
 
PEXPORT void PICAPI ps_shear (ps_context *ctx, float shx, float shy)
 Changes the shear of the user coordinate system in graphic context.
 
PEXPORT void PICAPI ps_rotate (ps_context *ctx, float angle)
 Rotates the user coordinate system in graphic context.
 
PEXPORT void PICAPI ps_identity (ps_context *ctx)
 Reset the current transformation matrix to identity matrix.
 
PEXPORT void PICAPI ps_transform (ps_context *ctx, const ps_matrix *matrix)
 Transforms the user coordinate system in graphic context using a specified matrix.
 
PEXPORT void PICAPI ps_set_matrix (ps_context *ctx, const ps_matrix *matrix)
 Modifies the current transformation matrix to the given matrix.
 
PEXPORT ps_bool PICAPI ps_get_matrix (ps_context *ctx, ps_matrix *matrix)
 Get the current transformation matrix from graphic context.
 
PEXPORT void PICAPI ps_world_to_viewport (ps_context *ctx, ps_point *point)
 Transform a coordinate from device space to user space.
 
PEXPORT void PICAPI ps_viewport_to_world (ps_context *ctx, ps_point *point)
 Transform a coordinate from user space to device space.
 

Detailed Description

Function Documentation

◆ ps_get_matrix()

PEXPORT ps_bool PICAPI ps_get_matrix ( ps_context * ctx,
ps_matrix * matrix )

Get the current transformation matrix from graphic context.

Parameters
ctxPointer to an existing context object.
matrixPointer to a matrix object to receiving the current transformation.
Returns
True if is success, otherwise False.
See also
ps_set_matrix

◆ ps_identity()

PEXPORT void PICAPI ps_identity ( ps_context * ctx)

Reset the current transformation matrix to identity matrix.

Parameters
ctxPointer to an existing context object.
See also
ps_translate, ps_scale, ps_shear, ps_rotate, ps_transform

◆ ps_rotate()

PEXPORT void PICAPI ps_rotate ( ps_context * ctx,
float angle )

Rotates the user coordinate system in graphic context.

Parameters
ctxPointer to an existing context object.
angleThe angle, in radians, which to rotate the specified context.
See also
ps_translate, ps_scale, ps_shear, ps_identity, ps_transform

◆ ps_scale()

PEXPORT void PICAPI ps_scale ( ps_context * ctx,
float sx,
float sy )

Changes the scale of the user coordinate system in graphic context.

Parameters
ctxPointer to an existing context object.
sxThe scale factor for the X dimension.
syThe scale factor for the Y dimension.
See also
ps_translate, ps_shear, ps_rotate, ps_identity, ps_transform

◆ ps_set_matrix()

PEXPORT void PICAPI ps_set_matrix ( ps_context * ctx,
const ps_matrix * matrix )

Modifies the current transformation matrix to the given matrix.

Parameters
ctxPointer to an existing context object.
matrixThe transformation matrix to be set.
See also
ps_get_matrix

◆ ps_shear()

PEXPORT void PICAPI ps_shear ( ps_context * ctx,
float shx,
float shy )

Changes the shear of the user coordinate system in graphic context.

Parameters
ctxPointer to an existing context object.
shxThe shear factor for the horizontal.
shyThe shear factor for the vertical.
See also
ps_translate, ps_scale, ps_rotate, ps_identity, ps_transform

◆ ps_transform()

PEXPORT void PICAPI ps_transform ( ps_context * ctx,
const ps_matrix * matrix )

Transforms the user coordinate system in graphic context using a specified matrix.

Parameters
ctxPointer to an existing context object.
matrixThe matrix to apply to the specified context's current transformation matrix.
See also
ps_translate, ps_scale, ps_shear, ps_rotate, ps_identity

◆ ps_translate()

PEXPORT void PICAPI ps_translate ( ps_context * ctx,
float tx,
float ty )

Changes the origin of the user coordinate system in graphic context.

Parameters
ctxPointer to an existing context object.
txThe amount, in pixels, which to translate in x direction.
tyThe amount, in pixels, which to translate in y direction.
See also
ps_scale, ps_shear, ps_rotate, ps_identity, ps_transform

◆ ps_viewport_to_world()

PEXPORT void PICAPI ps_viewport_to_world ( ps_context * ctx,
ps_point * point )

Transform a coordinate from user space to device space.

Parameters
ctxPointer to an existing context object.
pointThe point which to be transformed.
See also
ps_world_to_viewport

◆ ps_world_to_viewport()

PEXPORT void PICAPI ps_world_to_viewport ( ps_context * ctx,
ps_point * point )

Transform a coordinate from device space to user space.

Parameters
ctxPointer to an existing context object.
pointThe point which to be transformed.
See also
ps_viewport_to_world