[libcamera-devel] [PATCH] qcam: Add support for RGB565

Daniel Scally dan.scally at ideasonboard.com
Mon Oct 23 10:22:16 CEST 2023


Qt supports RGB565 natively; add support for the format by mapping
the libcamera format to Qt's representation of it.

Signed-off-by: Daniel Scally <dan.scally at ideasonboard.com>
---
 src/apps/qcam/viewfinder_qt.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/apps/qcam/viewfinder_qt.cpp b/src/apps/qcam/viewfinder_qt.cpp
index 597ccffc..62ed5e7c 100644
--- a/src/apps/qcam/viewfinder_qt.cpp
+++ b/src/apps/qcam/viewfinder_qt.cpp
@@ -36,6 +36,7 @@ static const QMap<libcamera::PixelFormat, QImage::Format> nativeFormats
 	{ libcamera::formats::RGB888, QImage::Format_BGR888 },
 #endif
 	{ libcamera::formats::BGR888, QImage::Format_RGB888 },
+	{ libcamera::formats::RGB565, QImage::Format_RGB16 },
 };
 
 ViewFinderQt::ViewFinderQt(QWidget *parent)
-- 
2.34.1



More information about the libcamera-devel mailing list