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.cpp
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#include "qcameradevice_p.h"
5
6#include "qcamera_p.h"
7
9
10
37
58QCameraFormat::QCameraFormat() noexcept = default;
59
63QCameraFormat::QCameraFormat(const QCameraFormat &other) noexcept = default;
64
68QCameraFormat &QCameraFormat::operator=(const QCameraFormat &other) noexcept = default;
69
73QCameraFormat::~QCameraFormat() = default;
74
101QVideoFrameFormat::PixelFormat QCameraFormat::pixelFormat() const noexcept
102{
104}
105
118{
119 return d ? d->resolution : QSize();
120}
121
133float QCameraFormat::minFrameRate() const noexcept
134{
135 return d ? d->minFrameRate : 0;
136}
137
155float QCameraFormat::maxFrameRate() const noexcept
156{
157 return d ? d->maxFrameRate : 0;
158}
159
164 : d(p)
165{
166}
167
172{
173 if (d == other.d)
174 return true;
175 if (!d || !other.d)
176 return false;
177 return d->pixelFormat == other.d->pixelFormat &&
178 d->minFrameRate == other.d->minFrameRate &&
179 d->maxFrameRate == other.d->maxFrameRate &&
180 d->resolution == other.d->resolution;
181}
182
225
252
257
262
267{
268 if (d == other.d)
269 return true;
270
271 if (!d || ! other.d)
272 return false;
273
274 return (d->id == other.d->id
275 && d->description == other.d->description
276 && d->position == other.d->position);
277}
278
283{
284 return !d;
285}
286
303{
304 return d ? d->id : QByteArray();
305}
306
319{
320 return d ? d->isDefault : false;
321}
322
354
371{
372 return d ? d->description : QString();
373}
374
412
420{
421 return d ? d->photoResolutions : QList<QSize>{};
422}
423
435QList<QCameraFormat> QCameraDevice::videoFormats() const
436{
437 return d ? d->videoFormats : QList<QCameraFormat>{};
438}
439
441 : d(p)
442{}
443
448
455#ifndef QT_NO_DEBUG_STREAM
457{
458 d.maybeSpace() << QStringLiteral("QCameraDevice(name=%1, position=%2, orientation=%3)")
459 .arg(camera.description())
460 .arg(QString::fromLatin1(QCamera::staticMetaObject.enumerator(QCamera::staticMetaObject.indexOfEnumerator("Position"))
461 .valueToKey(camera.position())));
462 return d.space();
463}
464#endif
465
467
468#include "moc_qcameradevice.cpp"
\inmodule QtCore
Definition qbytearray.h:57
QCameraDevice::Position position
QList< QCameraFormat > videoFormats
QList< QSize > photoResolutions
The QCameraDevice class provides general information about camera devices.
QList< QSize > photoResolutions() const
Returns a list of resolutions that the camera can use to capture still images.
QtVideo::Rotation correctionAngle
Position position
\qmlproperty enumeration QtMultimedia::cameraDevice::position
bool isNull() const
Returns true if this QCameraDevice is null or invalid.
bool operator==(const QCameraDevice &other) const
Returns true if this QCameraDevice is equal to other.
QString description
\qmlproperty string QtMultimedia::cameraDevice::description
QCameraDevice()
Describes a camera device.
QList< QCameraFormat > videoFormats
\qmlproperty CameraFormat QtMultimedia::cameraDevice::videoFormats
QByteArray id
\qmlproperty string QtMultimedia::cameraDevice::id
bool isDefault
\qmlproperty bool QtMultimedia::cameraDevice::isDefault
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.
QVideoFrameFormat::PixelFormat pixelFormat
The QCameraFormat class describes a video format supported by a camera device. \inmodule QtMultimedia...
QSize resolution
\qmlproperty size QtMultimedia::cameraFormat::resolution
float minFrameRate
\qmlproperty real QtMultimedia::cameraFormat::minFrameRate
QVideoFrameFormat::PixelFormat pixelFormat
\qmlproperty enumeration QtMultimedia::cameraFormat::pixelFormat
bool operator==(const QCameraFormat &other) const
Returns true if the other format is equal to this camera format, otherwise false.
float maxFrameRate
\qmlproperty real QtMultimedia::cameraFormat::maxFrameRate
QCameraFormat() noexcept
Describes a video format supported by a camera device.
\inmodule QtCore
\inmodule QtCore
Definition qsize.h:25
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5871
The QVideoFrameFormat class specifies the stream format of a video presentation surface.
QCamera * camera
Definition camera.cpp:19
Combined button and popup list for selecting options.
QDebug operator<<(QDebug d, const QCameraDevice &camera)
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
GLfloat GLfloat p
[1]
#define QStringLiteral(str)
QSharedPointer< T > other(t)
[5]