Picasso API  2.8
Functions

Functions

PEXPORT ps_mask *PICAPI ps_mask_create_with_data (ps_byte *data, int width, int height)
 Create a new mask using a given data block. More...
 
PEXPORT ps_mask *PICAPI ps_mask_ref (ps_mask *mask)
 Increases the reference count of the mask by 1. More...
 
PEXPORT void PICAPI ps_mask_unref (ps_mask *mask)
 Decrements the reference count for the mask object. If the reference count on the mask falls to 0, the mask is freed. More...
 
PEXPORT void PICAPI ps_mask_add_color_filter (ps_mask *mask, const ps_color *color)
 Add a color filter to a mask. More...
 
PEXPORT void PICAPI ps_mask_clear_color_filters (ps_mask *mask)
 Clear all colors from mask's filter. More...
 

Detailed Description

Function Documentation

◆ ps_mask_add_color_filter()

void ps_mask_add_color_filter ( ps_mask mask,
const ps_color color 
)

Add a color filter to a mask.

Parameters
maskPointer to an existing mask object.
colorA color for be masked. Only the colors specified by filter can be masked. If no color is specified, all colors can be masked.
See also
ps_mask_clear_color_filters

◆ ps_mask_clear_color_filters()

void ps_mask_clear_color_filters ( ps_mask mask)

Clear all colors from mask's filter.

Parameters
maskPointer to an existing mask object.
See also
ps_mask_add_color_filter

◆ ps_mask_create_with_data()

ps_mask * ps_mask_create_with_data ( ps_byte data,
int  width,
int  height 
)

Create a new mask using a given data block.

Parameters
dataA pointer to the mask data block in memory. Each byte of data is a aplha value, from transparent to opaque (0 ~ 255). The size of this memory block should be at least (width * height) bytes.
widthThe width, in pixels, of the required mask.
heightThe height, in pixels, of the required mask.
Returns
If the function succeeds, the return value is the pointer to a new mask object. If the function fails, the return value is NULL.
Note
To get extended error information, call ps_last_status.
See also
ps_mask_ref, ps_mask_unref, ps_canvas_set_mask, ps_canvas_reset_mask

◆ ps_mask_ref()

ps_mask * ps_mask_ref ( ps_mask mask)

Increases the reference count of the mask by 1.

Parameters
maskPointer to an existing mask object.
Returns
If the function succeeds, the return value is the pointer to the mask object. If the function fails, the return value is NULL.
Note
To get extended error information, call ps_last_status.
See also
ps_mask_create_with_data, ps_mask_unref, ps_canvas_set_mask, ps_canvas_reset_mask

◆ ps_mask_unref()

void ps_mask_unref ( ps_mask mask)

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

Parameters
maskPointer to an existing mask object.
See also
ps_mask_create_with_data, ps_mask_ref, ps_canvas_set_mask, ps_canvas_reset_mask