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
QCameraFormat Class Reference

#include <qcameradevice.h>

Collaboration diagram for QCameraFormat:

Public Member Functions

 QCameraFormat () noexcept
 \qmlvaluetype cameraFormat\inqmlmodule QtMultimedia
 QCameraFormat (const QCameraFormat &other) noexcept
 Copy constructs a camera format from the other format.
QCameraFormat & operator= (const QCameraFormat &other) noexcept
 Assign other to this.
 ~QCameraFormat ()
 Destructs the camera format object.
QVideoFrameFormat::PixelFormat pixelFormat () const noexcept
 \qmlproperty enumeration QtMultimedia::cameraFormat::pixelFormat
QSize resolution () const noexcept
float minFrameRate () const noexcept
float maxFrameRate () const noexcept
bool isNull () const noexcept
 Returns true if this is a default constructed QCameraFormat.
bool operator== (const QCameraFormat &other) const
 Returns true if the other format is equal to this camera format, otherwise false.
bool operator!= (const QCameraFormat &other) const
 Returns false if the other format is equal to this camera format, otherwise true.

Properties

QSize resolution
 \qmlproperty size QtMultimedia::cameraFormat::resolution
QVideoFrameFormat::PixelFormat pixelFormat
float minFrameRate
 \qmlproperty real QtMultimedia::cameraFormat::minFrameRate
float maxFrameRate
 \qmlproperty real QtMultimedia::cameraFormat::maxFrameRate

Friends

class QCameraFormatPrivate
Q_MULTIMEDIA_EXPORT friend QDebug operator<< (QDebug d, const QCameraFormat &formatformat)

Detailed Description

Definition at line 15 of file qcameradevice.h.

Constructor & Destructor Documentation

◆ QCameraFormat() [1/2]

QCameraFormat::QCameraFormat ( )
defaultnoexcept

\qmlvaluetype cameraFormat\inqmlmodule QtMultimedia

\class QCameraFormat
\since 6.2
\brief The QCameraFormat class describes a video format supported by a camera device.
\inmodule QtMultimedia
\ingroup multimedia
\ingroup multimedia_camera

QCameraFormat represents a certain video format supported by a camera device.

! [format-description] The format is a combination of a \l{QVideoFrameFormat::PixelFormat}{pixel format}, resolution and a range of frame rates. ! [format-description]

QCameraFormat objects can be queried from QCameraDevice to inspect the set of
supported video formats.

\sa QCameraDevice, QCamera
Since
6.2 \nativetype QCameraFormat

Describes a video format supported by a camera device.

cameraFormat represents a certain video format supported by a camera device.

format-description

cameraFormat objects can be queried from \l cameraDevice to inspect the set of supported video formats.

See also
cameraDevice, Camera

Constructs a null camera format.

See also
isNull()

◆ QCameraFormat() [2/2]

QCameraFormat::QCameraFormat ( const QCameraFormat & other)
defaultnoexcept

Copy constructs a camera format from the other format.

◆ ~QCameraFormat()

QCameraFormat::~QCameraFormat ( )
default

Destructs the camera format object.

Member Function Documentation

◆ isNull()

bool QCameraFormat::isNull ( ) const
inlinenoexcept

Returns true if this is a default constructed QCameraFormat.

Definition at line 33 of file qcameradevice.h.

◆ maxFrameRate()

float QCameraFormat::maxFrameRate ( ) const
noexcept

Definition at line 166 of file qcameradevice.cpp.

◆ minFrameRate()

float QCameraFormat::minFrameRate ( ) const
noexcept

Definition at line 144 of file qcameradevice.cpp.

◆ operator!=()

bool QCameraFormat::operator!= ( const QCameraFormat & other) const
inline

Returns false if the other format is equal to this camera format, otherwise true.

Definition at line 36 of file qcameradevice.h.

◆ operator=()

QCameraFormat & QCameraFormat::operator= ( const QCameraFormat & other)
defaultnoexcept

Assign other to this.

◆ operator==()

bool QCameraFormat::operator== ( const QCameraFormat & other) const

Returns true if the other format is equal to this camera format, otherwise false.

Frame rates are compared with a small relative tolerance, since camera devices can report the same frame rate with slightly different floating-point values.

Definition at line 192 of file qcameradevice.cpp.

◆ pixelFormat()

QVideoFrameFormat::PixelFormat QCameraFormat::pixelFormat ( ) const
noexcept

\qmlproperty enumeration QtMultimedia::cameraFormat::pixelFormat

Holds the pixel format.

Most commonly this is either QVideoFrameFormat::Format_Jpeg or QVideoFrameFormat::Format_YUYV but other formats could also be supported by the camera.

android-yuv-note

See also
QVideoFrameFormat::PixelFormat
\property QCameraFormat::pixelFormat

Returns the pixel format.

Most commonly this is either QVideoFrameFormat::Format_Jpeg or QVideoFrameFormat::Format_YUYV
but other formats could also be supported by the camera.

! [android-yuv-note]

Note
On Android with the FFmpeg media backend, camera formats are reported as QVideoFrameFormat::Format_YUV420P, but the delivered video frames can be either fully planar YUV420P or semi-planar NV12 or NV21. The memory layout is chosen by the camera implementation of the device, and Android provides no way to query it in advance. Check the pixel format of the received video frames instead. ! [android-yuv-note]
\sa QVideoFrameFormat::PixelFormat

Definition at line 112 of file qcameradevice.cpp.

◆ resolution()

QSize QCameraFormat::resolution ( ) const
noexcept

Definition at line 128 of file qcameradevice.cpp.

◆ operator<<

Q_MULTIMEDIA_EXPORT friend QDebug operator<< ( QDebug d,
const QCameraFormat & format )
friend

Definition at line 505 of file qcameradevice.cpp.

◆ QCameraFormatPrivate

friend class QCameraFormatPrivate
friend

Definition at line 40 of file qcameradevice.h.

Property Documentation

◆ maxFrameRate

float QCameraFormat::maxFrameRate
read

\qmlproperty real QtMultimedia::cameraFormat::maxFrameRate

Returns the highest frame rate defined by this format.

The camera will always try to use the maximum frame rate supported by a certain video format.

Returns the highest frame rate defined by this format.

The camera will always try to use the highest frame rate supported by a certain video format.

Definition at line 21 of file qcameradevice.h.

◆ minFrameRate

float QCameraFormat::minFrameRate
read

\qmlproperty real QtMultimedia::cameraFormat::minFrameRate

Returns the lowest frame rate defined by this format.

Returns the lowest frame rate defined by this format.

Definition at line 20 of file qcameradevice.h.

◆ pixelFormat

QVideoFrameFormat::PixelFormat QCameraFormat::pixelFormat
read

Definition at line 19 of file qcameradevice.h.

◆ resolution

QSize QCameraFormat::resolution
read

\qmlproperty size QtMultimedia::cameraFormat::resolution

Returns the resolution.

Returns the resolution.

Definition at line 18 of file qcameradevice.h.


The documentation for this class was generated from the following files: