]> git.draconx.ca Git - liblbx.git/blob - src/image.h
e0a52bb1c06c4e0f3969d03b48eec148bd97c8ce
[liblbx.git] / src / image.h
1 #ifndef LBXIMG_H_
2 #define LBXIMG_H_
3
4 #include <stdio.h>
5
6 typedef struct lbx_image LBXimg;
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 short width, height;
18         unsigned char  nframes, loopstart, chunk;
19         int palettesz, looping;
20 };
21
22 LBXimg *lbx_img_open(void *f, const struct lbx_file_ops *fops,
23                      int (*destructor)(void *));
24 LBXimg *lbx_img_fopen(const char *file);
25 int     lbx_img_close(LBXimg *img);
26
27 unsigned char **lbx_img_getframe(LBXimg *img, int frame);
28 unsigned char **lbx_img_getmask(LBXimg *img);
29
30 int lbx_img_loadpalette(void *f, const struct lbx_file_ops *fops,
31                        struct lbx_colour palette[static 256]);
32 int lbx_img_getpalette(LBXimg *img, struct lbx_colour palette[static 256]);
33
34 void lbx_img_getinfo(LBXimg *img, struct lbx_imginfo *info);
35
36 #endif