]> git.draconx.ca Git - liblbx.git/blob - src/image.h
2679babcc34ff40cbebf515252daa7f02dec5aa5
[liblbx.git] / src / image.h
1 #ifndef LBXIMG_H_
2 #define LBXIMG_H_
3
4 #include <stdio.h>
5
6 struct lbx_file_ops;
7
8 struct lbx_image {
9         unsigned short width, height;
10         unsigned char frames, chunk;
11 };
12
13 struct lbx_colour {
14         unsigned char red;
15         unsigned char green;
16         unsigned char blue;
17         unsigned char active;
18 };
19
20 struct lbx_imginfo {
21         unsigned short width, height;
22         unsigned char  nframes, loopstart, chunk;
23         int palettesz, looping;
24 };
25
26 struct lbx_image *lbx_img_open(void *f, const struct lbx_file_ops *fops,
27                                int (*destructor)(void *));
28 struct lbx_image *lbx_img_fopen(const char *file);
29 int     lbx_img_close(struct lbx_image *img);
30
31 unsigned char **lbx_img_getframe(struct lbx_image *img, int frame);
32 unsigned char **lbx_img_getmask(struct lbx_image *img);
33
34 int lbx_img_loadpalette(void *f, const struct lbx_file_ops *fops,
35                        struct lbx_colour palette[static 256]);
36 int lbx_img_getpalette(struct lbx_image *img,
37                        struct lbx_colour palette[static 256]);
38
39 void lbx_img_getinfo(struct lbx_image *img, struct lbx_imginfo *info);
40
41 #endif