Moved zoom related properties out of QCameraFocusControl
Change-Id: I16f9b80ebbacc0b325530e81c291dc030763b65e Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
817fb006c7
commit
155c48b97e
@@ -51,14 +51,9 @@ class MockCameraFocusControl : public QCameraFocusControl
|
||||
public:
|
||||
MockCameraFocusControl(QObject *parent = 0):
|
||||
QCameraFocusControl(parent),
|
||||
m_opticalZoom(1.0),
|
||||
m_digitalZoom(1.0),
|
||||
m_focusMode(QCameraFocus::AutoFocus),
|
||||
m_focusPointMode(QCameraFocus::FocusPointAuto),
|
||||
m_focusPoint(0.5, 0.5),
|
||||
m_maxOpticalZoom(3.0),
|
||||
m_maxDigitalZoom(4.0)
|
||||
|
||||
m_focusPoint(0.5, 0.5)
|
||||
{
|
||||
m_zones << QCameraFocusZone(QRectF(0.45, 0.45, 0.1, 0.1));
|
||||
}
|
||||
@@ -81,45 +76,6 @@ public:
|
||||
return mode == QCameraFocus::AutoFocus || mode == QCameraFocus::ContinuousFocus;
|
||||
}
|
||||
|
||||
qreal maximumOpticalZoom() const
|
||||
{
|
||||
return m_maxOpticalZoom;
|
||||
}
|
||||
|
||||
qreal maximumDigitalZoom() const
|
||||
{
|
||||
return m_maxDigitalZoom;
|
||||
}
|
||||
|
||||
qreal opticalZoom() const
|
||||
{
|
||||
return m_opticalZoom;
|
||||
}
|
||||
|
||||
qreal digitalZoom() const
|
||||
{
|
||||
return m_digitalZoom;
|
||||
}
|
||||
|
||||
void zoomTo(qreal optical, qreal digital)
|
||||
{
|
||||
optical = qBound<qreal>(1.0, optical, maximumOpticalZoom());
|
||||
digital = qBound<qreal>(1.0, digital, maximumDigitalZoom());
|
||||
|
||||
if (!qFuzzyCompare(digital, m_digitalZoom)) {
|
||||
m_digitalZoom = digital;
|
||||
emit digitalZoomChanged(m_digitalZoom);
|
||||
}
|
||||
|
||||
if (!qFuzzyCompare(optical, m_opticalZoom)) {
|
||||
m_opticalZoom = optical;
|
||||
emit opticalZoomChanged(m_opticalZoom);
|
||||
}
|
||||
|
||||
maxOpticalDigitalZoomChange(4.0, 5.0);
|
||||
focusZonesChange(0.50, 0.50, 0.3, 0.3);
|
||||
}
|
||||
|
||||
QCameraFocus::FocusPointMode focusPointMode() const
|
||||
{
|
||||
return m_focusPointMode;
|
||||
@@ -151,6 +107,7 @@ public:
|
||||
void setCustomFocusPoint(const QPointF &point)
|
||||
{
|
||||
m_focusPoint = point;
|
||||
focusZonesChange(0.50, 0.50, 0.3, 0.3);
|
||||
}
|
||||
|
||||
QCameraFocusZoneList focusZones() const
|
||||
@@ -158,20 +115,6 @@ public:
|
||||
return m_zones;
|
||||
}
|
||||
|
||||
// helper function to emit maximum Optical and Digital Zoom Changed signals
|
||||
void maxOpticalDigitalZoomChange(qreal maxOptical, qreal maxDigital)
|
||||
{
|
||||
if (maxOptical != m_maxOpticalZoom) {
|
||||
m_maxOpticalZoom = maxOptical;
|
||||
emit maximumOpticalZoomChanged(m_maxOpticalZoom);
|
||||
}
|
||||
|
||||
if (maxDigital != m_maxDigitalZoom) {
|
||||
m_maxDigitalZoom = maxDigital;
|
||||
emit maximumDigitalZoomChanged(m_maxDigitalZoom);
|
||||
}
|
||||
}
|
||||
|
||||
// helper function to emit Focus Zones Changed signals
|
||||
void focusZonesChange(qreal left, qreal top, qreal width, qreal height)
|
||||
{
|
||||
@@ -184,14 +127,9 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
qreal m_opticalZoom;
|
||||
qreal m_digitalZoom;
|
||||
QCameraFocus::FocusMode m_focusMode;
|
||||
QCameraFocus::FocusPointMode m_focusPointMode;
|
||||
QPointF m_focusPoint;
|
||||
// to emit maximum Optical and Digital Zoom Changed signals
|
||||
qreal m_maxOpticalZoom;
|
||||
qreal m_maxDigitalZoom;
|
||||
// to emit focus zone changed signal
|
||||
QCameraFocusZoneList m_zones;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user