summaryrefslogtreecommitdiff
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:24 +0200
commit819f6172ea73cfc1be80d6ade11819e981f0409d (patch)
tree85dccefed2da669e3db18c63229b7141d8b30066
parentdfadca635682772cf93552642f0585ecfe2c851c (diff)
qcam: viewfinder_gl: Rename yuvData_ to data_
In preparation for RGB formats support, rename the pointer to image data from yuvData_ to data_. 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>
-rw-r--r--src/qcam/viewfinder_gl.cpp24
-rw-r--r--src/qcam/viewfinder_gl.h2
2 files changed, 13 insertions, 13 deletions
diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp
index 110f0fa6..e6625cac 100644
--- a/src/qcam/viewfinder_gl.cpp
+++ b/src/qcam/viewfinder_gl.cpp
@@ -32,7 +32,7 @@ static const QList<libcamera::PixelFormat> supportedFormats{
};
ViewFinderGL::ViewFinderGL(QWidget *parent)
- : QOpenGLWidget(parent), buffer_(nullptr), yuvData_(nullptr),
+ : QOpenGLWidget(parent), buffer_(nullptr), data_(nullptr),
vertexBuffer_(QOpenGLBuffer::VertexBuffer),
textureU_(QOpenGLTexture::Target2D),
textureV_(QOpenGLTexture::Target2D),
@@ -101,7 +101,7 @@ void ViewFinderGL::render(libcamera::FrameBuffer *buffer, MappedBuffer *map)
if (buffer_)
renderComplete(buffer_);
- yuvData_ = static_cast<unsigned char *>(map->memory);
+ data_ = static_cast<unsigned char *>(map->memory);
update();
buffer_ = buffer;
}
@@ -346,7 +346,7 @@ void ViewFinderGL::doRender()
0,
GL_RED,
GL_UNSIGNED_BYTE,
- yuvData_);
+ data_);
shaderProgram_.setUniformValue(textureUniformY_, 0);
/* Activate texture UV/VU */
@@ -360,7 +360,7 @@ void ViewFinderGL::doRender()
0,
GL_RG,
GL_UNSIGNED_BYTE,
- yuvData_ + size_.width() * size_.height());
+ data_ + size_.width() * size_.height());
shaderProgram_.setUniformValue(textureUniformU_, 1);
break;
@@ -376,7 +376,7 @@ void ViewFinderGL::doRender()
0,
GL_RED,
GL_UNSIGNED_BYTE,
- yuvData_);
+ data_);
shaderProgram_.setUniformValue(textureUniformY_, 0);
/* Activate texture U */
@@ -390,7 +390,7 @@ void ViewFinderGL::doRender()
0,
GL_RED,
GL_UNSIGNED_BYTE,
- yuvData_ + size_.width() * size_.height());
+ data_ + size_.width() * size_.height());
shaderProgram_.setUniformValue(textureUniformU_, 1);
/* Activate texture V */
@@ -404,7 +404,7 @@ void ViewFinderGL::doRender()
0,
GL_RED,
GL_UNSIGNED_BYTE,
- yuvData_ + size_.width() * size_.height() * 5 / 4);
+ data_ + size_.width() * size_.height() * 5 / 4);
shaderProgram_.setUniformValue(textureUniformV_, 2);
break;
@@ -420,7 +420,7 @@ void ViewFinderGL::doRender()
0,
GL_RED,
GL_UNSIGNED_BYTE,
- yuvData_);
+ data_);
shaderProgram_.setUniformValue(textureUniformY_, 0);
/* Activate texture V */
@@ -434,7 +434,7 @@ void ViewFinderGL::doRender()
0,
GL_RED,
GL_UNSIGNED_BYTE,
- yuvData_ + size_.width() * size_.height());
+ data_ + size_.width() * size_.height());
shaderProgram_.setUniformValue(textureUniformV_, 2);
/* Activate texture U */
@@ -448,7 +448,7 @@ void ViewFinderGL::doRender()
0,
GL_RED,
GL_UNSIGNED_BYTE,
- yuvData_ + size_.width() * size_.height() * 5 / 4);
+ data_ + size_.width() * size_.height() * 5 / 4);
shaderProgram_.setUniformValue(textureUniformU_, 1);
break;
@@ -471,7 +471,7 @@ void ViewFinderGL::doRender()
0,
GL_RGBA,
GL_UNSIGNED_BYTE,
- yuvData_);
+ data_);
shaderProgram_.setUniformValue(textureUniformY_, 0);
/*
@@ -497,7 +497,7 @@ void ViewFinderGL::paintGL()
<< "create fragment shader failed.";
}
- if (yuvData_) {
+ if (data_) {
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
diff --git a/src/qcam/viewfinder_gl.h b/src/qcam/viewfinder_gl.h
index 40c04dc5..b3e36514 100644
--- a/src/qcam/viewfinder_gl.h
+++ b/src/qcam/viewfinder_gl.h
@@ -65,7 +65,7 @@ private:
libcamera::FrameBuffer *buffer_;
libcamera::PixelFormat format_;
QSize size_;
- unsigned char *yuvData_;
+ unsigned char *data_;
/* Shaders */
QOpenGLShaderProgram shaderProgram_;