QCameraFormat Class
QCameraFormat 类描述了相机设备支持的一种视频格式。更多内容...
| 头文件: | #include <QCameraFormat> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Multimedia) target_link_libraries(mytarget PRIVATE Qt6::Multimedia) |
| qmake: | QT += multimedia |
| 在 QML 中: | cameraFormat |
属性
- maxFrameRate : const float
- minFrameRate : const float
- pixelFormat : const QVideoFrameFormat::PixelFormat
- resolution : const QSize
公共函数
| 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 对象,以查看支持的视频格式集。
另请参阅 QCameraDevice 和QCamera 。
属性文档
[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)
Copy 根据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 。
© 2026 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.