QtMultiMedia 之 CameraFocus
2016-02-27 11:39
645 查看
QtMultiMedia 之 CameraFocus
翻译:qyvlik5.5.1
用来控制相机焦点的接口
属性
customFocusPoint:
point
focusMode:
enumeration
focusPointMode:
enumeration
focusZones:
list<focusZone>
方法
bool isFocusModeSupported(mode)
bool isFocusPointModeSupported(mode)
详细描述
This type allows control over manual and automatic focus settings, including information about any parts of the camera frame that are selected for autofocusing.此类可以设置手动调焦或者自动聚焦。
It should not be constructed separately, instead the focus property of a Camera should be used.
不可直接创建,只能通过
Camera::focus对象访问。
[code]Item { width: 640 height: 360 Camera { id: camera focus { focusMode: Camera.FocusMacro focusPointMode: Camera.FocusPointCustom customFocusPoint: Qt.point(0.2, 0.2) // Focus relative to top-left corner } } VideoOutput { source: camera anchors.fill: parent } }
属性文档
customFocusPoint:
point
This property holds the position of custom focus point, in relative frame coordinates: QPointF(0,0) points to the left top frame point, QPointF(0.5,0.5) points to the frame center.
Custom focus point is used only in FocusPointCustom focus mode.
自定义焦点位置,与帧的坐标相关,
QPointF(0, 0)表示帧的左上角,
QPointF(0.5, 0.5)表示帧的中点。
自定义焦点只能在
FocusPointCustom模式下起作用。
focusMode:
enumeration
This property holds the current camera focus mode, which can be one of the following values:
Value | Description |
---|---|
FocusManual | Manual or fixed focus mode. |
FocusHyperfocal | Focus to hyperfocal distance, with the maximum depth of field achieved. All objects at distances from half of this distance out to infinity will be acceptably sharp. |
FocusInfinity | Focus strictly to infinity. |
FocusAuto | One-shot auto focus mode. |
FocusContinuous | Continuous auto focus mode. |
FocusMacro | One shot auto focus to objects close to camera. |
值 | 描述 |
---|---|
FocusManual | 手动模式 |
FocusHyperfocal | Focus to hyperfocal distance, with the maximum depth of field achieved. All objects at distances from half of this distance out to infinity will be acceptably sharp. |
FocusInfinity | Focus strictly to infinity. |
FocusAuto | One-shot auto focus mode. |
FocusContinuous | Continuous auto focus mode. |
FocusMacro | One shot auto focus to objects close to camera. |
Camera::FocusModevalues, for example
Camera.FocusMacro+
Camera.FocusContinuous.
可以将多个
Camera::FocusMode联合起来,例如
Camera.FocusMacro+
Camera.FocusContinuous。(话说不是使用
|?)
In automatic focusing modes, the focusPointMode property and focusZones property provide information and control over how automatic focusing is performed.
在自动聚焦模式下,
focusPointMode和
focusZones为更好地聚焦提供了必要的信息。
focusPointMode:
enumeration
This property holds the current camera focus point mode. It is used in automatic focusing modes to determine what to focus on. If the current focus point mode is
Camera.FocusPointCustom, the
customFocusPointproperty allows you to specify which part of the frame to focus on.
点聚焦模式,默认使用自动聚焦模式来自行决定使用何种点聚焦模式。如果使用处于自定义点聚焦模式,
customFocusPoint属性允许为每一帧图像执行特定的聚焦点。
The property can take one of the following values:
Value | Description |
---|---|
FocusPointAuto | Automatically select one or multiple focus points. |
FocusPointCenter | Focus to the frame center. |
FocusPointFaceDetection | Focus on faces in the frame. |
FocusPointCustom | Focus to the custom point, defined by the customFocusPoint property. |
值 | 描述 |
---|---|
FocusPointAuto | 自动点聚焦模式 |
FocusPointCenter | 中点聚焦模式 |
FocusPointFaceDetection | 人脸识别点聚焦模式 |
FocusPointCustom | 自定义点聚焦模式 |
focusZones:
list<focusZone>
This property holds the list of current camera focus zones, each including area specified in the same coordinates as customFocusPoint, and zone status as one of the following values:
聚焦区域,每一个包含
customFocusPoint的区域,可能的值如下:
Value | Description |
---|---|
Camera.FocusAreaUnused | This focus point area is currently unused in autofocusing. |
Camera.FocusAreaSelected | This focus point area is used in autofocusing, but is not in focus. |
Camera.FocusAreaFocused | This focus point is used in autofocusing, and is in focus. |
值 | 描述 |
---|---|
Camera.FocusAreaUnused | 自动聚焦时未使用到此区域。 |
Camera.FocusAreaSelected | 自动聚焦时使用到此区域,但是还未对区域聚焦。 |
Camera.FocusAreaFocused | 自动聚焦时使用到此区域,且进行了聚焦。 |
[code]VideoOutput { id: viewfinder source: camera //display focus areas on camera viewfinder: Repeater { model: camera.focus.focusZones Rectangle { border { width: 2 color: status == Camera.FocusAreaFocused ? "green" : "white" } color: "transparent" // Map from the relative, normalized frame coordinates property variant mappedRect: viewfinder.mapNormalizedRectToItem(area); x: mappedRect.x y: mappedRect.y width: mappedRect.width height: mappedRect.height } } }
方法文档
bool isFocusModeSupported(mode) const
Returns true if the supplied mode is a supported focus mode, and false otherwise.
检查某对焦模式是否可以使用。
bool isFocusPointModeSupported(mode) const
Returns true if the supplied mode is a supported focus point mode, and false otherwise.
检查某聚焦点模式是否可以使用。
相关文章推荐
- QtMultiMedia 之 CameraImageProcessing
- QML 中的 Qt.include
- Qtcreator中经常使用快捷键总结
- 在ubuntu系统安装配置QT
- win7下安装QT开源库qwt
- 五子棋评分表算法
- QT自定义窗口标题栏实现拖动双击放大缩小
- [视觉算法] 妙算上cuda、opencv以及qt的配置
- qt线程,线程池用到的一点问题
- pyqt中使用matplotlib绘制动态曲线
- Qt国际化
- Qt遍历控件
- Qt获得焦点和失去焦点处理事件 (Focus事件)
- Qt::WA_DeleteOnClose 造成的野指针问题
- Qt5中用QLCDNumber显示时间
- QT 为按钮添加事件
- QT SSL OpenSSL https
- Qt 5.4错误"qt.network.ssl: QSslSocket: cannot call"
- 使用QTextCodec/QString/QByteArray/std::string时中文编码问题
- 使用QTextCodec/QString/QByteArray/std::string时中文编码问题