X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fpixelstore.h;fp=source%2Fcore%2Fpixelstore.h;h=80032c3c3fdc7bee3eb62d76ff2cc16e43b6f563;hb=7aaec9a70b8d7733429bec043f8e33e02956f266;hp=0000000000000000000000000000000000000000;hpb=bec07999d95b76f4b47cffcc564d0cd0afc0435e;p=libs%2Fgl.git diff --git a/source/core/pixelstore.h b/source/core/pixelstore.h new file mode 100644 index 00000000..80032c3c --- /dev/null +++ b/source/core/pixelstore.h @@ -0,0 +1,46 @@ +#ifndef MSP_GL_PIXELSTORE_H_ +#define MSP_GL_PIXELSTORE_H_ + +#include +#include "bindable.h" + +namespace Msp { +namespace GL { + +class PixelStore: public BindableWithDefault +{ +private: + enum ParameterMask + { + SIZE = 1, + ORIGIN = 2, + ALIGNMENT = 4 + }; + + unsigned row_length; + unsigned image_height; + unsigned skip_pixels; + unsigned skip_rows; + unsigned skip_images; + unsigned alignment; + +public: + PixelStore(); + + static PixelStore from_image(const Graphics::Image &); + +private: + void update_parameter(int) const; + +public: + void set_canvas_size(unsigned, unsigned); + void set_origin(unsigned, unsigned, unsigned); + void set_alignment(unsigned); + + void bind() const; +}; + +} // namespace GL +} // namespace Msp + +#endif