Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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#include <QtMultimedia/qtvideo.h>
9
10#include <QtCore/qlist.h>
11#include <QtCore/qmetatype.h>
12#include <QtCore/qshareddata.h>
13#include <QtCore/qsize.h>
14#include <QtGui/qimage.h>
15
17
18
19class QDebug;
20
22class QVideoFrame;
23class QMatrix4x4;
24
26
27class Q_MULTIMEDIA_EXPORT QVideoFrameFormat
28{
29public:
69#ifndef Q_QDOC
70 static constexpr int NPixelFormats = Format_YUV420P10 + 1;
71#endif
72
74 {
76 BottomToTop
77 };
78
79#if QT_DEPRECATED_SINCE(6, 4)
80 enum YCbCrColorSpace
81 {
82 YCbCr_Undefined = 0,
83 YCbCr_BT601 = 1,
84 YCbCr_BT709 = 2,
85 YCbCr_xvYCC601 = 3,
86 YCbCr_xvYCC709 = 4,
87 YCbCr_JPEG = 5,
88 YCbCr_BT2020 = 6
89 };
90#endif
91
92 // Keep values compatible with YCbCrColorSpace
94 {
95 ColorSpace_Undefined = 0,
96 ColorSpace_BT601 = 1,
97 ColorSpace_BT709 = 2,
98 ColorSpace_AdobeRgb = 5,
99 ColorSpace_BT2020 = 6
100 };
101
113
115 {
118 ColorRange_Full
119 };
120
122 QVideoFrameFormat(const QSize &size, PixelFormat pixelFormat);
125
129 { d.swap(other.d); }
130
131 void detach();
132
134
135 bool operator==(const QVideoFrameFormat &format) const;
136 bool operator!=(const QVideoFrameFormat &format) const;
137
138 bool isValid() const;
139
140 QVideoFrameFormat::PixelFormat pixelFormat() const;
141
142 QSize frameSize() const;
143 void setFrameSize(const QSize &size);
144 void setFrameSize(int width, int height);
145
146 int frameWidth() const;
147 int frameHeight() const;
148
149 int planeCount() const;
150
151 QRect viewport() const;
152 void setViewport(const QRect &viewport);
153
154 Direction scanLineDirection() const;
155 void setScanLineDirection(Direction direction);
156
157#if QT_DEPRECATED_SINCE(6, 8)
158 QT_DEPRECATED_VERSION_X_6_8("Use streamFrameRate()")
159 qreal frameRate() const;
160 QT_DEPRECATED_VERSION_X_6_8("Use setStreamFrameRate()")
161 void setFrameRate(qreal rate);
162#endif
163
164 qreal streamFrameRate() const;
165 void setStreamFrameRate(qreal rate);
166
167#if QT_DEPRECATED_SINCE(6, 4)
168 QT_DEPRECATED_VERSION_X_6_4("Use colorSpace()")
169 YCbCrColorSpace yCbCrColorSpace() const;
170 QT_DEPRECATED_VERSION_X_6_4("Use setColorSpace()")
171 void setYCbCrColorSpace(YCbCrColorSpace colorSpace);
172#endif
173
174 ColorSpace colorSpace() const;
175 void setColorSpace(ColorSpace colorSpace);
176
177 ColorTransfer colorTransfer() const;
178 void setColorTransfer(ColorTransfer colorTransfer);
179
180 ColorRange colorRange() const;
181 void setColorRange(ColorRange range);
182
183 bool isMirrored() const;
184 void setMirrored(bool mirrored);
185
186 QtVideo::Rotation rotation() const;
187 void setRotation(QtVideo::Rotation rotation);
188
189 QString vertexShaderFileName() const;
190 QString fragmentShaderFileName() const;
191 void updateUniformData(QByteArray *dst, const QVideoFrame &frame, const QMatrix4x4 &transform, float opacity) const;
192
193 float maxLuminance() const;
194 void setMaxLuminance(float lum);
195
196 static PixelFormat pixelFormatFromImageFormat(QImage::Format format);
197 static QImage::Format imageFormatFromPixelFormat(PixelFormat format);
198
199 static QString pixelFormatToString(QVideoFrameFormat::PixelFormat pixelFormat);
200
201private:
202 QExplicitlySharedDataPointer<QVideoFrameFormatPrivate> d;
203};
204
205Q_DECLARE_SHARED(QVideoFrameFormat)
206
207#ifndef QT_NO_DEBUG_STREAM
208Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QVideoFrameFormat &);
210#if QT_DEPRECATED_SINCE(6, 4)
211QT_DEPRECATED_VERSION_X_6_4("Use QVideoFrameFormat::ColorSpace")
212Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, QVideoFrameFormat::YCbCrColorSpace);
213#endif
216#endif
217
219
221
222#endif
223
\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:129
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:27
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:1525
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:1220
#define QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(Class, ExportMacro)
#define QT_DEPRECATED_VERSION_X_6_4(text)
#define QT_DEPRECATED_VERSION_X_6_8(text)
double qreal
Definition qtypes.h:187
Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QVideoFrameFormat &)
QSharedPointer< T > other(t)
[5]
view viewport() -> scroll(dx, dy, deviceRect)
QFrame frame
[0]