diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-05-17 15:49:39 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-05-18 08:44:43 +0000 |
commit | b22138591fd65b012ae8267f053a64092a797737 (patch) | |
tree | 0d7f6ab4bd1de9e0c71abe087558ea5883c635e4 /src | |
parent | 76bcf3c97513638cda46b1f488c53a749eb3888d (diff) |
Remove QCamera::aperture() and friends
None of the backends implemented support for it, and
most cameras today don't allow you to change aperture
anyway.
Change-Id: Iad820c0a333e23e8a12d36ac2dd511b4ea5fc047
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
8 files changed, 2 insertions, 124 deletions
diff --git a/src/multimedia/camera/qcamera.cpp b/src/multimedia/camera/qcamera.cpp index 291fcdae9..0e5f4878d 100644 --- a/src/multimedia/camera/qcamera.cpp +++ b/src/multimedia/camera/qcamera.cpp @@ -709,9 +709,6 @@ void QCameraPrivate::_q_exposureParameterChanged(int parameter) case QPlatformCameraExposure::ISO: emit q->isoSensitivityChanged(q->isoSensitivity()); break; - case QPlatformCameraExposure::Aperture: - emit q->apertureChanged(q->aperture()); - break; case QPlatformCameraExposure::ShutterSpeed: emit q->shutterSpeedChanged(q->shutterSpeed()); break; @@ -726,9 +723,6 @@ void QCameraPrivate::_q_exposureParameterRangeChanged(int parameter) Q_Q(QCamera); switch (parameter) { - case QPlatformCameraExposure::Aperture: - emit q->apertureRangeChanged(); - break; case QPlatformCameraExposure::ShutterSpeed: emit q->shutterSpeedRangeChanged(); break; @@ -934,82 +928,6 @@ void QCamera::setAutoIsoSensitivity() */ /*! - \property QCamera::aperture - \brief Lens aperture is specified as an F number, the ratio of the focal length to effective aperture diameter. - - \sa supportedApertures(), setAutoAperture(), setManualAperture(), requestedAperture() -*/ - - -qreal QCamera::aperture() const -{ - return d_func()->actualExposureParameter<qreal>(QPlatformCameraExposure::Aperture, -1.0); -} - -/*! - Returns the requested manual aperture - or -1.0 if automatic aperture is turned on. -*/ -qreal QCamera::requestedAperture() const -{ - return d_func()->requestedExposureParameter<qreal>(QPlatformCameraExposure::Aperture, -1.0); -} - - -/*! - Returns the list of aperture values camera supports. - The apertures list can change depending on the focal length, - in such a case the apertureRangeChanged() signal is emitted. - - If the camera supports arbitrary aperture values within the supported range, - *\a continuous is set to true, otherwise *\a continuous is set to false. -*/ -QList<qreal> QCamera::supportedApertures(bool * continuous) const -{ - QList<qreal> res; - QPlatformCameraExposure *control = d_func()->exposureControl; - - bool tmp = false; - if (!continuous) - continuous = &tmp; - - if (!control) - return res; - - const auto range = control->supportedParameterRange(QPlatformCameraExposure::Aperture, continuous); - for (const QVariant &value : range) { - bool ok = false; - qreal realValue = value.toReal(&ok); - if (ok) - res.append(realValue); - else - qWarning() << "Incompatible aperture value type, qreal is expected"; - } - - return res; -} - -/*! - \fn QCamera::setManualAperture(qreal aperture) - Sets the manual camera \a aperture value. -*/ - -void QCamera::setManualAperture(qreal aperture) -{ - d_func()->setExposureParameter<qreal>(QPlatformCameraExposure::Aperture, aperture); -} - -/*! - \fn QCamera::setAutoAperture() - Turn on auto aperture -*/ - -void QCamera::setAutoAperture() -{ - d_func()->resetExposureParameter(QPlatformCameraExposure::Aperture); -} - -/*! Returns the current shutter speed in seconds. */ @@ -1127,19 +1045,6 @@ void QCamera::setAutoShutterSpeed() */ /*! - \fn void QCamera::apertureChanged(qreal value) - - Signal emitted when aperature changes to \a value. -*/ - -/*! - \fn void QCamera::apertureRangeChanged() - - Signal emitted when aperature range has changed. -*/ - - -/*! \fn void QCamera::shutterSpeedRangeChanged() Signal emitted when the shutter speed range has changed. diff --git a/src/multimedia/camera/qcamera.h b/src/multimedia/camera/qcamera.h index 904d0e098..1d01f75f1 100644 --- a/src/multimedia/camera/qcamera.h +++ b/src/multimedia/camera/qcamera.h @@ -77,7 +77,6 @@ class Q_MULTIMEDIA_EXPORT QCamera : public QObject Q_PROPERTY(float minimumZoomFactor READ minimumZoomFactor NOTIFY minimumZoomFactorChanged) Q_PROPERTY(float maximumZoomFactor READ maximumZoomFactor NOTIFY maximumZoomFactorChanged) Q_PROPERTY(float zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged) - Q_PROPERTY(qreal aperture READ aperture NOTIFY apertureChanged) Q_PROPERTY(qreal shutterSpeed READ shutterSpeed NOTIFY shutterSpeedChanged) Q_PROPERTY(int isoSensitivity READ isoSensitivity NOTIFY isoSensitivityChanged) Q_PROPERTY(qreal exposureCompensation READ exposureCompensation WRITE setExposureCompensation NOTIFY exposureCompensationChanged) @@ -223,15 +222,12 @@ public: qreal exposureCompensation() const; int isoSensitivity() const; - qreal aperture() const; qreal shutterSpeed() const; int requestedIsoSensitivity() const; - qreal requestedAperture() const; qreal requestedShutterSpeed() const; QList<int> supportedIsoSensitivities(bool *continuous = nullptr) const; - QList<qreal> supportedApertures(bool *continuous = nullptr) const; QList<qreal> supportedShutterSpeeds(bool *continuous = nullptr) const; WhiteBalanceMode whiteBalanceMode() const; @@ -260,9 +256,6 @@ public Q_SLOTS: void setManualIsoSensitivity(int iso); void setAutoIsoSensitivity(); - void setManualAperture(qreal aperture); - void setAutoAperture(); - void setManualShutterSpeed(qreal seconds); void setAutoShutterSpeed(); @@ -291,8 +284,6 @@ Q_SIGNALS: void flashReady(bool); - void apertureChanged(qreal); - void apertureRangeChanged(); void shutterSpeedChanged(qreal speed); void shutterSpeedRangeChanged(); void isoSensitivityChanged(int); diff --git a/src/multimedia/doc/src/cameraoverview.qdoc b/src/multimedia/doc/src/cameraoverview.qdoc index 4b1a7ca92..6b3880b1c 100644 --- a/src/multimedia/doc/src/cameraoverview.qdoc +++ b/src/multimedia/doc/src/cameraoverview.qdoc @@ -244,13 +244,13 @@ In addition to focus, QCameraFocus allows you to control any available zoom usin or \l zoomTo(). The available zoom range might be limited (or fixed to unity), the allowed range can be checked with \l minimumZoomFactor() and maximumZoomFactor(). -\section3 Exposure, Aperture, Shutter Speed and Flash +\section3 Exposure, Shutter Speed and Flash There are a number of settings that affect the amount of light that hits the camera sensor, and hence the quality of the resulting image. The main settings for automatic image taking are the \l {QCamera::ExposureMode}{exposure mode} -and \l {QCamera::FlashMode}{flash mode}. Several other settings (aperture, ISO setting, +and \l {QCamera::FlashMode}{flash mode}. Several other settings (ISO setting, shutter speed) are usually managed automatically but can also be overridden if desired. Finally, you can control the flash hardware (if present) using this class. In some cases diff --git a/src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol.cpp b/src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol.cpp index ffb99b250..fc78330af 100644 --- a/src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol.cpp +++ b/src/multimedia/platform/android/mediacapture/qandroidcameraexposurecontrol.cpp @@ -67,8 +67,6 @@ bool QAndroidCameraExposureControl::isParameterSupported(ExposureParameter param switch (parameter) { case QPlatformCameraExposure::ISO: return false; - case QPlatformCameraExposure::Aperture: - return false; case QPlatformCameraExposure::ShutterSpeed: return false; case QPlatformCameraExposure::ExposureCompensation: diff --git a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure.cpp b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure.cpp index a65c58f7f..bf36ba502 100644 --- a/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure.cpp +++ b/src/multimedia/platform/gstreamer/mediacapture/qgstreamercameraexposure.cpp @@ -64,7 +64,6 @@ bool QGstreamerCameraExposure::isParameterSupported(ExposureParameter parameter) switch (parameter) { case QPlatformCameraExposure::ExposureCompensation: case QPlatformCameraExposure::ISO: - case QPlatformCameraExposure::Aperture: case QPlatformCameraExposure::ShutterSpeed: return true; default: @@ -96,9 +95,6 @@ QVariantList QGstreamerCameraExposure::supportedParameterRange(ExposureParameter case QPlatformCameraExposure::ISO: res << 100 << 200 << 400; break; - case QPlatformCameraExposure::Aperture: - res << 2.8; - break; default: break; } @@ -133,8 +129,6 @@ QVariant QGstreamerCameraExposure::actualValue(ExposureParameter parameter) cons gst_photography_get_iso_speed(m_camera->photography(), &isoSpeed); return QVariant(isoSpeed); } - case QPlatformCameraExposure::Aperture: - return QVariant(2.8); case QPlatformCameraExposure::ShutterSpeed: { guint32 shutterSpeed = 0; @@ -211,9 +205,6 @@ bool QGstreamerCameraExposure::setValue(ExposureParameter parameter, const QVari case QPlatformCameraExposure::ISO: gst_photography_set_iso_speed(m_camera->photography(), value.toInt()); break; - case QPlatformCameraExposure::Aperture: - gst_photography_set_aperture(m_camera->photography(), guint(value.toReal()*1000000)); - break; case QPlatformCameraExposure::ShutterSpeed: gst_photography_set_exposure(m_camera->photography(), guint(value.toReal()*1000000)); break; diff --git a/src/multimedia/platform/qnx/camera/bbcameraexposurecontrol.cpp b/src/multimedia/platform/qnx/camera/bbcameraexposurecontrol.cpp index 63b0aade6..81ab2ba7f 100644 --- a/src/multimedia/platform/qnx/camera/bbcameraexposurecontrol.cpp +++ b/src/multimedia/platform/qnx/camera/bbcameraexposurecontrol.cpp @@ -57,8 +57,6 @@ bool BbCameraExposureControl::isParameterSupported(ExposureParameter parameter) switch (parameter) { case QPlatformCameraExposure::ISO: return false; - case QPlatformCameraExposure::Aperture: - return false; case QPlatformCameraExposure::ShutterSpeed: return false; case QPlatformCameraExposure::ExposureCompensation: diff --git a/src/multimedia/platform/qplatformcameraexposure.cpp b/src/multimedia/platform/qplatformcameraexposure.cpp index d5bf56fa7..ca9b9ea16 100644 --- a/src/multimedia/platform/qplatformcameraexposure.cpp +++ b/src/multimedia/platform/qplatformcameraexposure.cpp @@ -74,10 +74,6 @@ QPlatformCameraExposure::QPlatformCameraExposure(QObject *parent) \enum QPlatformCameraExposure::ExposureParameter \value ISO Camera ISO sensitivity, specified as integer value. - \value Aperture - Lens aperture is specified as an qreal F number. - The supported apertures list can change depending on the focal length, - in such a case the exposureParameterRangeChanged() signal is emitted. \value ShutterSpeed Shutter speed in seconds, specified as qreal. \value ExposureCompensation diff --git a/src/multimedia/platform/qplatformcameraexposure_p.h b/src/multimedia/platform/qplatformcameraexposure_p.h index 11c709e24..3cdc33754 100644 --- a/src/multimedia/platform/qplatformcameraexposure_p.h +++ b/src/multimedia/platform/qplatformcameraexposure_p.h @@ -70,7 +70,6 @@ class Q_MULTIMEDIA_EXPORT QPlatformCameraExposure : public QObject public: enum ExposureParameter { ISO, - Aperture, ShutterSpeed, ExposureCompensation, TorchPower, |