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
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 <QtMultimedia/qtvideo.h>
8#include <QtMultimedia/qvideoframe.h>
9#include <QtCore/qsharedpointer.h>
10
12
14class Q_MULTIMEDIA_EXPORT QCameraFormat
15{
17 Q_PROPERTY(QSize resolution READ resolution CONSTANT)
18 Q_PROPERTY(QVideoFrameFormat::PixelFormat pixelFormat READ pixelFormat CONSTANT)
19 Q_PROPERTY(float minFrameRate READ minFrameRate CONSTANT)
20 Q_PROPERTY(float maxFrameRate READ maxFrameRate CONSTANT)
21public:
22 QCameraFormat() noexcept;
24 QCameraFormat &operator=(const QCameraFormat &other) noexcept;
26
27 QVideoFrameFormat::PixelFormat pixelFormat() const noexcept;
28 QSize resolution() const noexcept;
29 float minFrameRate() const noexcept;
30 float maxFrameRate() const noexcept;
31
32 bool isNull() const noexcept { return !d; }
33
34 bool operator==(const QCameraFormat &other) const;
35 inline bool operator!=(const QCameraFormat &other) const
36 { return !operator==(other); }
37
38private:
41 QExplicitlySharedDataPointer<QCameraFormatPrivate> d;
42};
43
45class Q_MULTIMEDIA_EXPORT QCameraDevice
46{
48 Q_PROPERTY(QByteArray id READ id CONSTANT)
49 Q_PROPERTY(QString description READ description CONSTANT)
50 Q_PROPERTY(bool isDefault READ isDefault CONSTANT)
52 Q_PROPERTY(QList<QCameraFormat> videoFormats READ videoFormats CONSTANT)
53 Q_PROPERTY(QtVideo::Rotation correctionAngle READ correctionAngle CONSTANT)
54public:
57 QCameraDevice& operator=(const QCameraDevice& other);
59
60 bool operator==(const QCameraDevice &other) const;
61 inline bool operator!=(const QCameraDevice &other) const;
62
63 bool isNull() const;
64
65 QByteArray id() const;
66 QString description() const;
67
68 // ### Add here and to QAudioDevice
69// QByteArray groupId() const;
70// QString groupDescription() const;
71
72 bool isDefault() const;
73
75 {
78 FrontFace
79 };
80 Q_ENUM(Position)
81
82 Position position() const;
83
84 QList<QSize> photoResolutions() const;
85 QList<QCameraFormat> videoFormats() const;
86
87 QtVideo::Rotation correctionAngle() const;
88 // ### Add zoom and other camera information
89
90private:
93 QExplicitlySharedDataPointer<QCameraDevicePrivate> d;
94};
95
97
98#ifndef QT_NO_DEBUG_STREAM
99Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QCameraDevice&);
100#endif
101
103
104#endif // QCAMERAINFO_H
\inmodule QtCore
Definition qbytearray.h:57
The QCameraDevice class provides general information about camera devices.
bool operator!=(const QCameraDevice &other) const
Returns true if this QCameraDevice is different from other.
bool operator==(const QCameraDevice &other) const
Returns true if this QCameraDevice is equal to other.
Position
This enum specifies the physical position of the camera on the system hardware.
The QCameraFormat class describes a video format supported by a camera device. \inmodule QtMultimedia...
bool operator!=(const QCameraFormat &other) const
Returns false if the other format is equal to this camera format, otherwise true.
\inmodule QtCore
Definition qlist.h:75
\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.
Combined button and popup list for selecting options.
Enumerations for camera and video functionality.
Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QCameraDevice &)
GLfloat GLfloat p
[1]
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1220
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_GADGET
QSharedPointer< T > other(t)
[5]