summaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2015-11-12 14:56:26 +0300
committerYoann Lopes <yoann.lopes@theqtcompany.com>2015-11-23 16:45:59 +0000
commit38cfcc3b500627815ab12add27d7a3c392552ed1 (patch)
tree3cd82a389645e5ac234cc5f5f8a0d8b11bbb6a12 /src/imports
parent0757ff1c4add6bd4f6499c04969760765662efa3 (diff)
Add camera brightness adjustment API.
The brightness adjustment already exists in the control API but not in the QCamera and QML Camera APIs. Simply add the missing functions which call into the control API. Change-Id: I56a5aef3ae8bef9ca13c5a01d8282014f6e20830 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/multimedia/qdeclarativecameraimageprocessing.cpp19
-rw-r--r--src/imports/multimedia/qdeclarativecameraimageprocessing_p.h4
2 files changed, 23 insertions, 0 deletions
diff --git a/src/imports/multimedia/qdeclarativecameraimageprocessing.cpp b/src/imports/multimedia/qdeclarativecameraimageprocessing.cpp
index de5aee85b..f6fbe9fc4 100644
--- a/src/imports/multimedia/qdeclarativecameraimageprocessing.cpp
+++ b/src/imports/multimedia/qdeclarativecameraimageprocessing.cpp
@@ -138,6 +138,25 @@ void QDeclarativeCameraImageProcessing::setManualWhiteBalance(qreal colorTemp) c
}
/*!
+ \qmlproperty qreal QtMultimedia::CameraImageProcessing::brightness
+
+ Image brightness adjustment.
+ Valid brightness adjustment values range between -1.0 and 1.0, with a default of 0.
+*/
+qreal QDeclarativeCameraImageProcessing::brightness() const
+{
+ return m_imageProcessing->brightness();
+}
+
+void QDeclarativeCameraImageProcessing::setBrightness(qreal value)
+{
+ if (value != brightness()) {
+ m_imageProcessing->setBrightness(value);
+ emit brightnessChanged(brightness());
+ }
+}
+
+/*!
\qmlproperty qreal QtMultimedia::CameraImageProcessing::contrast
Image contrast adjustment.
diff --git a/src/imports/multimedia/qdeclarativecameraimageprocessing_p.h b/src/imports/multimedia/qdeclarativecameraimageprocessing_p.h
index 0e0cbb230..2e6c942ef 100644
--- a/src/imports/multimedia/qdeclarativecameraimageprocessing_p.h
+++ b/src/imports/multimedia/qdeclarativecameraimageprocessing_p.h
@@ -60,6 +60,7 @@ class QDeclarativeCameraImageProcessing : public QObject
Q_PROPERTY(WhiteBalanceMode whiteBalanceMode READ whiteBalanceMode WRITE setWhiteBalanceMode NOTIFY whiteBalanceModeChanged)
Q_PROPERTY(qreal manualWhiteBalance READ manualWhiteBalance WRITE setManualWhiteBalance NOTIFY manualWhiteBalanceChanged)
+ Q_PROPERTY(qreal brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged)
Q_PROPERTY(qreal contrast READ contrast WRITE setContrast NOTIFY contrastChanged)
Q_PROPERTY(qreal saturation READ saturation WRITE setSaturation NOTIFY saturationChanged)
Q_PROPERTY(qreal sharpeningLevel READ sharpeningLevel WRITE setSharpeningLevel NOTIFY sharpeningLevelChanged)
@@ -97,6 +98,7 @@ public:
WhiteBalanceMode whiteBalanceMode() const;
qreal manualWhiteBalance() const;
+ qreal brightness() const;
qreal contrast() const;
qreal saturation() const;
qreal sharpeningLevel() const;
@@ -108,6 +110,7 @@ public Q_SLOTS:
void setWhiteBalanceMode(QDeclarativeCameraImageProcessing::WhiteBalanceMode mode) const;
void setManualWhiteBalance(qreal colorTemp) const;
+ void setBrightness(qreal value);
void setContrast(qreal value);
void setSaturation(qreal value);
void setSharpeningLevel(qreal value);
@@ -119,6 +122,7 @@ Q_SIGNALS:
void whiteBalanceModeChanged(QDeclarativeCameraImageProcessing::WhiteBalanceMode) const;
void manualWhiteBalanceChanged(qreal) const;
+ void brightnessChanged(qreal);
void contrastChanged(qreal);
void saturationChanged(qreal);
void sharpeningLevelChanged(qreal);