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

The QCameraFormat class describes a video format supported by a camera device. \inmodule QtMultimedia. More...

#include <qcameradevice.h>

+ Collaboration diagram for QCameraFormat:

Public Member Functions

 QCameraFormat () noexcept
 Describes a video format supported by a camera device.
 
 QCameraFormat (const QCameraFormat &other) noexcept
 Copy constructs a camera format from the other format.
 
QCameraFormatoperator= (const QCameraFormat &other) noexcept
 Assign other to this.
 
 ~QCameraFormat ()
 Destructs the camera format object.
 
QVideoFrameFormat::PixelFormat pixelFormat () const noexcept
 
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
 \qmlproperty enumeration QtMultimedia::cameraFormat::pixelFormat
 
float minFrameRate
 \qmlproperty real QtMultimedia::cameraFormat::minFrameRate
 
float maxFrameRate
 \qmlproperty real QtMultimedia::cameraFormat::maxFrameRate
 

Friends

class QCameraFormatPrivate
 

Detailed Description

The QCameraFormat class describes a video format supported by a camera device. \inmodule QtMultimedia.

Since
6.2

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

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

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

See also
QCameraDevice, QCamera

Definition at line 14 of file qcameradevice.h.

Constructor & Destructor Documentation

◆ QCameraFormat() [1/2]

QCameraFormat::QCameraFormat ( )
defaultnoexcept

Describes a video format supported by a camera device.

\qmlvaluetype cameraFormat
\ingroup qmlvaluetypes
\inqmlmodule QtMultimedia
\since 6.2

! \instantiates QCameraFormat

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

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

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 32 of file qcameradevice.h.

References d.

Referenced by QV4L2Camera::setActive(), QWindowsCamera::setActive(), AVFCamera::setCameraFormat(), QAVFCameraBase::setCameraFormat(), QAVFCamera::setCameraFormat(), and QAndroidCamera::setCaptureSession().

+ Here is the caller graph for this function:

◆ maxFrameRate()

float QCameraFormat::maxFrameRate ( ) const
noexcept

Definition at line 155 of file qcameradevice.cpp.

References QCameraFormatPrivate::maxFrameRate.

◆ minFrameRate()

float QCameraFormat::minFrameRate ( ) const
noexcept

Definition at line 133 of file qcameradevice.cpp.

References QCameraFormatPrivate::minFrameRate.

◆ 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 35 of file qcameradevice.h.

References operator==(), and other().

+ Here is the call graph for this function:

◆ 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.

Definition at line 171 of file qcameradevice.cpp.

References QCameraFormatPrivate::maxFrameRate, QCameraFormatPrivate::minFrameRate, other(), QCameraFormatPrivate::pixelFormat, and QCameraFormatPrivate::resolution.

+ Here is the call graph for this function:

◆ pixelFormat()

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

Definition at line 101 of file qcameradevice.cpp.

References d, QVideoFrameFormat::Format_Invalid, and pixelFormat.

◆ resolution()

QSize QCameraFormat::resolution ( ) const
noexcept

Definition at line 117 of file qcameradevice.cpp.

References QCameraFormatPrivate::resolution.

Friends And Related Symbol Documentation

◆ QCameraFormatPrivate

friend class QCameraFormatPrivate
friend

Definition at line 39 of file qcameradevice.h.

Property Documentation

◆ maxFrameRate

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 20 of file qcameradevice.h.

Referenced by QPlatformCamera::frameFormat().

◆ minFrameRate

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 19 of file qcameradevice.h.

◆ pixelFormat

QCameraFormat::pixelFormat
read

\qmlproperty enumeration QtMultimedia::cameraFormat::pixelFormat

Holds the pixel format.

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

See also
QVideoFrameFormat::PixelFormat

Returns the pixel format.

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

See also
QVideoFrameFormat::PixelFormat

Definition at line 18 of file qcameradevice.h.

Referenced by QPlatformCamera::findBestCameraFormat(), QPlatformCamera::frameFormat(), and pixelFormat().

◆ resolution

QCameraFormat::resolution
read

\qmlproperty size QtMultimedia::cameraFormat::resolution

Returns the resolution.

Returns the resolution.

Definition at line 17 of file qcameradevice.h.

Referenced by QPlatformCamera::frameFormat().


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