using a texture for the grid is better
[vrfileman] / src / image.h
1 #ifndef IMAGE_H_
2 #define IMAGE_H_
3
4
5 class Image {
6 public:
7         enum Format {
8                 FMT_GREY,
9                 FMT_RGB,
10                 FMT_RGBA,
11                 FMT_GREY_FLOAT,
12                 FMT_RGB_FLOAT,
13                 FMT_RGBA_FLOAT
14         };
15
16 private:
17         Format fmt;
18         int width, height;
19         void *pixels;
20
21 public:
22         Image();
23         ~Image();
24
25         Image(const Image &img);
26         Image &operator =(const Image &img);
27
28         Image(Image &&img);
29         Image &operator =(Image &&img);
30
31         int get_width() const;
32         int get_height() const;
33
34         Format get_format() const;
35
36         bool create(int x, int y, Format fmt = FMT_RGBA);
37         bool set_pixels(int x, int y, void *pixels, Format fmt = FMT_RGBA);
38         void *get_pixels() const;
39
40         bool load(const char *fname);
41         bool save(const char *fname) const;
42 };
43
44 #endif  // IMAGE_H_