From 251f0534b74bcb46c777aa0df34b1b4142b664f5 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 28 Aug 2022 03:40:25 +0300 Subject: qcam: viewfinder_gl: Take color space into account for YUV rendering Update the YUV shaders and the viewfinder_gl to correctly take the Y'CbCr encoding and the quantization range into account when rendering YUV formats to RGB. Support for the primaries and transfer function will be added in a subsequent step. Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain Reviewed-by: Kunal Agarwal --- src/qcam/viewfinder_gl.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/qcam/viewfinder_gl.h') diff --git a/src/qcam/viewfinder_gl.h b/src/qcam/viewfinder_gl.h index 798830a3..68c2912d 100644 --- a/src/qcam/viewfinder_gl.h +++ b/src/qcam/viewfinder_gl.h @@ -57,6 +57,7 @@ protected: private: bool selectFormat(const libcamera::PixelFormat &format); + void selectColorSpace(const libcamera::ColorSpace &colorSpace); void configureTexture(QOpenGLTexture &texture); bool createFragmentShader(); @@ -67,6 +68,7 @@ private: /* Captured image size, format and buffer */ libcamera::FrameBuffer *buffer_; libcamera::PixelFormat format_; + libcamera::ColorSpace colorSpace_; QSize size_; unsigned int stride_; Image *image_; -- cgit v1.2.1