conworlds
view 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 source
1 #ifndef IMAGE_H_
2 #define IMAGE_H_
4 class Image {
5 private:
6 int width, height;
7 unsigned char *pixels;
8 bool own_pixels;
10 public:
11 Image();
12 ~Image();
14 Image(const Image &img);
15 Image &operator =(const Image &img);
17 void create(int xsz, int ysz, unsigned char *pix = 0);
18 void destroy();
20 int get_width() const;
21 int get_height() const;
23 void set_pixels(int xsz, int ysz, unsigned char *pix);
24 unsigned char *get_pixels() const;
26 bool load(const char *fname);
27 };
29 #endif // IMAGE_H_