[libcamera-devel] [PATCH v2 3/3] qcam: viewfinder_qt: Support X RGB variants

Kieran Bingham kieran.bingham at ideasonboard.com
Wed Jul 6 11:06:42 CEST 2022


Support the X variants of the RGB pixel formats
along side the equivalent Alpha component based versions.

The Alpha channel is ignored by both QImage::Format_RGB32, and
QImage::Format_RGBX8888.

The existing use of QImage::Format_RGBA8888 is updated to use the
QImage::Format_RGBX8888 variant to ensure that the image data is
visible.

Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---

v2:
 - Update to use QImage::Format_RGBX8888 over QImage::Format_RGBA8888

 src/qcam/viewfinder_qt.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/qcam/viewfinder_qt.cpp b/src/qcam/viewfinder_qt.cpp
index 27955e3f9593..7a6a60c96393 100644
--- a/src/qcam/viewfinder_qt.cpp
+++ b/src/qcam/viewfinder_qt.cpp
@@ -27,9 +27,11 @@
 static const QMap<libcamera::PixelFormat, QImage::Format> nativeFormats
 {
 #if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
-	{ libcamera::formats::ABGR8888, QImage::Format_RGBA8888 },
+	{ libcamera::formats::ABGR8888, QImage::Format_RGBX8888 },
+	{ libcamera::formats::XBGR8888, QImage::Format_RGBX8888 },
 #endif
 	{ libcamera::formats::ARGB8888, QImage::Format_RGB32 },
+	{ libcamera::formats::XRGB8888, QImage::Format_RGB32 },
 #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
 	{ libcamera::formats::RGB888, QImage::Format_BGR888 },
 #endif
-- 
2.34.1



More information about the libcamera-devel mailing list