summaryrefslogtreecommitdiff
path: root/src/qcam/viewfinder_gl.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-10-12 22:02:10 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-11-07 19:27:29 +0200
commit3badc5c4bea38cd362707ec3da25881f30113fac (patch)
tree565930653c92e265bb2dd894cb3cfd4a6c2704d6 /src/qcam/viewfinder_gl.h
parent819f6172ea73cfc1be80d6ade11819e981f0409d (diff)
qcam: viewfinder_gl: Store textures in an array
In preparation for RGB formats support, store the three Y, U and V textures in an array. This makes the code more generic, and will avoid referring to an RGB texture as textureY_. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/qcam/viewfinder_gl.h')
-rw-r--r--src/qcam/viewfinder_gl.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qcam/viewfinder_gl.h b/src/qcam/viewfinder_gl.h
index b3e36514..150fa4ae 100644
--- a/src/qcam/viewfinder_gl.h
+++ b/src/qcam/viewfinder_gl.h
@@ -8,6 +8,7 @@
#ifndef __VIEWFINDER_GL_H__
#define __VIEWFINDER_GL_H__
+#include <array>
#include <memory>
#include <QImage>
@@ -77,14 +78,14 @@ private:
/* Vertex buffer */
QOpenGLBuffer vertexBuffer_;
- /* YUV texture planars and parameters */
+ /* Textures */
+ std::array<std::unique_ptr<QOpenGLTexture>, 3> textures_;
+
+ /* YUV texture parameters */
GLuint textureUniformU_;
GLuint textureUniformV_;
GLuint textureUniformY_;
GLuint textureUniformStepX_;
- QOpenGLTexture textureU_;
- QOpenGLTexture textureV_;
- QOpenGLTexture textureY_;
unsigned int horzSubSample_;
unsigned int vertSubSample_;