]> git.tdb.fi Git - libs/gl.git/blob - source/pixelstore.h
Deal with nontrivial image configurations
[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         unsigned row_length;
14         unsigned image_height;
15         unsigned skip_pixels;
16         unsigned skip_rows;
17         unsigned skip_images;
18         unsigned alignment;
19
20 public:
21         PixelStore();
22
23         static PixelStore from_image(const Graphics::Image &);
24
25         void set_canvas_size(unsigned, unsigned);
26         void set_origin(unsigned, unsigned, unsigned);
27         void set_alignment(unsigned);
28
29         void bind() const;
30 };
31
32 } // namespace GL
33 } // namespace Msp
34
35 #endif