Skip to content

Commit

Permalink
Change QMatrix to QTransform when applying orientation rotation to QI…
Browse files Browse the repository at this point in the history
…mage before decode
  • Loading branch information
ftylitak committed Aug 12, 2021
1 parent b1659be commit 4db0aa2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/QZXingFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4db0aa2

Please sign in to comment.