63352f8a7527ed6340a80ea040dd1598b38b33bc
[dosdemo] / tools / csprite / src / image.h
1 #ifndef IMAGE_H_
2 #define IMAGE_H_
3
4 struct cmapent {
5         unsigned char r, g, b;
6 };
7
8 struct image {
9         int width, height;
10         int bpp;
11         int nchan;
12         int scansz, pitch;
13         int cmap_ncolors;
14         struct cmapent cmap[256];
15         unsigned char *pixels;
16 };
17
18 int alloc_image(struct image *img, int x, int y, int bpp);
19 int load_image(struct image *img, const char *fname);
20 int save_image(struct image *img, const char *fname);
21
22 int cmp_image(struct image *a, struct image *b);
23
24 void blit_image(struct image *src, int sx, int sy, int w, int h, struct image *dst, int dx, int dy);
25
26 void image_color_offset(struct image *img, int offs);
27
28 #endif  /* IMAGE_H_ */