Added QML components for aperture, exposure, iso, noise reduction and flicker reduction
[harmattan/cameraplus] / lib / qtcamnoisereduction.cpp
1 #include "qtcamnoisereduction.h"
2 #include "qtcamcapability_p.h"
3
4 QtCamNoiseReduction::QtCamNoiseReduction(QtCamDevice *dev, QObject *parent) :
5   QtCamCapability(new QtCamCapabilityPrivate(dev, QtCamCapability::NoiseReduction,
6                                              "noise-reduction"), parent) {
7
8 }
9
10 QtCamNoiseReduction::~QtCamNoiseReduction() {
11
12 }
13
14 QtCamNoiseReduction::NoiseReductionMode QtCamNoiseReduction::value() {
15   int val = 0;
16   if (!d_ptr->intValue(&val)) {
17     return QtCamNoiseReduction::None;
18   }
19
20   switch (val) {
21   case QtCamNoiseReduction::Bayer:
22   case QtCamNoiseReduction::Ycc:
23   case QtCamNoiseReduction::Temporal:
24   case QtCamNoiseReduction::Fixed:
25   case QtCamNoiseReduction::Extra:
26     return (QtCamNoiseReduction::NoiseReductionMode)val;
27
28   default:
29     return QtCamNoiseReduction::None;
30   }
31 }
32
33 bool QtCamNoiseReduction::setValue(const QtCamNoiseReduction::NoiseReductionMode& mode) {
34   return d_ptr->setIntValue(mode, false);
35 }