int x; int y; s_image_t *img; s_surface_t *surface; char *file = "file.img"; // initialize img struct s_image_init(&img); // parse and load file to img struct s_image_img(file, img); // paste img to the surface s_putboxrgba(surface, x + img->x, y + img->y, img->w, img->h, img->rgba); // or s_image_get_buf(surface, img); s_putbox(surface, x + img->x, y + img->y, img->w, img->h, img->buf); // or s_image_get_buf(surface, img); s_image_get_mat(surface, img); s_putboxmask(surface, x + img->x, y + img->y, img->w, img->h, img->buf, img->mat); // or s_image_get_buf(surface, img); s_image_get_mat(surface, img); s_putboxalpha(surface, x + img->x, y + img->y, img->w, img->h, img->buf, img->mat); // when finished, uninitialize img struct s_image_uninit(img);
Data Structures | |
| struct | s_image_s |
| image struct More... | |
Functions | |
| int | s_image_hex2int (char *str) |
| convert a hex str to int | |
| int | s_image_get_mat (s_image_t *img) |
| generates alpha values for given image | |
| int | s_image_get_buf (s_surface_t *surface, s_image_t *img) |
| generates image buffer using surface, for given image | |
| void | s_image_get_handler (s_image_t *img) |
| calculates handler for given image | |
| int | s_image_init (s_image_t **img) |
| initializes image struct | |
| void | s_image_free_buf (s_image_t *img) |
| frees memory used for buf, and sets it to NULL. | |
| void | s_image_free_mat (s_image_t *img) |
| frees memory used for mat, and sets it to NULL. | |
| void | s_image_free_rgba (s_image_t *img) |
| frees memory used for rgb, and sets it to NULL. | |
| void | s_image_free_handler (s_image_t *img) |
| frees memory used for handler, and sets it to NULL. | |
| int | s_image_uninit (s_image_t *img) |
| uninitializes image struct | |
| int | s_image_layer_init (s_image_t **lyr) |
| initializes image struct | |
| int | s_image_layer_uninit (s_image_t *lyr) |
| uninitializes image struct | |
| int | s_image_layers_init (s_image_t *img) |
| initializes layer list for given image | |
| int | s_image_layers_uninit (s_image_t *img) |
| uninitializes layer list for given image | |
| int | s_image_img (char *file, s_image_t *img) |
| fills image struct by calling the approtiated function, if the file is a supported format | |
| int | s_image_gif_is (char *file) |
| checks if the file is a gif | |
| int | s_image_gif (char *file, s_image_t *img) |
| fills the image struct | |
| int | s_image_png_is (char *file) |
| checks if the file is a png | |
| int | s_image_png (char *file, s_image_t *img) |
| fills the image struct | |
| int | s_image_xpm_is (char *file) |
| checks if the file is a xpm | |
| int | s_image_xpm (char *file, s_image_t *img) |
| fills the image struct | |
| void s_image_free_buf | ( | s_image_t * | img | ) |
frees memory used for buf, and sets it to NULL.
| *img | - the image |
| void s_image_free_handler | ( | s_image_t * | img | ) |
frees memory used for handler, and sets it to NULL.
| *img | - the image |
| void s_image_free_mat | ( | s_image_t * | img | ) |
frees memory used for mat, and sets it to NULL.
| *img | - the image |
| void s_image_free_rgba | ( | s_image_t * | img | ) |
frees memory used for rgb, and sets it to NULL.
| *img | - the image |
| int s_image_get_buf | ( | s_surface_t * | surface, | |
| s_image_t * | img | |||
| ) |
generates image buffer using surface, for given image
| *surface | - pointer to a valid surface. | |
| *img | - the image |
| void s_image_get_handler | ( | s_image_t * | img | ) |
calculates handler for given image
| *img | - the image |
| int s_image_get_mat | ( | s_image_t * | img | ) |
generates alpha values for given image
| *img | - the image |
| int s_image_gif | ( | char * | file, | |
| s_image_t * | img | |||
| ) |
fills the image struct
| *file | - exact path to the file | |
| *img | - the image |
| int s_image_gif_is | ( | char * | file | ) |
checks if the file is a gif
| *file | - exact path to the file |
| int s_image_hex2int | ( | char * | str | ) |
convert a hex str to int
| *str | - pointer to a buffer of chars with at least length 2 |
| int s_image_img | ( | char * | file, | |
| s_image_t * | img | |||
| ) |
fills image struct by calling the approtiated function, if the file is a supported format
| *file | - exact path to the file | |
| *img | - the image |
| int s_image_init | ( | s_image_t ** | img | ) |
initializes image struct
| **img | - address of the pointer to image struct |
| int s_image_layer_init | ( | s_image_t ** | lyr | ) |
initializes image struct
| **lyr | - address of the pointer to image struct |
| int s_image_layer_uninit | ( | s_image_t * | lyr | ) |
uninitializes image struct
| *lyr | - the layer |
| int s_image_layers_init | ( | s_image_t * | img | ) |
initializes layer list for given image
| *img | - the image |
| int s_image_layers_uninit | ( | s_image_t * | img | ) |
uninitializes layer list for given image
| *img | - the image |
| int s_image_png | ( | char * | file, | |
| s_image_t * | img | |||
| ) |
fills the image struct
| *file | - exact path to the file | |
| *img | - the image |
| int s_image_png_is | ( | char * | file | ) |
checks if the file is a png
| *file | - exact path to the file |
| int s_image_uninit | ( | s_image_t * | img | ) |
uninitializes image struct
| *img | - the image |
| int s_image_xpm | ( | char * | file, | |
| s_image_t * | img | |||
| ) |
fills the image struct
| *file | - exact path to the file | |
| *img | - the image |
| int s_image_xpm_is | ( | char * | file | ) |
checks if the file is a xpm
| *file | - exact path to the file |
1.4.7