erebus
annotate liberebus/src/image.h @ 12:ea4bcf186d66
whatever
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 24 May 2014 21:52:19 +0300 |
parents | |
children | c8a6fb04fefa |
rev | line source |
---|---|
nuclear@0 | 1 #ifndef IMAGE_H_ |
nuclear@0 | 2 #define IMAGE_H_ |
nuclear@0 | 3 |
nuclear@0 | 4 template <typename T> |
nuclear@0 | 5 class Image { |
nuclear@0 | 6 private: |
nuclear@0 | 7 int width, height; |
nuclear@0 | 8 T *pixels; |
nuclear@0 | 9 bool own_pixels; |
nuclear@0 | 10 |
nuclear@0 | 11 public: |
nuclear@0 | 12 Image(); |
nuclear@0 | 13 ~Image(); |
nuclear@0 | 14 |
nuclear@0 | 15 Image(const Image &img); |
nuclear@0 | 16 Image &operator =(const Image &img); |
nuclear@0 | 17 |
nuclear@0 | 18 Image(const Image &&img); |
nuclear@0 | 19 Image &&operator =(const Image &&img); |
nuclear@0 | 20 |
nuclear@0 | 21 void create(int xsz, int ysz, const T *pix = 0); |
nuclear@0 | 22 void destroy(); |
nuclear@0 | 23 |
nuclear@0 | 24 int get_width() const; |
nuclear@0 | 25 int get_height() const; |
nuclear@0 | 26 |
nuclear@0 | 27 void set_pixels(int xsz, int ysz, T *pix); |
nuclear@0 | 28 T *get_pixels() const; |
nuclear@0 | 29 |
nuclear@0 | 30 bool load(const char *fname); |
nuclear@0 | 31 }; |
nuclear@0 | 32 |
nuclear@0 | 33 #include "image.inl" |
nuclear@0 | 34 |
nuclear@0 | 35 #endif // IMAGE_H_ |