mirror of https://github.com/status-im/qzxing.git
Change QMatrix to QTransform when applying orientation rotation to QImage before decode
This commit is contained in:
parent
b1659be29a
commit
4db0aa28c8
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue