Change QMatrix to QTransform when applying orientation rotation to QImage before decode

This commit is contained in:
Nikolaos Ftylitakis 2021-08-12 11:06:10 +03:00
parent b1659be29a
commit 4db0aa28c8
1 changed files with 5 additions and 6 deletions

View File

@ -393,12 +393,11 @@ void QZXingFilterRunnable::processVideoFrameProbed(SimpleVideoFrame & videoFrame
if (!orientation) {
decode(*image_ptr);
} else {
QImage translatedImage = image_ptr->transformed([](QPoint center, int orientation) {
QMatrix matrix;
matrix.translate(center.x(), center.y());
matrix.rotate(-orientation);
return matrix;
} (image_ptr->rect().center(), orientation));
QTransform transformation;
transformation.translate(image_ptr->rect().center().x(), image_ptr->rect().center().y());
transformation.rotate(-orientation);
QImage translatedImage = image_ptr->transformed(transformation);
decode(translatedImage);
}