Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qvideoframeformat.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QVIDEOSURFACEFORMAT_H
5#define QVIDEOSURFACEFORMAT_H
6
7#include <QtMultimedia/qtmultimediaglobal.h>
8
9#include <QtCore/qlist.h>
10#include <QtCore/qmetatype.h>
11#include <QtCore/qshareddata.h>
12#include <QtCore/qsize.h>
13#include <QtGui/qimage.h>
14
16
17
18class QDebug;
19
21class QVideoFrame;
22class QMatrix4x4;
23
25
26class Q_MULTIMEDIA_EXPORT QVideoFrameFormat
27{
28public:
30 {
42
58
61
65
66 Format_YUV420P10
67 };
68#ifndef Q_QDOC
69 static constexpr int NPixelFormats = Format_YUV420P10 + 1;
70#endif
71
73 {
75 BottomToTop
76 };
77
78#if QT_DEPRECATED_SINCE(6, 4)
79 enum YCbCrColorSpace
80 {
81 YCbCr_Undefined = 0,
82 YCbCr_BT601 = 1,
83 YCbCr_BT709 = 2,
84 YCbCr_xvYCC601 = 3,
85 YCbCr_xvYCC709 = 4,
86 YCbCr_JPEG = 5,
87 YCbCr_BT2020 = 6
88 };
89#endif
90
91 // Keep values compatible with YCbCrColorSpace
93 {
94 ColorSpace_Undefined = 0,
95 ColorSpace_BT601 = 1,
96 ColorSpace_BT709 = 2,
97 ColorSpace_AdobeRgb = 5,
98 ColorSpace_BT2020 = 6
99 };
100
102 {
111 };
112
114 {
117 ColorRange_Full
118 };
119
121 QVideoFrameFormat(const QSize &size, PixelFormat pixelFormat);
124
128 { d.swap(other.d); }
129
130 void detach();
131
133
134 bool operator==(const QVideoFrameFormat &format) const;
135 bool operator!=(const QVideoFrameFormat &format) const;
136
137 bool isValid() const;
138
139 QVideoFrameFormat::PixelFormat pixelFormat() const;
140
141 QSize frameSize() const;
142 void setFrameSize(const QSize &size);
143 void setFrameSize(int width, int height);
144
145 int frameWidth() const;
146 int frameHeight() const;
147
148 int planeCount() const;
149
150 QRect viewport() const;
151 void setViewport(const QRect &viewport);
152
153 Direction scanLineDirection() const;
154 void setScanLineDirection(Direction direction);
155
156 qreal frameRate() const;
157 void setFrameRate(qreal rate);
158
159#if QT_DEPRECATED_SINCE(6, 4)
160 QT_DEPRECATED_VERSION_X_6_4("Use colorSpace()")
161 YCbCrColorSpace yCbCrColorSpace() const;
162 QT_DEPRECATED_VERSION_X_6_4("Use setColorSpace()")
163 void setYCbCrColorSpace(YCbCrColorSpace colorSpace);
164#endif
165
166 ColorSpace colorSpace() const;
167 void setColorSpace(ColorSpace colorSpace);
168
169 ColorTransfer colorTransfer() const;
170 void setColorTransfer(ColorTransfer colorTransfer);
171
172 ColorRange colorRange() const;
173 void setColorRange(ColorRange range);
174
175 bool isMirrored() const;
176 void setMirrored(bool mirrored);
177
178 QString vertexShaderFileName() const;
179 QString fragmentShaderFileName() const;
180 void updateUniformData(QByteArray *dst, const QVideoFrame &frame, const QMatrix4x4 &transform, float opacity) const;
181
182 float maxLuminance() const;
183 void setMaxLuminance(float lum);
184
185 static PixelFormat pixelFormatFromImageFormat(QImage::Format format);
186 static QImage::Format imageFormatFromPixelFormat(PixelFormat format);
187
188 static QString pixelFormatToString(QVideoFrameFormat::PixelFormat pixelFormat);
189
190private:
192};
193
194Q_DECLARE_SHARED(QVideoFrameFormat)
195
196#ifndef QT_NO_DEBUG_STREAM
197Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QVideoFrameFormat &);
199#if QT_DEPRECATED_SINCE(6, 4)
200QT_DEPRECATED_VERSION_X_6_4("Use QVideoFrameFormat::ColorSpace")
201Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoFrameFormat::YCbCrColorSpace);
202#endif
205#endif
206
208
210
211#endif
212
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Format
The following image formats are available in Qt.
Definition qimage.h:41
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
The QVideoFrameFormat class specifies the stream format of a video presentation surface.
ColorSpace
Enumerates the color space of video frames.
ColorTransfer
\value ColorTransfer_Unknown The color transfer function is unknown.
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QVideoFrameFormat)
PixelFormat
Enumerates video data types.
void swap(QVideoFrameFormat &other) noexcept
Swaps the current video frame format with the other.
QVideoFrameFormat(const QVideoFrameFormat &format)
Constructs a copy of other.
Direction
Enumerates the layout direction of video scan lines.
QVideoFrameFormat & operator=(const QVideoFrameFormat &format)
Assigns the values of other to this object.
~QVideoFrameFormat()
Destroys a video stream description.
QVideoFrameFormat(QVideoFrameFormat &&other) noexcept=default
Constructs a QVideoFrameFormat by moving from other.
ColorRange
Describes the color range used by the video data.
The QVideoFrame class represents a frame of video data.
Definition qvideoframe.h:26
direction
Combined button and popup list for selecting options.
constexpr bool operator!=(const timespec &t1, const timespec &t2)
#define Q_DECLARE_METATYPE(TYPE)
Definition qmetatype.h:1504
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei range
GLint GLsizei width
GLenum GLenum dst
GLint GLsizei GLsizei GLenum format
GLuint GLenum GLenum transform
GLuint GLenum * rate
static constexpr QSize frameSize(const T &frame)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1219
#define QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(Class, ExportMacro)
#define QT_DEPRECATED_VERSION_X_6_4(text)
double qreal
Definition qtypes.h:92
Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QVideoFrameFormat &)
QSharedPointer< T > other(t)
[5]
view viewport() -> scroll(dx, dy, deviceRect)
QFrame frame
[0]