qcam: Support scaling of the viewfinder
The viewfinder is drawn using a QLabel. This could support scaling through QLabel::setScaledContents(), but in a very inefficient way. To maintain reasonable efficiency, turn the viewfinder into a QWidget and draw the image directly using a QPainter. No performance change was noticed running on a fast x86 machine, and performance was 60% higher when scaling up to full screen compared to QLabel. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
@@ -33,7 +33,6 @@ MainWindow::MainWindow(CameraManager *cm, const OptionsParser::Options &options)
|
||||
|
||||
viewfinder_ = new ViewFinder(this);
|
||||
setCentralWidget(viewfinder_);
|
||||
viewfinder_->setFixedSize(500, 500);
|
||||
adjustSize();
|
||||
|
||||
ret = openCamera(cm);
|
||||
|
||||
Reference in New Issue
Block a user