42 class OpenGLImageRenderer :
protected QOpenGLFunctions
45 OpenGLImageRenderer(
const OpenGLImageRenderer &other) =
delete;
46 OpenGLImageRenderer &operator=(
const OpenGLImageRenderer &other) =
delete;
47 OpenGLImageRenderer(OpenGLImageRenderer &&other) =
delete;
48 OpenGLImageRenderer &operator=(OpenGLImageRenderer &&other) =
delete;
49 virtual ~OpenGLImageRenderer() =
default;
68 void Render(
const QRectF &viewportRect)
noexcept;
110 OpenGLImageRenderer() noexcept;
112 void BindTexture() noexcept;
113 void ReleaseTexture() noexcept;
115 void Image2DTexture(const
OpenGLBufferFormat &pixelBufferFormat,
void *pixels,
bool swizzleSupport) noexcept;
116 void Image2DTexture(
void *pixels,
bool swizzleSupport) noexcept;
120 bufferFormat_ = bufferFormat;
124 class GLTexture :
protected QOpenGLFunctions
127 GLTexture() noexcept;
128 GLTexture(const GLTexture &other) = delete;
129 GLTexture &operator=(const GLTexture &other) = delete;
130 GLTexture(GLTexture &&other) = delete;
131 GLTexture &operator=(GLTexture &&other) = delete;
134 void Bind() noexcept;
135 void Release() noexcept;
137 void Image2D(const
OpenGLBufferFormat &pixelBufferFormat,
void *pixels,
bool swizzleSupport) noexcept;
138 void Image2D(
void *pixels,
bool swizzleSupport) noexcept;
145 std::unique_ptr<GLTexture> texture_;
147 class GLCoordBuffer : public QOpenGLFunctions
150 GLCoordBuffer() noexcept;
151 GLCoordBuffer(const GLCoordBuffer &other) = delete;
152 GLCoordBuffer &operator=(const GLCoordBuffer &other) = delete;
153 GLCoordBuffer(GLCoordBuffer &&other) = delete;
154 GLCoordBuffer &operator=(GLCoordBuffer &&other) = delete;
157 void Bind() noexcept;
158 void Release() noexcept;
160 void Data(
int size,
void *buffer) noexcept;
165 std::unique_ptr<GLCoordBuffer> coordBuffer_;
167 QOpenGLShaderProgram program_;
170 int attrTexcoord_ = 0;
171 int unifModelView_ = 0;
172 int unifTexture_ = 0;
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle...
Definition size_2d.hpp:20
void UpdateMaping(const QRectF &sourceRect, Size2D< int > textureSize) noexcept
Updates the vertex and texture coordinates before rendering.
Definition detail_opengl_image_renderer.hpp:15