]> git.draconx.ca Git - liblbx.git/blob - src/image.h
liblbx: Remove now-redundant fields from lbx_imginfo.
[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 char loopstart;
22         int palettesz, looping;
23 };
24
25 struct lbx_image *lbx_img_open(void *f, const struct lbx_file_ops *fops,
26                                int (*destructor)(void *));
27 struct lbx_image *lbx_img_fopen(const char *file);
28 int     lbx_img_close(struct lbx_image *img);
29
30 unsigned char **lbx_img_getframe(struct lbx_image *img, int frame);
31 unsigned char **lbx_img_getmask(struct lbx_image *img);
32
33 int lbx_img_loadpalette(void *f, const struct lbx_file_ops *fops,
34                        struct lbx_colour palette[static 256]);
35 int lbx_img_getpalette(struct lbx_image *img,
36                        struct lbx_colour palette[static 256]);
37
38 void lbx_img_getinfo(struct lbx_image *img, struct lbx_imginfo *info);
39
40 #endif