erebus

view liberebus/src/image.h @ 31:53a98c148bf8

- introduced SurfaceGeometry to carry all the geometric information input to BRDF sampling and evaluation functions. - made Reflectance keep an (optional) pointer to its material - simplified PhongRefl::sample_dir, with the help of SurfaceGeometry - worked around microsoft's broken std::thread implementation's deadlock on join
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 07 Jun 2014 09:14:17 +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_