-
Notifications
You must be signed in to change notification settings - Fork 11
/
gphotocamerafocuscontrol.cpp
66 lines (56 loc) · 1.58 KB
/
gphotocamerafocuscontrol.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include "gphotocamerafocuscontrol.h"
GPhotoCameraFocusControl::GPhotoCameraFocusControl(QObject *parent)
: QCameraFocusControl(parent)
, m_focusMode(QCameraFocus::AutoFocus)
, m_focusPointMode(QCameraFocus::FocusPointAuto)
, m_focusPoint(0.5, 0.5)
{
}
QCameraFocus::FocusModes GPhotoCameraFocusControl::focusMode() const
{
return m_focusMode;
}
void GPhotoCameraFocusControl::setFocusMode(QCameraFocus::FocusModes mode)
{
m_focusMode = mode;
}
bool GPhotoCameraFocusControl::isFocusModeSupported(QCameraFocus::FocusModes mode) const
{
switch (mode) {
case QCameraFocus::AutoFocus:
return true;
default:
return (mode & QCameraFocus::AutoFocus);
}
}
QCameraFocus::FocusPointMode GPhotoCameraFocusControl::focusPointMode() const
{
return m_focusPointMode;
}
void GPhotoCameraFocusControl::setFocusPointMode(QCameraFocus::FocusPointMode mode)
{
if (m_focusPointMode != mode) {
m_focusPointMode = mode;
emit focusPointModeChanged(m_focusPointMode);
emit focusZonesChanged();
}
}
bool GPhotoCameraFocusControl::isFocusPointModeSupported(QCameraFocus::FocusPointMode mode) const
{
return (mode == QCameraFocus::FocusPointAuto);
}
QPointF GPhotoCameraFocusControl::customFocusPoint() const
{
return m_focusPoint;
}
void GPhotoCameraFocusControl::setCustomFocusPoint(const QPointF &point)
{
if (m_focusPoint != point) {
m_focusPoint = point;
emit customFocusPointChanged(m_focusPoint);
}
}
QCameraFocusZoneList GPhotoCameraFocusControl::focusZones() const
{
return QCameraFocusZoneList();
}