Qt6 VideoOutput mapRectToSource
Unsolved
General and Desktop
-
Here is a simple solution without the rotation support:
/* Q_INVOKABLE static */ QPoint WFilterBarcode::mapPointToSource(const QRect & source, const QRect & content, const QPoint & point) { qreal x = (qreal) (point.x() - content.left()) / content.width (); qreal y = (qreal) (point.y() - content.top ()) / content.height(); return QPoint(x * source.width(), y * source.height()); } /* Q_INVOKABLE static */ QRect WFilterBarcode::mapRectToSource(const QRect & source, const QRect & content, const QRect & target) { return QRect(mapPointToSource(source, content, target.topLeft ()), mapPointToSource(source, content, target.bottomRight())); }