summaryrefslogtreecommitdiff
path: root/src/qcam/viewfinder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qcam/viewfinder.cpp')
-rw-r--r--src/qcam/viewfinder.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/qcam/viewfinder.cpp b/src/qcam/viewfinder.cpp
index c4471ffa..31b358da 100644
--- a/src/qcam/viewfinder.cpp
+++ b/src/qcam/viewfinder.cpp
@@ -24,6 +24,24 @@ ViewFinder::~ViewFinder()
{
}
+int ViewFinder::setFormat(const libcamera::PixelFormat &format,
+ const QSize &size)
+{
+ int ret;
+
+ ret = converter_.configure(format, size);
+ if (ret < 0)
+ return ret;
+
+ format_ = format;
+ size_ = size;
+
+ image_ = QImage(size_, QImage::Format_RGB32);
+
+ updateGeometry();
+ return 0;
+}
+
void ViewFinder::render(libcamera::FrameBuffer *buffer, MappedBuffer *map)
{
if (buffer->planes().size() != 1) {
@@ -53,24 +71,6 @@ QImage ViewFinder::getCurrentImage()
return image_.copy();
}
-int ViewFinder::setFormat(const libcamera::PixelFormat &format,
- const QSize &size)
-{
- int ret;
-
- ret = converter_.configure(format, size);
- if (ret < 0)
- return ret;
-
- format_ = format;
- size_ = size;
-
- image_ = QImage(size_, QImage::Format_RGB32);
-
- updateGeometry();
- return 0;
-}
-
void ViewFinder::paintEvent(QPaintEvent *)
{
QPainter painter(this);