diff options
author | Michael Goddard <michael.goddard@nokia.com> | 2012-01-06 15:21:38 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-06 07:26:59 +0100 |
commit | 6b67a11032779ff3a7a78a57e8d2bb2cd8b7e525 (patch) | |
tree | a40f277b1df310f2a83223d24f0e1f11b69da7f7 /src/plugins | |
parent | c97f5f8c2e91c1b76d42583efaf232487d490060 (diff) |
Add the spot for spot metering mode.
Not yet fully documented in QML - needs a bit of an overhaul first.
Change-Id: Ic11684858fb872d0b4dcedf60b390571371db252
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/simulator/camera/simulatorcameraexposurecontrol.cpp | 19 | ||||
-rw-r--r-- | src/plugins/simulator/camera/simulatorcameraexposurecontrol.h | 1 |
2 files changed, 19 insertions, 1 deletions
diff --git a/src/plugins/simulator/camera/simulatorcameraexposurecontrol.cpp b/src/plugins/simulator/camera/simulatorcameraexposurecontrol.cpp index 1ee820d8c..f4de0dba9 100644 --- a/src/plugins/simulator/camera/simulatorcameraexposurecontrol.cpp +++ b/src/plugins/simulator/camera/simulatorcameraexposurecontrol.cpp @@ -48,6 +48,7 @@ SimulatorCameraExposureControl::SimulatorCameraExposureControl(SimulatorCameraSe QCameraExposureControl(parent), mExposureMode(QCameraExposure::ExposureAuto), mMeteringMode(QCameraExposure::MeteringAverage), + mSpot(0.5, 0.5), mSession(session), mSettings(0) { @@ -138,6 +139,7 @@ bool SimulatorCameraExposureControl::isParameterSupported(ExposureParameter para case QCameraExposureControl::Aperture: case QCameraExposureControl::ShutterSpeed: case QCameraExposureControl::ExposureCompensation: + case QCameraExposureControl::SpotMeteringPoint: return true; case QCameraExposureControl::FlashPower: case QCameraExposureControl::FlashCompensation: @@ -161,6 +163,10 @@ QVariant SimulatorCameraExposureControl::exposureParameter(ExposureParameter par return QVariant(shutterSpeed()); case QCameraExposureControl::ExposureCompensation: return QVariant(exposureCompensation()); + + case QCameraExposureControl::SpotMeteringPoint: + return mSpot; + case QCameraExposureControl::FlashPower: case QCameraExposureControl::FlashCompensation: // Not supported @@ -303,6 +309,16 @@ bool SimulatorCameraExposureControl::setExposureParameter(ExposureParameter para case QCameraExposureControl::FlashCompensation: return false; + case QCameraExposureControl::SpotMeteringPoint: + { + static QRectF valid(0, 0, 1, 1); + if (valid.contains(value.toPointF())) { + mSpot = value.toPointF(); + return true; + } + return false; + } + default: // Not supported return false; @@ -324,7 +340,8 @@ QString SimulatorCameraExposureControl::extendedParameterName(ExposureParameter return QString("Flash Power"); case QCameraExposureControl::FlashCompensation: return QString("Flash Compensation"); - + case QCameraExposureControl::SpotMeteringPoint: + return QString("Spot Metering Point"); default: return QString(); } diff --git a/src/plugins/simulator/camera/simulatorcameraexposurecontrol.h b/src/plugins/simulator/camera/simulatorcameraexposurecontrol.h index 5e00a6d44..5b7067b77 100644 --- a/src/plugins/simulator/camera/simulatorcameraexposurecontrol.h +++ b/src/plugins/simulator/camera/simulatorcameraexposurecontrol.h @@ -116,6 +116,7 @@ private: // Internal - Implementing ExposureParameter private: // Data QCameraExposure::ExposureMode mExposureMode; QCameraExposure::MeteringMode mMeteringMode; + QPointF mSpot; SimulatorCameraSession *mSession; SimulatorCameraSettings *mSettings; }; |