]> git.tdb.fi Git - libs/gl.git/blob - source/pixelstore.h
Run a tighter ship with extensions
[libs/gl.git] / source / pixelstore.h
1 #ifndef MSP_GL_PIXELSTORE_H_
2 #define MSP_GL_PIXELSTORE_H_
3
4 #include <msp/graphics/image.h>
5 #include "bindable.h"
6
7 namespace Msp {
8 namespace GL {
9
10 class PixelStore: public BindableWithDefault<PixelStore>
11 {
12 private:
13         enum ParameterMask
14         {
15                 SIZE,
16                 ORIGIN,
17                 ALIGNMENT
18         };
19
20         unsigned row_length;
21         unsigned image_height;
22         unsigned skip_pixels;
23         unsigned skip_rows;
24         unsigned skip_images;
25         unsigned alignment;
26
27 public:
28         PixelStore();
29
30         static PixelStore from_image(const Graphics::Image &);
31
32 private:
33         void update_parameter(int) const;
34
35 public:
36         void set_canvas_size(unsigned, unsigned);
37         void set_origin(unsigned, unsigned, unsigned);
38         void set_alignment(unsigned);
39
40         void bind() const;
41 };
42
43 } // namespace GL
44 } // namespace Msp
45
46 #endif