Picasso API
2.2
|
Typedefs | |
typedef int(* | image_writer_fn )(void *param, const ps_byte *data, size_t length) |
Callback function for saving image data. | |
Functions | |
PEXPORT int PICAPI | psx_image_init (void) |
Initialze the library and load resources. | |
PEXPORT int PICAPI | psx_image_shutdown (void) |
Release resources and shutdoen. | |
PEXPORT psx_image *PICAPI | psx_image_create_from_data (ps_byte *data, ps_color_format fmt, int width, int height, int pitch, int *err_code) |
Create a new psx_image using a copy of given address in memory. | |
PEXPORT psx_image *PICAPI | psx_image_load (const char *file_name, int *err_code) |
Create a new psx_image object and load from file. | |
PEXPORT psx_image *PICAPI | psx_image_load_from_memory (const ps_byte *data, size_t length, int *err_code) |
Create a new psx_image object and load data from memory. | |
PEXPORT int PICAPI | psx_image_save (const psx_image *image, image_writer_fn func, void *param, const char *type, float quality) |
Encoding psx_image to a gaving format and output it. | |
PEXPORT int PICAPI | psx_image_save_to_file (const psx_image *image, const char *file_name, const char *type, float quality) |
Encoding psx_image to a gaving format and output to a file. | |
PEXPORT int PICAPI | psx_image_destroy (psx_image *image) |
Destroy the psx_image object and release resources. |
psx_image * psx_image_create_from_data | ( | ps_byte * | data, |
ps_color_format | fmt, | ||
int | width, | ||
int | height, | ||
int | pitch, | ||
int * | err_code | ||
) |
Create a new psx_image using a copy of 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 image. |
width | The width, in pixels, of the required image. |
height | The height, in pixels, of the required image. |
pitch | The number of bytes per row, of the required image. |
err_code | Pointer to a value to receiving the result code. can be NULL. |
int psx_image_destroy | ( | psx_image * | image | ) |
Destroy the psx_image object and release resources.
image | Pointer to an existing psx_image object. |
int psx_image_init | ( | void | ) |
psx_image * psx_image_load | ( | const char * | file_name, |
int * | err_code | ||
) |
Create a new psx_image object and load from file.
file_name | The image file path which will be loaded, which is encoded by utf8. |
err_code | Pointer to a value to receiving the result code. can be NULL. |
psx_image * psx_image_load_from_memory | ( | const ps_byte * | data, |
size_t | length, | ||
int * | err_code | ||
) |
Create a new psx_image object and load data from memory.
data | Pointer to data buffer in memeory. |
length | Data length bytes. |
err_code | Pointer to a value to receiving the result code. can be NULL. |
int psx_image_save | ( | const psx_image * | image, |
image_writer_fn | func, | ||
void * | param, | ||
const char * | type, | ||
float | quality | ||
) |
Encoding psx_image to a gaving format and output it.
image | Pointer to an psx_image object. |
func | User define saving callback function. |
param | User define saving callback param. |
type | Image type short name. (i.e "png" "jpg" "bmp") |
quality | Image encoding quality. (0.1 ~ 1.0) |
int psx_image_save_to_file | ( | const psx_image * | image, |
const char * | file_name, | ||
const char * | type, | ||
float | quality | ||
) |
Encoding psx_image to a gaving format and output to a file.
image | Pointer to an psx_image object. |
file_name | The image file path which will be output, which is encoded by utf8. |
type | Image type short name. (i.e "png" "jpg" "bmp") |
quality | Image encoding quality. (0.1 ~ 1.0) |
int psx_image_shutdown | ( | void | ) |