erebus
diff liberebus/src/image.h @ 0:4abdce1361b9
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 27 Apr 2014 16:02:47 +0300 |
parents | |
children | c8a6fb04fefa |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/liberebus/src/image.h Sun Apr 27 16:02:47 2014 +0300 1.3 @@ -0,0 +1,35 @@ 1.4 +#ifndef IMAGE_H_ 1.5 +#define IMAGE_H_ 1.6 + 1.7 +template <typename T> 1.8 +class Image { 1.9 +private: 1.10 + int width, height; 1.11 + T *pixels; 1.12 + bool own_pixels; 1.13 + 1.14 +public: 1.15 + Image(); 1.16 + ~Image(); 1.17 + 1.18 + Image(const Image &img); 1.19 + Image &operator =(const Image &img); 1.20 + 1.21 + Image(const Image &&img); 1.22 + Image &&operator =(const Image &&img); 1.23 + 1.24 + void create(int xsz, int ysz, const T *pix = 0); 1.25 + void destroy(); 1.26 + 1.27 + int get_width() const; 1.28 + int get_height() const; 1.29 + 1.30 + void set_pixels(int xsz, int ysz, T *pix); 1.31 + T *get_pixels() const; 1.32 + 1.33 + bool load(const char *fname); 1.34 +}; 1.35 + 1.36 +#include "image.inl" 1.37 + 1.38 +#endif // IMAGE_H_