Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qcameradevice_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QCAMERAINFO_P_H
5#define QCAMERAINFO_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtMultimedia/qcameradevice.h>
19#include <QtCore/private/qglobal_p.h>
20
21QT_BEGIN_NAMESPACE
22
23class QCameraFormatPrivate : public QSharedData
24{
25public:
26 QVideoFrameFormat::PixelFormat pixelFormat = QVideoFrameFormat::Format_Invalid;
27 QSize resolution;
28 float minFrameRate = 0;
29 float maxFrameRate = 0;
30 QVideoFrameFormat::ColorRange colorRange = QVideoFrameFormat::ColorRange_Unknown;
31 QVideoFrameFormat::ColorSpace colorSpace = QVideoFrameFormat::ColorSpace_Undefined;
32
33 static QVideoFrameFormat::ColorRange getColorRange(const QCameraFormat &format)
34 {
35 auto d = handle(format);
36 return d ? d->colorRange : QVideoFrameFormat::ColorRange_Unknown;
37 }
38
39 static QVideoFrameFormat::ColorSpace getColorSpace(const QCameraFormat &format)
40 {
41 auto d = handle(format);
42 return d ? d->colorSpace : QVideoFrameFormat::ColorSpace_Undefined;
43 }
44
45 static const QCameraFormatPrivate *handle(const QCameraFormat &format)
46 {
47 return format.d.get();
48 }
49
50 QCameraFormat create() { return QCameraFormat(this); }
51};
52
54{
55public:
58 bool isDefault = false;
60 int orientation = 0;
63
64 static const QCameraDevicePrivate *handle(const QCameraDevice &device)
65 {
66 return device.d.data();
67 }
68
69 static QCameraDevicePrivate *handle(QCameraDevice &device) { return device.d.data(); }
70
71 bool operator==(const QCameraDevicePrivate &other) const
72 {
73 return id == other.id && description == other.description && isDefault == other.isDefault
74 && position == other.position && orientation == other.orientation
75 && photoResolutions == other.photoResolutions && videoFormats == other.videoFormats;
76 }
77
78 QCameraDevice create() { return QCameraDevice(this); }
79};
80
81QT_END_NAMESPACE
82
83#endif // QCAMERAINFO_P_H
QCameraDevice create()
QCameraDevice::Position position
QList< QCameraFormat > videoFormats
static QCameraDevicePrivate * handle(QCameraDevice &device)
static const QCameraDevicePrivate * handle(const QCameraDevice &device)
bool operator==(const QCameraDevicePrivate &other) const
QList< QSize > photoResolutions
Combined button and popup list for selecting options.
QDebug operator<<(QDebug d, const QCameraDevice &camera)
QDebug operator<<(QDebug dbg, const QFileInfo &fi)