erebus

view liberebus/src/image.h @ 26:c8a6fb04fefa

multithreadededit
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 01 Jun 2014 19:19:40 +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_