From c6cbe507c1b741c145df015fe8fa73faa35c6c1a Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 23 Mar 2020 02:34:36 +0200 Subject: 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 Reviewed-by: Kieran Bingham --- src/qcam/viewfinder.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qcam/viewfinder.h') 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 +#include #include #include #include @@ -51,7 +52,7 @@ private: libcamera::PixelFormat format_; QSize size_; - QImage *image_; + QImage image_; QMutex mutex_; /* Prevent concurrent access to image_ */ }; -- cgit v1.2.1