4#ifndef QVIDEOTRANSFORMATION_P_H
5#define QVIDEOTRANSFORMATION_P_H
23struct VideoTransformation
25 QtVideo::Rotation rotation = QtVideo::Rotation::None;
26 bool mirroredHorizontallyAfterRotation =
false;
28 void rotate(QtVideo::Rotation rotation)
30 if (rotation != QtVideo::Rotation::None) {
31 int angle = qToUnderlying(rotation);
32 if (mirroredHorizontallyAfterRotation && angle % 180 != 0)
35 appendRotation(angle);
39 void mirrorHorizontally(
bool mirror =
true) { mirroredHorizontallyAfterRotation ^= mirror; }
41 void mirrorVertically(
bool mirror =
true)
44 mirroredHorizontallyAfterRotation ^=
true;
49 int rotationIndex()
const {
return qToUnderlying(rotation) / 90; }
52 void appendRotation(quint32 angle)
54 rotation = QtVideo::Rotation((angle + qToUnderlying(rotation)) % 360);
60inline bool operator==(
const VideoTransformation &lhs,
const VideoTransformation &rhs)
62 return lhs.rotation == rhs.rotation
63 && lhs.mirroredHorizontallyAfterRotation == rhs.mirroredHorizontallyAfterRotation;
66inline bool operator!=(
const VideoTransformation &lhs,
const VideoTransformation &rhs)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)