diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-03-23 02:34:36 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-03-24 10:34:05 +0200 |
commit | c6cbe507c1b741c145df015fe8fa73faa35c6c1a (patch) | |
tree | 815c900b238c6be544edf22a65b22eafdba6ca36 /src/qcam/viewfinder.h | |
parent | 615f7438ad6bf49bd213e7ae4f9f3fe334edeb67 (diff) |
qcam: viewfinder: Embed QImage in ViewFinder
The QImage class is a thin wrapper that uses implicit sharing. We can
thus embed it in the ViewFinder class instead of allocating it
dynamically, and assign it at runtime. This simplifies the code.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/qcam/viewfinder.h')
-rw-r--r-- | src/qcam/viewfinder.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qcam/viewfinder.h b/src/qcam/viewfinder.h index 784fcced..54c0fa9d 100644 --- a/src/qcam/viewfinder.h +++ b/src/qcam/viewfinder.h @@ -9,6 +9,7 @@ #include <stddef.h> +#include <QImage> #include <QMutex> #include <QSize> #include <QWidget> @@ -51,7 +52,7 @@ private: libcamera::PixelFormat format_; QSize size_; - QImage *image_; + QImage image_; QMutex mutex_; /* Prevent concurrent access to image_ */ }; |