no clue :) just to push it
[demo] / src / image.h
1 #ifndef IMAGE_H_
2 #define IMAGE_H_
3
4 #include <gmath/gmath.h>
5
6 class Image {
7 public:
8         int w;
9         int h;
10         int psz;
11
12         bool is_float;
13         void *pixels;
14
15         Image();
16         ~Image();
17
18         Image(const Image &image);
19         Image &operator =(const Image &image);
20
21         /*
22          move constructor: called when you assign
23          an rvalue reference
24         */
25         Image(Image &&image); // rvalue reference
26         Image &operator =(Image &&image);
27
28         bool load(const char *fname);
29
30         Vec4 get_pixel(int x, int y) const;
31
32         Vec4 lookup_nearest(float u, float v) const;
33         Vec4 lookup_linear(float u, float v, float du, float dv) const;
34 };
35
36 #endif // IMAGE_H_