Picasso API  2.2
Functions
Mask
Graphic 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.
PEXPORT ps_mask *PICAPI ps_mask_ref (ps_mask *mask)
 Increases the reference count of the mask by 1.
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.
PEXPORT void PICAPI ps_mask_add_color_filter (ps_mask *mask, const ps_color *color)
 Add a color filter to a mask.
PEXPORT void PICAPI ps_mask_clear_color_filters (ps_mask *mask)
 Clear all colors from mask's filter.

Function Documentation

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

Clear all colors from mask's filter.

Parameters:
maskPointer to an existing mask object.
See also:
ps_mask_add_color_filter
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 * 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
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