]> git.draconx.ca Git - liblbx.git/blob - src/image.h
2f427d10c9111cadbcd641e1dcc22546f0ee7cc1
[liblbx.git] / src / image.h
1 #ifndef LBXIMG_H_
2 #define LBXIMG_H_
3
4 #include <stdio.h>
5
6 typedef struct lbx_image LBX_IMG;
7 struct lbx_file_ops;
8
9 struct lbx_colour {
10         unsigned char red;
11         unsigned char green;
12         unsigned char blue;
13         unsigned char active;
14 };
15
16 struct lbx_imginfo {
17         unsigned int width, height;
18         unsigned int nframes, loopstart;
19         int palettesz;
20         int looping;
21 };
22
23 LBX_IMG *lbximg_open(void *f, const struct lbx_file_ops *fops,
24                      int (*destructor)(void *));
25 LBX_IMG *lbximg_fopen(FILE *f);
26 int      lbximg_close(LBX_IMG *img);
27
28 unsigned char **lbximg_getframe(LBX_IMG *img, int frame);
29 unsigned char **lbximg_getmask(LBX_IMG *img);
30
31 int lbximg_loadpalette(void *f, const struct lbx_file_ops *fops,
32                        struct lbx_colour palette[static 256]);
33 int lbximg_getpalette(LBX_IMG *img, struct lbx_colour palette[static 256]);
34
35 void lbximg_getinfo(LBX_IMG *img, struct lbx_imginfo *info);
36
37 #endif