| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
| 24 | ** |
| 25 | ** GNU General Public License Usage |
| 26 | ** Alternatively, this file may be used under the terms of the GNU |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General |
| 28 | ** Public license version 3 or any later version approved by the KDE Free |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
| 31 | ** included in the packaging of this file. Please review the following |
| 32 | ** information to ensure the GNU General Public License requirements will |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
| 35 | ** |
| 36 | ** $QT_END_LICENSE$ |
| 37 | ** |
| 38 | ****************************************************************************/ |
| 39 | |
| 40 | #include <qcameraexposurecontrol.h> |
| 41 | #include "qmediacontrol_p.h" |
| 42 | |
| 43 | QT_BEGIN_NAMESPACE |
| 44 | |
| 45 | /*! |
| 46 | \class QCameraExposureControl |
| 47 | \obsolete |
| 48 | |
| 49 | \brief The QCameraExposureControl class allows controlling camera exposure parameters. |
| 50 | |
| 51 | \inmodule QtMultimedia |
| 52 | |
| 53 | \ingroup multimedia_control |
| 54 | |
| 55 | The QCameraExposure class is the usual method of adjusting exposure related parameters |
| 56 | when using camera functionality. This class provides a more complete but less easy |
| 57 | to use interface, and also forms the interface to implement when writing a new |
| 58 | implementation of QCamera functionality. |
| 59 | |
| 60 | You can adjust a number of parameters that will affect images and video taken with |
| 61 | the corresponding QCamera object - see the \l {QCameraExposureControl::ExposureParameter}{ExposureParameter} enumeration. |
| 62 | |
| 63 | The interface name of QCameraExposureControl is \c org.qt-project.qt.cameraexposurecontrol/5.0 as |
| 64 | defined in QCameraExposureControl_iid. |
| 65 | |
| 66 | \sa QCameraExposure, QCamera |
| 67 | */ |
| 68 | |
| 69 | /*! |
| 70 | \macro QCameraExposureControl_iid |
| 71 | |
| 72 | \c org.qt-project.qt.cameraexposurecontrol/5.0 |
| 73 | |
| 74 | Defines the interface name of the QCameraExposureControl class. |
| 75 | |
| 76 | \relates QCameraExposureControl |
| 77 | */ |
| 78 | |
| 79 | /*! |
| 80 | Constructs a camera exposure control object with \a parent. |
| 81 | */ |
| 82 | QCameraExposureControl::QCameraExposureControl(QObject *parent): |
| 83 | QMediaControl(*new QMediaControlPrivate, parent) |
| 84 | { |
| 85 | } |
| 86 | |
| 87 | /*! |
| 88 | Destroys the camera exposure control object. |
| 89 | */ |
| 90 | QCameraExposureControl::~QCameraExposureControl() |
| 91 | { |
| 92 | } |
| 93 | |
| 94 | /*! |
| 95 | \enum QCameraExposureControl::ExposureParameter |
| 96 | \value ISO |
| 97 | Camera ISO sensitivity, specified as integer value. |
| 98 | \value Aperture |
| 99 | Lens aperture is specified as an qreal F number. |
| 100 | The supported apertures list can change depending on the focal length, |
| 101 | in such a case the exposureParameterRangeChanged() signal is emitted. |
| 102 | \value ShutterSpeed |
| 103 | Shutter speed in seconds, specified as qreal. |
| 104 | \value ExposureCompensation |
| 105 | Exposure compensation, specified as qreal EV value. |
| 106 | \value FlashPower |
| 107 | Manual flash power, specified as qreal value. |
| 108 | Accepted power range is [0..1.0], |
| 109 | with 0 value means no flash and 1.0 corresponds to full flash power. |
| 110 | |
| 111 | This value is only used in the \l{QCameraExposure::FlashManual}{manual flash mode}. |
| 112 | \value TorchPower |
| 113 | Manual torch power, specified as qreal value. |
| 114 | Accepted power range is [0..1.0], |
| 115 | with 0 value means no light and 1.0 corresponds to full torch power. |
| 116 | |
| 117 | This value is only used in the \l{QCameraExposure::FlashTorch}{torch flash mode}. |
| 118 | \value FlashCompensation |
| 119 | Flash compensation, specified as qreal EV value. |
| 120 | \value SpotMeteringPoint |
| 121 | The relative frame coordinate of the point to use for exposure metering |
| 122 | in spot metering mode, specified as a QPointF. |
| 123 | \value ExposureMode |
| 124 | Camera exposure mode. |
| 125 | \value MeteringMode |
| 126 | Camera metering mode. |
| 127 | \value ExtendedExposureParameter |
| 128 | The base value for platform specific extended parameters. |
| 129 | For such parameters the sequential values starting from ExtendedExposureParameter should be used. |
| 130 | */ |
| 131 | |
| 132 | /*! |
| 133 | \fn QCameraExposureControl::isParameterSupported(ExposureParameter parameter) const |
| 134 | |
| 135 | Returns true is exposure \a parameter is supported by backend. |
| 136 | \since 5.0 |
| 137 | */ |
| 138 | |
| 139 | /*! |
| 140 | \fn QCameraExposureControl::requestedValue(ExposureParameter parameter) const |
| 141 | |
| 142 | Returns the requested exposure \a parameter value. |
| 143 | |
| 144 | \since 5.0 |
| 145 | */ |
| 146 | |
| 147 | /*! |
| 148 | \fn QCameraExposureControl::actualValue(ExposureParameter parameter) const |
| 149 | |
| 150 | Returns the actual exposure \a parameter value, or invalid QVariant() if the value is unknown or not supported. |
| 151 | |
| 152 | The actual parameter value may differ for the requested one if automatic mode is selected or |
| 153 | camera supports only limited set of values within the supported range. |
| 154 | \since 5.0 |
| 155 | */ |
| 156 | |
| 157 | |
| 158 | /*! |
| 159 | \fn QCameraExposureControl::supportedParameterRange(ExposureParameter parameter, bool *continuous = 0) const |
| 160 | |
| 161 | Returns the list of supported \a parameter values; |
| 162 | |
| 163 | If the camera supports arbitrary exposure parameter value within the supported range, |
| 164 | *\a continuous is set to true, otherwise *\a continuous is set to false. |
| 165 | |
| 166 | \since 5.0 |
| 167 | */ |
| 168 | |
| 169 | /*! |
| 170 | \fn bool QCameraExposureControl::setValue(ExposureParameter parameter, const QVariant& value) |
| 171 | |
| 172 | Set the exposure \a parameter to \a value. |
| 173 | If a null or invalid QVariant is passed, backend should choose the value automatically, |
| 174 | and if possible report the actual value to user with QCameraExposureControl::actualValue(). |
| 175 | |
| 176 | Returns true if parameter is supported and value is correct. |
| 177 | \since 5.0 |
| 178 | */ |
| 179 | |
| 180 | /*! |
| 181 | \fn void QCameraExposureControl::requestedValueChanged(int parameter) |
| 182 | |
| 183 | Signal emitted when the requested exposure \a parameter value has changed, |
| 184 | usually in result of setValue() call. |
| 185 | \since 5.0 |
| 186 | */ |
| 187 | |
| 188 | /*! |
| 189 | \fn void QCameraExposureControl::actualValueChanged(int parameter) |
| 190 | |
| 191 | Signal emitted when the actual exposure \a parameter value has changed, |
| 192 | usually in result of auto exposure algorithms or manual exposure parameter applied. |
| 193 | |
| 194 | \since 5.0 |
| 195 | */ |
| 196 | |
| 197 | /*! |
| 198 | \fn void QCameraExposureControl::parameterRangeChanged(int parameter) |
| 199 | |
| 200 | Signal emitted when the supported range of exposure \a parameter values has changed. |
| 201 | |
| 202 | \since 5.0 |
| 203 | */ |
| 204 | |
| 205 | QT_END_NAMESPACE |
| 206 | |
| 207 | #include "moc_qcameraexposurecontrol.cpp" |
| 208 | |