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.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 QCAMERAINFO_H
5#define QCAMERAINFO_H
6
7#include <QtCore/qshareddata.h>
8#include <QtMultimedia/qtvideo.h>
9#include <QtMultimedia/qvideoframe.h>
10
11QT_BEGIN_NAMESPACE
12
13class QDebug;
14class QCameraFormatPrivate;
15class Q_MULTIMEDIA_EXPORT QCameraFormat
16{
17 Q_GADGET
18 Q_PROPERTY(QSize resolution READ resolution CONSTANT)
19 Q_PROPERTY(QVideoFrameFormat::PixelFormat pixelFormat READ pixelFormat CONSTANT)
20 Q_PROPERTY(float minFrameRate READ minFrameRate CONSTANT)
21 Q_PROPERTY(float maxFrameRate READ maxFrameRate CONSTANT)
22public:
23 QCameraFormat() noexcept;
24 QCameraFormat(const QCameraFormat &other) noexcept;
25 QCameraFormat &operator=(const QCameraFormat &other) noexcept;
26 ~QCameraFormat();
27
28 QVideoFrameFormat::PixelFormat pixelFormat() const noexcept;
29 QSize resolution() const noexcept;
30 float minFrameRate() const noexcept;
31 float maxFrameRate() const noexcept;
32
33 bool isNull() const noexcept { return !d; }
34
35 bool operator==(const QCameraFormat &other) const;
36 inline bool operator!=(const QCameraFormat &other) const
37 { return !operator==(other); }
38
39private:
40 friend class QCameraFormatPrivate;
41 QCameraFormat(QCameraFormatPrivate *p);
42 QExplicitlySharedDataPointer<QCameraFormatPrivate> d;
43
44#ifndef QT_NO_DEBUG_STREAM
45 Q_MULTIMEDIA_EXPORT friend QDebug operator<<(QDebug, const QCameraFormat&);
46#endif
47};
48
50class Q_MULTIMEDIA_EXPORT QCameraDevice
51{
52 Q_GADGET
53 Q_PROPERTY(QByteArray id READ id CONSTANT)
54 Q_PROPERTY(QString description READ description CONSTANT)
55 Q_PROPERTY(bool isDefault READ isDefault CONSTANT)
56 Q_PROPERTY(Position position READ position CONSTANT)
57 Q_PROPERTY(QList<QCameraFormat> videoFormats READ videoFormats CONSTANT)
58 Q_PROPERTY(QtVideo::Rotation correctionAngle READ correctionAngle CONSTANT)
59public:
60 QCameraDevice();
61 QCameraDevice(const QCameraDevice& other);
62 QCameraDevice& operator=(const QCameraDevice& other);
63 ~QCameraDevice();
64
65 bool operator==(const QCameraDevice &other) const;
66 inline bool operator!=(const QCameraDevice &other) const;
67
68 bool isNull() const;
69
70 QByteArray id() const;
71 QString description() const;
72
73 // ### Add here and to QAudioDevice
74// QByteArray groupId() const;
75// QString groupDescription() const;
76
77 bool isDefault() const;
78
79 enum Position
80 {
81 UnspecifiedPosition,
82 BackFace,
83 FrontFace
84 };
85 Q_ENUM(Position)
86
87 Position position() const;
88
89 QList<QSize> photoResolutions() const;
90 QList<QCameraFormat> videoFormats() const;
91
92 QtVideo::Rotation correctionAngle() const;
93 // ### Add zoom and other camera information
94
95private:
96 friend class QCameraDevicePrivate;
97 QCameraDevice(QCameraDevicePrivate *p);
98 QExplicitlySharedDataPointer<QCameraDevicePrivate> d;
99};
100
101bool QCameraDevice::operator!=(const QCameraDevice &other) const { return !operator==(other); }
102
103#ifndef QT_NO_DEBUG_STREAM
104Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QCameraDevice&);
105#endif
106
107QT_END_NAMESPACE
108
109#endif // QCAMERAINFO_H
The QCameraDevice class provides general information about camera devices.
The QCameraFormat class describes a video format supported by a camera device. \inmodule QtMultimedia...
QCameraDevice cameraDevice
Definition qcamera_p.h:36
QMediaCaptureSession * captureSession
Definition qcamera_p.h:33
QPlatformCamera * control
Definition qcamera_p.h:34
QCameraFormat cameraFormat
Definition qcamera_p.h:37
The QCamera class provides interface for system camera devices.
Definition qcamera.h:25
Combined button and popup list for selecting options.
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2582