vrchess

annotate src/image.h @ 0:b326d53321f7

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 25 Apr 2014 05:20:53 +0300
parents
children 879194e4b1f0
rev   line source
nuclear@0 1 #ifndef IMAGE_H_
nuclear@0 2 #define IMAGE_H_
nuclear@0 3
nuclear@0 4 class Image {
nuclear@0 5 private:
nuclear@0 6 int width, height;
nuclear@0 7 unsigned char *pixels;
nuclear@0 8 bool own_pixels;
nuclear@0 9
nuclear@0 10 public:
nuclear@0 11 Image();
nuclear@0 12 ~Image();
nuclear@0 13
nuclear@0 14 Image(const Image &img);
nuclear@0 15 Image &operator =(const Image &img);
nuclear@0 16
nuclear@0 17 void create(int xsz, int ysz, unsigned char *pix = 0);
nuclear@0 18 void destroy();
nuclear@0 19
nuclear@0 20 int get_width() const;
nuclear@0 21 int get_height() const;
nuclear@0 22
nuclear@0 23 void set_pixels(int xsz, int ysz, unsigned char *pix);
nuclear@0 24 unsigned char *get_pixels() const;
nuclear@0 25
nuclear@0 26 bool load(const char *fname);
nuclear@0 27 };
nuclear@0 28
nuclear@0 29 #endif // IMAGE_H_