erebus

annotate liberebus/src/image.h @ 37:db8a90307386

implemented console and rudimentary commandline parser
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 09 Jun 2014 16:01:00 +0300
parents 4abdce1361b9
children
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@26 30 void clear();
nuclear@26 31
nuclear@0 32 bool load(const char *fname);
nuclear@0 33 };
nuclear@0 34
nuclear@0 35 #include "image.inl"
nuclear@0 36
nuclear@0 37 #endif // IMAGE_H_