diff options
Diffstat (limited to 'src/multimedia/video')
-rw-r--r-- | src/multimedia/video/qvideoframe.cpp | 19 | ||||
-rw-r--r-- | src/multimedia/video/qvideowindow.cpp | 19 |
2 files changed, 25 insertions, 13 deletions
diff --git a/src/multimedia/video/qvideoframe.cpp b/src/multimedia/video/qvideoframe.cpp index ea48afc7e..acf549c55 100644 --- a/src/multimedia/video/qvideoframe.cpp +++ b/src/multimedia/video/qvideoframe.cpp @@ -702,7 +702,19 @@ void QVideoFrame::setEndTime(qint64 time) } /*! - Sets the counterclockwise rotation \a angle for the frame. + \enum QVideoFrame::RotationAngle + + The angle of the clockwise rotation that should be applied to a video + frame before displaying. + + \value Rotation0 No rotation required, the frame has correct orientation + \value Rotation90 The frame should be rotated by 90 degrees + \value Rotation180 The frame should be rotated by 180 degrees + \value Rotation270 The frame should be rotated by 270 degrees +*/ + +/*! + Sets the \a angle the frame should be rotated clockwise before displaying. */ void QVideoFrame::setRotationAngle(QVideoFrame::RotationAngle angle) { @@ -711,8 +723,7 @@ void QVideoFrame::setRotationAngle(QVideoFrame::RotationAngle angle) } /*! - Returns the angle the frame should be rotated counterclockwise before - displaying. + Returns the angle the frame should be rotated clockwise before displaying. */ QVideoFrame::RotationAngle QVideoFrame::rotationAngle() const { @@ -771,7 +782,7 @@ QImage QVideoFrame::toImage() const if (mirrored()) t.scale(-1.f, 1.f); if (rotationAngle() != Rotation0) - t.rotate(-1.f * float(rotationAngle())); + t.rotate(float(rotationAngle())); if (surfaceFormat().scanLineDirection() != QVideoFrameFormat::TopToBottom) t.scale(1.f, -1.f); diff --git a/src/multimedia/video/qvideowindow.cpp b/src/multimedia/video/qvideowindow.cpp index f2a6d7037..9055b4167 100644 --- a/src/multimedia/video/qvideowindow.cpp +++ b/src/multimedia/video/qvideowindow.cpp @@ -103,27 +103,28 @@ QVideoWindowPrivate::~QVideoWindowPrivate() } static const float g_quad[] = { - // 4 counterclockwise rotation of texture vertexes (the second pair) + // 4 clockwise rotation of texture vertexes (the second pair) // Rotation 0 -1.f, -1.f, 0.f, 0.f, -1.f, 1.f, 0.f, 1.f, 1.f, -1.f, 1.f, 0.f, 1.f, 1.f, 1.f, 1.f, // Rotation 90 - -1.f, -1.f, 1.f, 0.f, - -1.f, 1.f, 0.f, 0.f, - 1.f, -1.f, 1.f, 1.f, - 1.f, 1.f, 0.f, 1.f, + -1.f, -1.f, 0.f, 1.f, + -1.f, 1.f, 1.f, 1.f, + 1.f, -1.f, 0.f, 0.f, + 1.f, 1.f, 1.f, 0.f, + // Rotation 180 -1.f, -1.f, 1.f, 1.f, -1.f, 1.f, 1.f, 0.f, 1.f, -1.f, 0.f, 1.f, 1.f, 1.f, 0.f, 0.f, // Rotation 270 - -1.f, -1.f, 0.f, 1.f, - -1.f, 1.f, 1.f, 1.f, - 1.f, -1.f, 0.f, 0.f, - 1.f, 1.f, 1.f, 0.f + -1.f, -1.f, 1.f, 0.f, + -1.f, 1.f, 0.f, 0.f, + 1.f, -1.f, 1.f, 1.f, + 1.f, 1.f, 0.f, 1.f }; static QShader getShader(const QString &name) |