diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2022-07-05 16:04:03 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2022-07-18 23:18:13 +0100 |
commit | ef77e2637985b61dc99669b4396647ad13acb204 (patch) | |
tree | b3810f5f2b934fcc948ed7cb29eb6d4113358abc /src/qcam | |
parent | 24095ff765e32046a9d22c83ca53c4cd89e540ce (diff) |
qcam: viewfinder_qt: Support X RGB variants
Support the X variants of the RGB pixel formats alongside the
equivalent Alpha component based versions.
The QImage::Format_RGB32 and QImage::Format_RGBX8888 formats only
specify that the alpha component must be 0xff. While the Qt
documentation doesn't guarantee that the alpha value will be ignored by
consumers, this seems to be the implemented behaviour, at least when
rendering with QPainter::drawImage().
The existing use of QImage::Format_RGBA8888 is updated to use the
QImage::Format_RGBX8888 variant to ensure that the image data is
visible.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/qcam')
-rw-r--r-- | src/qcam/viewfinder_qt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qcam/viewfinder_qt.cpp b/src/qcam/viewfinder_qt.cpp index 27955e3f..7a6a60c9 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 |