1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the Qt Mobility Components. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 #include "s60cameraimageprocessingcontrol.h" |
|
43 #include "s60cameraservice.h" |
|
44 #include "s60camerasession.h" |
|
45 |
|
46 #include <QtCore/qdebug.h> |
|
47 #include <QtCore/qstring.h> |
|
48 |
|
49 |
|
50 S60CameraImageProcessingControl::S60CameraImageProcessingControl(QObject *parent) |
|
51 :QImageProcessingControl(parent) |
|
52 { |
|
53 m_session = qobject_cast<S60CameraSession*>(parent); |
|
54 } |
|
55 |
|
56 S60CameraImageProcessingControl::S60CameraImageProcessingControl(QObject *session, QObject *parent) |
|
57 :QImageProcessingControl(parent) |
|
58 { |
|
59 // use cast if we want to change session class later on.. |
|
60 m_session = qobject_cast<S60CameraSession*>(session); |
|
61 } |
|
62 |
|
63 S60CameraImageProcessingControl::~S60CameraImageProcessingControl() |
|
64 { |
|
65 } |
|
66 |
|
67 QCamera::WhiteBalanceMode S60CameraImageProcessingControl::whiteBalanceMode() const |
|
68 { |
|
69 return m_session->whiteBalanceMode(); |
|
70 } |
|
71 |
|
72 void S60CameraImageProcessingControl::setWhiteBalanceMode(QCamera::WhiteBalanceMode mode) |
|
73 { |
|
74 QCamera::WhiteBalanceModes supportedModes = supportedWhiteBalanceModes(); |
|
75 if (supportedModes & mode) { |
|
76 m_session->setWhiteBalanceMode(mode); |
|
77 } |
|
78 } |
|
79 |
|
80 QCamera::WhiteBalanceModes S60CameraImageProcessingControl::supportedWhiteBalanceModes() const |
|
81 { |
|
82 return m_session->supportedWhiteBalanceModes(); |
|
83 } |
|
84 |
|
85 int S60CameraImageProcessingControl::manualWhiteBalance() const |
|
86 { |
|
87 return 0; |
|
88 } |
|
89 |
|
90 void S60CameraImageProcessingControl::setManualWhiteBalance(int colorTemperature) |
|
91 { |
|
92 Q_UNUSED(colorTemperature) |
|
93 } |
|
94 |
|
95 void S60CameraImageProcessingControl::setContrast(qreal value) |
|
96 { |
|
97 m_session->setContrast(value); |
|
98 } |
|
99 qreal S60CameraImageProcessingControl::contrast() const |
|
100 { |
|
101 return m_session->contrast(); |
|
102 } |
|
103 |
|
104 void S60CameraImageProcessingControl::setSaturation(qreal value) |
|
105 { |
|
106 Q_UNUSED(value); |
|
107 } |
|
108 |
|
109 qreal S60CameraImageProcessingControl::saturation() const |
|
110 { |
|
111 return 0; |
|
112 } |
|
113 |
|
114 void S60CameraImageProcessingControl::setDenoisingLevel(qreal value) |
|
115 { |
|
116 Q_UNUSED(value); |
|
117 } |
|
118 |
|
119 bool S60CameraImageProcessingControl::isDenoisingSupported() const |
|
120 { |
|
121 return false; |
|
122 } |
|
123 |
|
124 qreal S60CameraImageProcessingControl::denoisingLevel() const |
|
125 { |
|
126 return 0; |
|
127 } |
|
128 |
|
129 void S60CameraImageProcessingControl::setSharpeningLevel(qreal value) |
|
130 { |
|
131 Q_UNUSED(value); |
|
132 } |
|
133 |
|
134 bool S60CameraImageProcessingControl::isSharpeningSupported() const |
|
135 { |
|
136 return false; |
|
137 } |
|
138 qreal S60CameraImageProcessingControl::sharpeningLevel() const |
|
139 { |
|
140 return 0; |
|
141 } |
|
142 |
|