]> git.draconx.ca Git - liblbx.git/blob - src/image.h
liblbx: Don't scale palette values internally.
[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 red:6, green:6, blue:6, active:1;
15 };
16
17 struct lbx_imginfo {
18         unsigned char loopstart;
19         int palettesz, looping;
20 };
21
22 struct lbx_image *lbx_img_open(void *f, const struct lbx_file_ops *fops,
23                                int (*destructor)(void *));
24 struct lbx_image *lbx_img_fopen(const char *file);
25 int     lbx_img_close(struct lbx_image *img);
26
27 unsigned char **lbx_img_getframe(struct lbx_image *img, int frame);
28 unsigned char **lbx_img_getmask(struct lbx_image *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(struct lbx_image *img,
33                        struct lbx_colour palette[static 256]);
34
35 void lbx_img_getinfo(struct lbx_image *img, struct lbx_imginfo *info);
36
37 #endif