]> mj.ucw.cz Git - libucw.git/blob - images/images.h
Merge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git
[libucw.git] / images / images.h
1 #ifndef _IMAGES_IMAGES_H
2 #define _IMAGES_IMAGES_H
3
4 enum image_flag {
5   IMAGE_GRAYSCALE = 0x1,        /* grayscale image */
6 };
7
8 struct image {
9   uns flags;                    /* enum image_flag */
10   uns width;                    /* number of columns */
11   uns height;                   /* number of rows */
12   uns size;                     /* buffer size in bytes */
13   byte *pixels;                 /* RGB */
14 };
15
16 enum image_format {
17   IMAGE_FORMAT_UNDEFINED = 0,
18   IMAGE_FORMAT_JPEG,
19   IMAGE_FORMAT_PNG,
20   IMAGE_FORMAT_GIF
21 };
22
23 struct image_info {
24   uns width;
25   uns height;
26   enum image_format format;
27   union {
28     struct {
29     } jpeg;
30     struct {
31     } png;
32     struct {
33     } gif;
34   };
35 };
36
37 int read_image_header(struct image_info *info);
38 int read_image_data(struct image_info *info);
39
40 #endif
41