From 0f292e7821b809df77de443dd30148a609cc4f49 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Wed, 5 Feb 2020 16:02:05 +0000 Subject: qcam: Provide save image functionality Implement a save image button on the toolbar which will take a current viewfinder image and present the user with a QFileDialog to allow them to choose where to save the image. Utilise the QImageWriter to perform the output task. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/qcam/viewfinder.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/qcam/viewfinder.h') diff --git a/src/qcam/viewfinder.h b/src/qcam/viewfinder.h index ef5fd45b..2ba28b60 100644 --- a/src/qcam/viewfinder.h +++ b/src/qcam/viewfinder.h @@ -7,6 +7,7 @@ #ifndef __QCAM_VIEWFINDER_H__ #define __QCAM_VIEWFINDER_H__ +#include #include #include "format_converter.h" @@ -23,6 +24,8 @@ public: unsigned int height); void display(const unsigned char *rgb, size_t size); + QImage getCurrentImage(); + protected: void paintEvent(QPaintEvent *) override; QSize sizeHint() const override; @@ -33,7 +36,9 @@ private: unsigned int height_; FormatConverter converter_; + QImage *image_; + QMutex mutex_; /* Prevent concurrent access to image_ */ }; #endif /* __QCAM_VIEWFINDER__ */ -- cgit v1.2.1