vrchess
diff src/image.h @ 0:b326d53321f7
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 25 Apr 2014 05:20:53 +0300 |
parents | |
children | 879194e4b1f0 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/image.h Fri Apr 25 05:20:53 2014 +0300 1.3 @@ -0,0 +1,29 @@ 1.4 +#ifndef IMAGE_H_ 1.5 +#define IMAGE_H_ 1.6 + 1.7 +class Image { 1.8 +private: 1.9 + int width, height; 1.10 + unsigned char *pixels; 1.11 + bool own_pixels; 1.12 + 1.13 +public: 1.14 + Image(); 1.15 + ~Image(); 1.16 + 1.17 + Image(const Image &img); 1.18 + Image &operator =(const Image &img); 1.19 + 1.20 + void create(int xsz, int ysz, unsigned char *pix = 0); 1.21 + void destroy(); 1.22 + 1.23 + int get_width() const; 1.24 + int get_height() const; 1.25 + 1.26 + void set_pixels(int xsz, int ysz, unsigned char *pix); 1.27 + unsigned char *get_pixels() const; 1.28 + 1.29 + bool load(const char *fname); 1.30 +}; 1.31 + 1.32 +#endif // IMAGE_H_ 1.33 \ No newline at end of file