Picasso API
2.2
|
Typedefs | |
typedef enum _ps_color_format | ps_color_format |
Pixel formats of canvas or image. | |
Enumerations | |
enum | _ps_color_format { COLOR_FORMAT_RGBA, COLOR_FORMAT_ARGB, COLOR_FORMAT_ABGR, COLOR_FORMAT_BGRA, COLOR_FORMAT_RGB, COLOR_FORMAT_BGR, COLOR_FORMAT_RGB565, COLOR_FORMAT_RGB555, COLOR_FORMAT_UNKNOWN } |
Pixel formats of canvas or image. More... | |
Functions | |
PEXPORT ps_canvas *PICAPI | ps_canvas_create (ps_color_format fmt, int width, int height) |
Create a new canvas using the given parameters. | |
PEXPORT ps_canvas *PICAPI | ps_canvas_create_with_data (ps_byte *data, ps_color_format fmt, int width, int height, int pitch) |
Create a new canvas using a given address in memory. | |
PEXPORT ps_canvas *PICAPI | ps_canvas_create_compatible (const ps_canvas *canvas, int width, int height) |
Create a new canvas to compatible with an existing canvas. | |
PEXPORT ps_canvas *PICAPI | ps_canvas_create_from_canvas (ps_canvas *canvas, const ps_rect *rect) |
Create a new canvas using part of an existing canvas in same pixel buffer. | |
PEXPORT ps_canvas *PICAPI | ps_canvas_create_from_image (ps_image *img, const ps_rect *rect) |
Create a new canvas using part of an existing ps_image object in same pixel buffer. | |
PEXPORT ps_canvas *PICAPI | ps_canvas_replace_data (ps_canvas *canvas, ps_byte *data, ps_color_format fmt, int width, int height, int pitch) |
Replace a canvas target rendering buffer address in memory, which is only use for canvas create by ps_canvas_create_with_data. | |
PEXPORT ps_canvas *PICAPI | ps_canvas_ref (ps_canvas *canvas) |
Increases the reference count of the canvas by 1. | |
PEXPORT void PICAPI | ps_canvas_unref (ps_canvas *canvas) |
Decrements the reference count for the canvas object. If the reference count on the canvas falls to 0, the canvas is freed. | |
PEXPORT ps_bool PICAPI | ps_canvas_get_size (const ps_canvas *canvas, ps_size *rsize) |
Return the size of the canvas. | |
PEXPORT ps_color_format PICAPI | ps_canvas_get_format (const ps_canvas *canvas) |
Return the pixel format of the canvas. | |
PEXPORT void PICAPI | ps_canvas_set_mask (ps_canvas *canvas, const ps_mask *mask) |
Set a new mask into an existing canvas object. | |
PEXPORT void PICAPI | ps_canvas_reset_mask (ps_canvas *canvas) |
Clear the mask from the canvas object. | |
PEXPORT void PICAPI | ps_canvas_bitblt (ps_canvas *src, const ps_rect *rect, ps_canvas *dst, const ps_point *location) |
Copy raster data between two canvas objects. |
enum _ps_color_format |
Pixel formats of canvas or image.
void ps_canvas_bitblt | ( | ps_canvas * | src, |
const ps_rect * | rect, | ||
ps_canvas * | dst, | ||
const ps_point * | location | ||
) |
Copy raster data between two canvas objects.
src | The pointer to source canvas object. |
rect | The rectangle area will be copied in source canvas, NULL mean the whole area. |
dst | The pointer to destination canvas object. |
location | The location of the start point at destination canvas object. |
ps_canvas * ps_canvas_create | ( | ps_color_format | fmt, |
int | width, | ||
int | height | ||
) |
Create a new canvas using the given parameters.
fmt | The Pixel format to use for the canvas. |
width | The width, in pixels, of the required canvas. |
height | The height, in pixels, of the required canvas. |
ps_canvas * ps_canvas_create_compatible | ( | const ps_canvas * | canvas, |
int | width, | ||
int | height | ||
) |
Create a new canvas to compatible with an existing canvas.
canvas | A pointer to an existing canvas. |
width | The width, in pixels, of the required canvas. If it is not more than zero, the width will be equal to the width of the reference canvas. |
height | The height, in pixels, of the required canvas. If it is not more than zero, the height will be equal to the height of the reference canvas. |
ps_canvas * ps_canvas_create_from_canvas | ( | ps_canvas * | canvas, |
const ps_rect * | rect | ||
) |
Create a new canvas using part of an existing canvas in same pixel buffer.
canvas | A pointer to an existing canvas. |
rect | The rectangle area of the canvas from the parent canvas. If it is NULL, the canvas's width and height will be equal to the parant canvas. |
ps_canvas * ps_canvas_create_from_image | ( | ps_image * | img, |
const ps_rect * | rect | ||
) |
Create a new canvas using part of an existing ps_image object in same pixel buffer.
img | A pointer to an existing ps_image object. |
rect | The rectangle area of the canvas from the ps_image. If it is NULL, the canvas's width and height will be equal to ps_image object. |
ps_canvas * ps_canvas_create_with_data | ( | ps_byte * | data, |
ps_color_format | fmt, | ||
int | width, | ||
int | height, | ||
int | pitch | ||
) |
Create a new canvas using a given address in memory.
data | A pointer to the destination in memory where the drawing is to be rendered. The size of this memory block should be at least (pitch * height) bytes. |
fmt | The Pixel format to use for the canvas. |
width | The width, in pixels, of the required canvas. |
height | The height, in pixels, of the required canvas. |
pitch | The number of bytes per row, of the required canvas. |
ps_color_format ps_canvas_get_format | ( | const ps_canvas * | canvas | ) |
Return the pixel format of the canvas.
canvas | Pointer to an existing canvas object. |
ps_bool ps_canvas_get_size | ( | const ps_canvas * | canvas, |
ps_size * | rsize | ||
) |
Return the size of the canvas.
canvas | Pointer to an existing canvas object. |
rsize | Pointer to a buffer to receiving the size. |
ps_canvas * ps_canvas_ref | ( | ps_canvas * | canvas | ) |
Increases the reference count of the canvas by 1.
canvas | Pointer to an existing canvas object. |
ps_canvas *PICAPI ps_canvas_replace_data | ( | ps_canvas * | canvas, |
ps_byte * | data, | ||
ps_color_format | fmt, | ||
int | width, | ||
int | height, | ||
int | pitch | ||
) |
Replace a canvas target rendering buffer address in memory, which is only use for canvas create by ps_canvas_create_with_data.
canvas | Pointer to an existing canvas object. |
data | A pointer to the destination in memory where the drawing is to be rendered. The size of this memory block should be at least (pitch * height) bytes. |
fmt | The Pixel format to use for the canvas. |
width | The width, in pixels, of the required canvas. |
height | The height, in pixels, of the required canvas. |
pitch | The number of bytes per row, of the required canvas. |
void ps_canvas_reset_mask | ( | ps_canvas * | canvas | ) |
Clear the mask from the canvas object.
canvas | Pointer to an existing canvas object. |
void ps_canvas_set_mask | ( | ps_canvas * | canvas, |
const ps_mask * | mask | ||
) |
Set a new mask into an existing canvas object.
canvas | Pointer to an existing canvas object. |
mask | Pointer to an existing mask object to be set. |
void ps_canvas_unref | ( | ps_canvas * | canvas | ) |
Decrements the reference count for the canvas object. If the reference count on the canvas falls to 0, the canvas is freed.
canvas | Pointer to an existing canvas object. |