diff options
author | Andrew den Exter <andrew.den.exter@jollamobile.com> | 2014-07-09 13:38:25 +1000 |
---|---|---|
committer | Andrew den Exter <andrew.den.exter@qinetic.com.au> | 2014-11-28 06:08:11 +0100 |
commit | 25ad679c254766a3ac0bf3925232052941485442 (patch) | |
tree | f56748cdde28851ac5438b53de93fb9fbf0c14ce /src/multimedia/camera | |
parent | be7fef656a1d087d3d1d3fa102da4fce85855935 (diff) | |
download | qtmultimedia-25ad679c254766a3ac0bf3925232052941485442.tar.gz |
Add a color filter property to QCameraImageProcessing.
[ChangeLog] New color filter property for QCameraImageProcessing.
Change-Id: I999e349e3e4f284b533fa62ba50903fbd21cb400
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Diffstat (limited to 'src/multimedia/camera')
-rw-r--r-- | src/multimedia/camera/qcameraimageprocessing.cpp | 59 | ||||
-rw-r--r-- | src/multimedia/camera/qcameraimageprocessing.h | 21 |
2 files changed, 79 insertions, 1 deletions
diff --git a/src/multimedia/camera/qcameraimageprocessing.cpp b/src/multimedia/camera/qcameraimageprocessing.cpp index 35ea7f6d1..307fae522 100644 --- a/src/multimedia/camera/qcameraimageprocessing.cpp +++ b/src/multimedia/camera/qcameraimageprocessing.cpp @@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE static void qRegisterCameraImageProcessingMetaTypes() { qRegisterMetaType<QCameraImageProcessing::WhiteBalanceMode>(); + qRegisterMetaType<QCameraImageProcessing::ColorFilter>(); } Q_CONSTRUCTOR_FUNCTION(qRegisterCameraImageProcessingMetaTypes) @@ -317,5 +318,63 @@ void QCameraImageProcessing::setDenoisingLevel(qreal level) \value WhiteBalanceVendor Base value for vendor defined white balance modes. */ +/*! + \enum QCameraImageProcessing::Filter + + \value ColorFilterNone No filter is applied to images. + \value ColorFilterGrayscale A grayscale filter. + \value ColorFilterNegative A negative filter. + \value ColorFilterSolarize A solarize filter. + \value ColorFilterSepia A sepia filter. + \value ColorFilterPosterize A posterize filter. + \value ColorFilterWhiteboard A whiteboard filter. + \value ColorFilterBlackboard A blackboard filter. + \value ColorFilterAqua An aqua filter. + \value ColorFilterVendor The base value for vendor defined filters. + + \since 5.5 +*/ + +/*! + Returns the color filter which will be applied to image data captured by the camera. + + \since 5.5 +*/ + +QCameraImageProcessing::ColorFilter QCameraImageProcessing::colorFilter() const +{ + return d_func()->imageControl->parameter(QCameraImageProcessingControl::ColorFilter) + .value<QCameraImageProcessing::ColorFilter>(); +} + + +/*! + Sets the color \a filter which will be applied to image data captured by the camera. + + \since 5.5 +*/ + +void QCameraImageProcessing::setColorFilter(QCameraImageProcessing::ColorFilter filter) +{ + d_func()->imageControl->setParameter( + QCameraImageProcessingControl::ColorFilter, + QVariant::fromValue<QCameraImageProcessing::ColorFilter>(filter)); +} + +/*! + Returns true if a color \a filter is supported. + + \since 5.5 +*/ + +bool QCameraImageProcessing::isColorFilterSupported(QCameraImageProcessing::ColorFilter filter) const +{ + return d_func()->imageControl->isParameterValueSupported( + QCameraImageProcessingControl::ColorFilter, + QVariant::fromValue<QCameraImageProcessing::ColorFilter>(filter)); + +} + + #include "moc_qcameraimageprocessing.cpp" QT_END_NAMESPACE diff --git a/src/multimedia/camera/qcameraimageprocessing.h b/src/multimedia/camera/qcameraimageprocessing.h index 4c3f71dcd..044e05f7c 100644 --- a/src/multimedia/camera/qcameraimageprocessing.h +++ b/src/multimedia/camera/qcameraimageprocessing.h @@ -54,7 +54,7 @@ class QCameraImageProcessingPrivate; class Q_MULTIMEDIA_EXPORT QCameraImageProcessing : public QObject { Q_OBJECT - Q_ENUMS(WhiteBalanceMode) + Q_ENUMS(WhiteBalanceMode ColorFilter) public: enum WhiteBalanceMode { WhiteBalanceAuto = 0, @@ -69,6 +69,19 @@ public: WhiteBalanceVendor = 1000 }; + enum ColorFilter { + ColorFilterNone, + ColorFilterGrayscale, + ColorFilterNegative, + ColorFilterSolarize, + ColorFilterSepia, + ColorFilterPosterize, + ColorFilterWhiteboard, + ColorFilterBlackboard, + ColorFilterAqua, + ColorFilterVendor = 1000 + }; + bool isAvailable() const; WhiteBalanceMode whiteBalanceMode() const; @@ -90,6 +103,10 @@ public: qreal denoisingLevel() const; void setDenoisingLevel(qreal value); + ColorFilter colorFilter() const; + void setColorFilter(ColorFilter filter); + bool isColorFilterSupported(ColorFilter filter) const; + private: friend class QCamera; friend class QCameraPrivate; @@ -104,7 +121,9 @@ private: QT_END_NAMESPACE Q_DECLARE_METATYPE(QCameraImageProcessing::WhiteBalanceMode) +Q_DECLARE_METATYPE(QCameraImageProcessing::ColorFilter) Q_MEDIA_ENUM_DEBUG(QCameraImageProcessing, WhiteBalanceMode) +Q_MEDIA_ENUM_DEBUG(QCameraImageProcessing, ColorFilter) #endif // QCAMERAIMAGEPROCESSING_H |