QCameraFormat Class

QCameraFormat 类描述相机设备支持的视频格式。更多

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

属性

公共功能

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

详细说明

QCameraFormat 表示摄像机设备支持的某种视频格式。

该格式是pixel format 、分辨率和帧频范围的组合。

可通过QCameraDevice 查询 QCameraFormat 对象,以查看支持的视频格式集。

另请参阅 QCameraDeviceQCamera

属性文档

[read-only] maxFrameRate : const float

返回此格式所定义的最高帧频。

摄像机将始终尝试使用特定视频格式所支持的最高帧频。

访问功能:

float maxFrameRate() const

[read-only] minFrameRate : const float

返回此格式定义的最低帧频。

访问功能

float minFrameRate() const

[read-only] pixelFormat : const QVideoFrameFormat::PixelFormat

返回像素格式。

通常是QVideoFrameFormat::Format_Jpeg 或 QVideoFrameFormat::Format_YUVY 格式,但摄像机也可能支持其他格式。

访问函数:

QVideoFrameFormat::PixelFormat pixelFormat() const

另请参阅 QVideoFrameFormat::PixelFormat

[read-only] resolution : const QSize

返回分辨率。

访问函数:

QSize resolution() const

成员函数文档

[noexcept] QCameraFormat::QCameraFormat()

构造空摄像机格式。

另请参见 isNull()。

[noexcept] QCameraFormat::QCameraFormat(const QCameraFormat &other)

other 格式复制构建摄像机格式。

[noexcept] QCameraFormat::~QCameraFormat()

销毁摄像机格式对象。

[noexcept] bool QCameraFormat::isNull() const

如果这是默认构建的QCameraFormat ,则返回 true。

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

如果other 格式等于此摄像机格式,则返回false ,否则返回true

[noexcept] QCameraFormat &QCameraFormat::operator=(const QCameraFormat &other)

为此指定other

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

如果other 格式等于此摄像机格式,则返回true ,否则返回false

© 2025 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.