erebus

view liberebus/src/image.h @ 44:a2afaf8af09b

helpful comment
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 18 Sep 2015 06:47:41 +0300
parents 4abdce1361b9
children
line source
1 #ifndef IMAGE_H_
2 #define IMAGE_H_
4 template <typename T>
5 class Image {
6 private:
7 int width, height;
8 T *pixels;
9 bool own_pixels;
11 public:
12 Image();
13 ~Image();
15 Image(const Image &img);
16 Image &operator =(const Image &img);
18 Image(const Image &&img);
19 Image &&operator =(const Image &&img);
21 void create(int xsz, int ysz, const T *pix = 0);
22 void destroy();
24 int get_width() const;
25 int get_height() const;
27 void set_pixels(int xsz, int ysz, T *pix);
28 T *get_pixels() const;
30 void clear();
32 bool load(const char *fname);
33 };
35 #include "image.inl"
37 #endif // IMAGE_H_