summaryrefslogtreecommitdiffstats
path: root/src/multimedia/video
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-04-07 15:18:17 +0200
committerLars Knoll <lars.knoll@qt.io>2021-04-08 12:19:52 +0000
commit77acd3cb4a1974d88e795a3369d74eccfd730e4f (patch)
tree90c20769b3c2e3f8e37544f91bd476d7b84768ab /src/multimedia/video
parent1730f47fe18772f48b42b8e4dbec527889ae2ef3 (diff)
Remove the notifyInterval() functionality
This was nothing else than a timer, something you can just as well implement on top of Qt Multimedia if required. Change-Id: I1ef362f1f4ad5a5f85e92bfbb1d73b7710271e5c Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimedia/video')
-rw-r--r--src/multimedia/video/qvideotexturehelper.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/multimedia/video/qvideotexturehelper.cpp b/src/multimedia/video/qvideotexturehelper.cpp
index 56282445d..f0797b039 100644
--- a/src/multimedia/video/qvideotexturehelper.cpp
+++ b/src/multimedia/video/qvideotexturehelper.cpp
@@ -264,6 +264,40 @@ static QMatrix4x4 colorMatrix(QVideoSurfaceFormat::YCbCrColorSpace colorSpace)
}
}
+#if 0
+static QMatrix4x4 yuvColorCorrectionMatrix(float brightness, float contrast, float hue, float saturation)
+{
+ // Color correction in YUV space is done as follows:
+
+ // The formulas assumes values in range 0-255, and a blackpoint of Y=16, whitepoint of Y=235
+ //
+ // Bightness: b
+ // Contrast: c
+ // Hue: h
+ // Saturation: s
+ //
+ // Y' = (Y - 16)*c + b + 16
+ // U' = ((U - 128)*cos(h) + (V - 128)*sin(h))*c*s + 128
+ // V' = ((V - 128)*cos(h) - (U - 128)*sin(h))*c*s + 128
+ //
+ // For normalized YUV values (0-1 range) as we have them in the pixel shader, this translates to:
+ //
+ // Y' = (Y - .0625)*c + b + .0625
+ // U' = ((U - .5)*cos(h) + (V - .5)*sin(h))*c*s + .5
+ // V' = ((V - .5)*cos(h) - (U - .5)*sin(h))*c*s + .5
+ //
+ // The values need to be clamped to 0-1 after the correction and before converting to RGB
+ // The transformation can be encoded in a 4x4 matrix assuming we have an A component of 1
+
+ float chcs = cos(hue)*contrast*saturation;
+ float shcs = sin(hue)*contrast*saturation;
+ return QMatrix4x4(contrast, 0, 0, .0625*(1 - contrast) + brightness,
+ 0, chcs, shcs, .5*(1 - chcs - shcs),
+ 0, -shcs, chcs, .5*(1 + shcs - chcs),
+ 0, 0, 0, 1);
+}
+#endif
+
QByteArray uniformData(const QVideoSurfaceFormat &format, const QMatrix4x4 &transform, float opacity)
{
QMatrix4x4 cmat;