Picasso API  2.8
Functions

Functions

PEXPORT ps_context *PICAPI ps_context_create (ps_canvas *canvas, ps_context *shared_context)
 Create a new graphic context for a canvas. More...
 
PEXPORT ps_context *PICAPI ps_context_ref (ps_context *ctx)
 Increases the reference count of the context by 1. More...
 
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. More...
 
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. More...
 
PEXPORT ps_canvas *PICAPI ps_context_get_canvas (ps_context *ctx)
 Get the canvas from the context. More...
 

Detailed Description

Function Documentation

◆ ps_context_create()

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

◆ ps_context_get_canvas()

ps_canvas * ps_context_get_canvas ( ps_context ctx)

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

◆ ps_context_ref()

ps_context * ps_context_ref ( ps_context ctx)

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_context_set_canvas()

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

◆ ps_context_unref()

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