ccdemos/image.h
branchpyrit
changeset 15 a0a3e334744f
child 60 a23b5089b9c3
equal deleted inserted replaced
14:fc18ac4833f2 15:a0a3e334744f
       
     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 	char *data;
       
    13 };
       
    14 
       
    15 int new_image(struct image **img, int width, int height, int pixelsize);
       
    16 int destroy_image(struct image **img);
       
    17 
       
    18 int save_png(const char *fname, struct image *img);
       
    19 
       
    20 #endif