conworlds
annotate src/image.h @ 22:5f53272ff612
removed the vr wrapper and added an external dependency to libgoatvr
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 29 Aug 2014 07:44:26 +0300 |
parents | b326d53321f7 |
children |
rev | line source |
---|---|
nuclear@2 | 1 #ifndef IMAGE_H_ |
nuclear@2 | 2 #define IMAGE_H_ |
nuclear@2 | 3 |
nuclear@2 | 4 class Image { |
nuclear@2 | 5 private: |
nuclear@2 | 6 int width, height; |
nuclear@2 | 7 unsigned char *pixels; |
nuclear@2 | 8 bool own_pixels; |
nuclear@2 | 9 |
nuclear@2 | 10 public: |
nuclear@2 | 11 Image(); |
nuclear@2 | 12 ~Image(); |
nuclear@2 | 13 |
nuclear@2 | 14 Image(const Image &img); |
nuclear@2 | 15 Image &operator =(const Image &img); |
nuclear@2 | 16 |
nuclear@2 | 17 void create(int xsz, int ysz, unsigned char *pix = 0); |
nuclear@2 | 18 void destroy(); |
nuclear@2 | 19 |
nuclear@2 | 20 int get_width() const; |
nuclear@2 | 21 int get_height() const; |
nuclear@2 | 22 |
nuclear@2 | 23 void set_pixels(int xsz, int ysz, unsigned char *pix); |
nuclear@2 | 24 unsigned char *get_pixels() const; |
nuclear@2 | 25 |
nuclear@2 | 26 bool load(const char *fname); |
nuclear@2 | 27 }; |
nuclear@2 | 28 |
nuclear@2 | 29 #endif // IMAGE_H_ |