Qt 6.x
The Qt SDK
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/qvideoframe.h>
8#include <QtCore/qsharedpointer.h>
9
11
13class Q_MULTIMEDIA_EXPORT QCameraFormat
14{
16 Q_PROPERTY(QSize resolution READ resolution CONSTANT)
17 Q_PROPERTY(QVideoFrameFormat::PixelFormat pixelFormat READ pixelFormat CONSTANT)
18 Q_PROPERTY(float minFrameRate READ minFrameRate CONSTANT)
19 Q_PROPERTY(float maxFrameRate READ maxFrameRate CONSTANT)
20public:
21 QCameraFormat() noexcept;
23 QCameraFormat &operator=(const QCameraFormat &other) noexcept;
25
26 QVideoFrameFormat::PixelFormat pixelFormat() const noexcept;
27 QSize resolution() const noexcept;
28 float minFrameRate() const noexcept;
29 float maxFrameRate() const noexcept;
30
31 bool isNull() const noexcept { return !d; }
32
33 bool operator==(const QCameraFormat &other) const;
34 inline bool operator!=(const QCameraFormat &other) const
35 { return !operator==(other); }
36
37private:
41};
42
44class Q_MULTIMEDIA_EXPORT QCameraDevice
45{
47 Q_PROPERTY(QByteArray id READ id CONSTANT)
48 Q_PROPERTY(QString description READ description CONSTANT)
49 Q_PROPERTY(bool isDefault READ isDefault CONSTANT)
51 Q_PROPERTY(QList<QCameraFormat> videoFormats READ videoFormats CONSTANT)
52public:
57
58 bool operator==(const QCameraDevice &other) const;
59 inline bool operator!=(const QCameraDevice &other) const;
60
61 bool isNull() const;
62
63 QByteArray id() const;
64 QString description() const;
65
66 // ### Add here and to QAudioDevice
67// QByteArray groupId() const;
68// QString groupDescription() const;
69
70 bool isDefault() const;
71
73 {
76 FrontFace
77 };
78 Q_ENUM(Position)
79
80 Position position() const;
81
82 QList<QSize> photoResolutions() const;
83 QList<QCameraFormat> videoFormats() const;
84
85 // ### Add zoom and other camera information
86
87private:
91};
92
94
95#ifndef QT_NO_DEBUG_STREAM
96Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QCameraDevice&);
97#endif
98
100
101#endif // QCAMERAINFO_H
\inmodule QtCore
Definition qbytearray.h:57
The QCameraDevice class provides general information about camera devices.
QCameraDevice(const QCameraDevice &other)
Constructs a copy of other.
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.
QCameraDevice()
Describes a camera device.
Position
This enum specifies the physical position of the camera on the system hardware.
QCameraDevice & operator=(const QCameraDevice &other)
Sets the QCameraDevice object to be equal to other.
~QCameraDevice()
Destroys the QCameraDevice.
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.
QCameraFormat() noexcept
Describes a video format supported by a camera device.
\inmodule QtCore
Definition qlist.h:74
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
The QVideoFrameFormat class specifies the stream format of a video presentation surface.
PixelFormat
Enumerates video data types.
Combined button and popup list for selecting options.
Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QCameraDevice &)
constexpr bool operator!=(const timespec &t1, const timespec &t2)
GLenum GLuint id
[7]
GLfloat GLfloat p
[1]
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
Definition qrandom.cpp:1219
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_GADGET
QSharedPointer< T > other(t)
[5]