branch | pyrit |
changeset 88 | f7edb3b90816 |
parent 87 | 1081e3dd3f3e |
child 89 | fcf1487b398b |
87:1081e3dd3f3e | 88:f7edb3b90816 |
---|---|
1 #ifndef IMAGE_H |
|
2 #define IMAGE_H |
|
3 |
|
4 #define IMG_GRAYSCALE 1 |
|
5 #define IMG_RGB 3 |
|
6 |
|
7 /* raw image */ |
|
8 struct image { |
|
9 int pixel_size; /* should be 1 for grayscale and 3 for RGB*/ |
|
10 int width; |
|
11 int height; |
|
12 unsigned char *data; |
|
13 }; |
|
14 |
|
15 int new_image(struct image **img, int width, int height, int pixelsize); |
|
16 void destroy_image(struct image **img); |
|
17 |
|
18 int save_png(const char *fname, struct image *img); |
|
19 |
|
20 #endif |