Picasso API  2.2
Functions
Context
Graphic Functions

Functions

PEXPORT ps_context *PICAPI ps_context_create (ps_canvas *canvas, ps_context *shared_context)
 Create a new graphic context for a canvas.
PEXPORT ps_context *PICAPI ps_context_ref (ps_context *ctx)
 Increases the reference count of the context by 1.
PEXPORT void PICAPI ps_context_unref (ps_context *ctx)
 Decrements the reference count for the context object. If the reference count on the context falls to 0, the context is freed.
PEXPORT ps_canvas *PICAPI ps_context_set_canvas (ps_context *ctx, ps_canvas *canvas)
 Set a new canvas into a context, and return the old one.
PEXPORT ps_canvas *PICAPI ps_context_get_canvas (ps_context *ctx)
 Get the canvas from the context.

Function Documentation

ps_context * ps_context_create ( ps_canvas canvas,
ps_context shared_context 
)

Create a new graphic context for a canvas.

Parameters:
canvasPointer to an existing canvas object.
shared_contextResources shared context, NULL mean resources not shared.
Returns:
If the function succeeds, the return value is the pointer to a new context object. If the function fails, the return value is NULL.
Note:
To get extended error information, call ps_last_status.
See also:
ps_context_set_canvas, ps_context_get_canvas, ps_context_ref, ps_context_unref

Get the canvas from the context.

Parameters:
ctxPointer to an existing context object.
Returns:
If the function succeeds, the return value is a pointer to the canvas. If the function fails, the return value is NULL.
Note:
To get extended error information, call ps_last_status.
See also:
ps_context_create, ps_context_ref, ps_context_unref, ps_context_set_canvas

Increases the reference count of the context by 1.

Parameters:
ctxPointer to an existing context object.
Returns:
If the function succeeds, the return value is the pointer to the context object. If the function fails, the return value is NULL.
Note:
To get extended error information, call ps_last_status.
See also:
ps_context_set_canvas, ps_context_get_canvas, ps_context_create, ps_context_unref
ps_canvas * ps_context_set_canvas ( ps_context ctx,
ps_canvas canvas 
)

Set a new canvas into a context, and return the old one.

Parameters:
ctxPointer to an existing context object.
canvasPointer to an existing canvas object to be set.
Returns:
If the function succeeds, the return value is a pointer to the canvas being replaced. If the function fails, the return value is NULL.
Note:
To get extended error information, call ps_last_status.
See also:
ps_context_create, ps_context_ref, ps_context_unref, ps_context_get_canvas
void ps_context_unref ( ps_context ctx)

Decrements the reference count for the context object. If the reference count on the context falls to 0, the context is freed.

Parameters:
ctxPointer to an existing context object.
See also:
ps_context_set_canvas, ps_context_get_canvas, ps_context_create, ps_context_ref