Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qvideoframetestutils.cpp
Go to the documentation of this file.
1
// Copyright (C) 2026 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4
#
include
"qvideoframetestutils_p.h"
5
6
#
include
<
cstring
>
7
8
QT_BEGIN_NAMESPACE
9
10
namespace
QtMultimediaTest
{
11
12
QByteArray
makeBytes
(std::initializer_list<uchar> bytes)
13
{
14
return
QByteArray(
reinterpret_cast
<
const
char
*>(bytes.begin()), qsizetype(bytes.size()));
15
}
16
17
void
fillPlaneRows
(uchar *data, qsizetype stride,
int
width,
int
height, QByteArrayView texel)
18
{
19
for
(
int
row = 0; row < height; ++row) {
20
uchar *rowData = data + row * stride;
21
for
(
int
col = 0; col < width; ++col)
22
std::memcpy(rowData + col * texel.size(), texel.constData(), texel.size());
23
}
24
}
25
26
q23
::
expected
<
void
,
QString
>
comparePlaneRows
(
const
uchar *data, qsizetype stride,
int
width,
27
int
height, QByteArrayView texel)
28
{
29
for
(
int
row = 0; row < height; ++row) {
30
const
uchar *rowData = data + row * stride;
31
for
(
int
col = 0; col < width; ++col) {
32
if
(std::memcmp(rowData + col * texel.size(), texel.constData(), texel.size()) != 0)
33
return
q23::unexpected(
34
QStringLiteral(
"mismatch at row %1, column %2"
).arg(row).arg(col));
35
}
36
}
37
return
{};
38
}
39
40
}
// namespace QtMultimediaTest
41
42
QT_END_NAMESPACE
QtMultimediaTest
Definition
framegrabber.cpp:20
QtMultimediaTest::comparePlaneRows
q23::expected< void, QString > comparePlaneRows(const uchar *data, qsizetype stride, int width, int height, QByteArrayView texel)
Definition
qvideoframetestutils.cpp:26
QtMultimediaTest::makeBytes
QByteArray makeBytes(std::initializer_list< uchar > bytes)
Definition
qvideoframetestutils.cpp:12
QtMultimediaTest::fillPlaneRows
void fillPlaneRows(uchar *data, qsizetype stride, int width, int height, QByteArrayView texel)
Definition
qvideoframetestutils.cpp:17
qtmultimedia
src
multimediatestlib
qvideoframetestutils.cpp
Generated on
for Qt by
1.18.0