QCameraFormat Class

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

Header: #include <QCameraFormat>
CMake: find_package(Qt6 COMPONENTS Multimedia REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)
qmake: QT += multimedia

Public Functions

QCameraFormat(const QCameraFormat &other)
QCameraFormat &operator=(const QCameraFormat &other)
bool isNull() const
float maxFrameRate() const
float minFrameRate() const
QVideoFrameFormat::PixelFormat pixelFormat() const
QSize resolution() const
bool operator!=(const QCameraFormat &other) const
bool operator==(const QCameraFormat &other) const

Detailed Description

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

The format is a combination of a 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 and QCamera.

Member Function Documentation

QCameraFormat::QCameraFormat(const QCameraFormat &other)

Copy constructs a camera format from the other format.


Constructs a null camera format.

See also isNull().

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

Assign other to this.


Destructs the camera format object.

bool QCameraFormat::isNull() const

Returns true if this is a default constructed QCameraFormat.

float QCameraFormat::maxFrameRate() const

Returns the highest frame rate defined by this format.

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

Note: Getter function for property maxFrameRate.

float QCameraFormat::minFrameRate() const

Returns the lowest frame rate defined by this format.

Note: Getter function for property minFrameRate.

QVideoFrameFormat::PixelFormat QCameraFormat::pixelFormat() const

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.

Note: Getter function for property pixelFormat.

See also QVideoFrameFormat::PixelFormat.

QSize QCameraFormat::resolution() const

Returns the resolution.

Note: Getter function for property resolution.

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

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

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

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

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.