|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 /* |
|
18 * Symbian specific settings handling |
|
19 */ |
|
20 |
|
21 #include <ecamadvsettingsuids.hrh> |
|
22 |
|
23 #include "cxeautofocuscontrol.h" |
|
24 #include "cxesettingsmappersymbian.h" |
|
25 #include "cxutils.h" |
|
26 #include "cxenamespace.h" |
|
27 |
|
28 using namespace Cxe; |
|
29 |
|
30 /* |
|
31 * Map White balance UI value to its corresponding CCamera value |
|
32 */ |
|
33 |
|
34 CCamera::TWhiteBalance |
|
35 CxeSettingsMapperSymbian::Map2CameraWb(int wbId ) |
|
36 { |
|
37 CCamera::TWhiteBalance wb( CCamera::EWBAuto ); |
|
38 switch(wbId) { |
|
39 case WhitebalanceAutomatic: wb = CCamera::EWBAuto; break; |
|
40 case WhitebalanceSunny: wb = CCamera::EWBDaylight; break; |
|
41 case WhitebalanceCloudy: wb = CCamera::EWBCloudy; break; |
|
42 case WhitebalanceIncandescent: wb = CCamera::EWBTungsten; break; |
|
43 case WhitebalanceFluorescent: wb = CCamera::EWBFluorescent; break; |
|
44 default: |
|
45 break; |
|
46 } |
|
47 return wb; |
|
48 } |
|
49 |
|
50 |
|
51 |
|
52 // Map2CameraFlash |
|
53 |
|
54 CCamera::TFlash |
|
55 CxeSettingsMapperSymbian::Map2CameraFlash(int flashId) |
|
56 { |
|
57 CCamera::TFlash flash( CCamera::EFlashAuto ); |
|
58 switch (flashId) { |
|
59 case FlashAuto: flash = CCamera::EFlashAuto; break; |
|
60 case FlashAntiRedEye: flash = CCamera::EFlashRedEyeReduce; break; |
|
61 case FlashOn: flash = CCamera::EFlashForced; break; |
|
62 case FlashOff: flash = CCamera::EFlashNone; break; |
|
63 default: |
|
64 break; |
|
65 } |
|
66 return flash; |
|
67 } |
|
68 |
|
69 |
|
70 // --------------------------------------------------------------------------- |
|
71 // Map2CameraExposureMode |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 CCamera::TExposure |
|
75 CxeSettingsMapperSymbian::Map2CameraExposureMode(int expModeId ) |
|
76 { |
|
77 CCamera::TExposure expo( CCamera::EExposureAuto ); |
|
78 |
|
79 switch ( expModeId ) |
|
80 { |
|
81 case ExposureAuto: expo = CCamera::EExposureAuto; break; |
|
82 case ExposureNight: expo = CCamera::EExposureNight; break; |
|
83 case ExposureBacklight: expo = CCamera::EExposureBacklight; break; |
|
84 case ExposureSport: expo = CCamera::EExposureSport; break; |
|
85 default: |
|
86 break; |
|
87 } |
|
88 |
|
89 return expo; |
|
90 } |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 // --------------------------------------------------------------------------- |
|
96 // Map2CameraEffect |
|
97 // --------------------------------------------------------------------------- |
|
98 // |
|
99 CCamera::CCameraImageProcessing::TEffect |
|
100 CxeSettingsMapperSymbian::Map2CameraEffect(int colourFilterId) |
|
101 { |
|
102 CCamera::CCameraImageProcessing::TEffect effect( |
|
103 CCamera::CCameraImageProcessing::EEffectNone ); |
|
104 |
|
105 switch( colourFilterId ) |
|
106 { |
|
107 case ColortoneNormal: effect = CCamera::CCameraImageProcessing::EEffectNone; break; |
|
108 case ColortoneBlackAndWhite: effect = CCamera::CCameraImageProcessing::EEffectMonochrome; break; |
|
109 case ColortoneSepia: effect = CCamera::CCameraImageProcessing::EEffectSepia; break; |
|
110 case ColortoneNegative: effect = CCamera::CCameraImageProcessing::EEffectNegative; break; |
|
111 case ColortoneVivid: effect = CCamera::CCameraImageProcessing::EEffectVivid; break; |
|
112 default: |
|
113 break; |
|
114 } |
|
115 return effect; |
|
116 } |
|
117 |
|
118 |
|
119 |
|
120 // --------------------------------------------------------------------------- |
|
121 // CxeSettingsMapperSymbian::Map2CameraAutofocus |
|
122 // --------------------------------------------------------------------------- |
|
123 // |
|
124 CCamera::CCameraAdvancedSettings::TFocusRange |
|
125 CxeSettingsMapperSymbian::Map2CameraAutofocus(CxeAutoFocusControl::Mode afMode ) |
|
126 { |
|
127 CCamera::CCameraAdvancedSettings::TFocusRange value; |
|
128 switch( afMode ) { |
|
129 case CxeAutoFocusControl::Macro: |
|
130 value = CCamera::CCameraAdvancedSettings::EFocusRangeMacro; |
|
131 break; |
|
132 case CxeAutoFocusControl::Portrait: |
|
133 value = CCamera::CCameraAdvancedSettings::EFocusRangePortrait; |
|
134 break; |
|
135 case CxeAutoFocusControl::Infinity: |
|
136 value = CCamera::CCameraAdvancedSettings::EFocusRangeInfinite; |
|
137 break; |
|
138 case CxeAutoFocusControl::Hyperfocal: |
|
139 value = CCamera::CCameraAdvancedSettings::EFocusRangeHyperfocal; |
|
140 break; |
|
141 case CxeAutoFocusControl::Auto: // Fall through |
|
142 default: |
|
143 value = CCamera::CCameraAdvancedSettings::EFocusRangeAuto; |
|
144 break; |
|
145 } |
|
146 return value; |
|
147 } |
|
148 |
|
149 |
|
150 |
|
151 // CxeSettingsMapperSymbian::Map2CameraOrientation |
|
152 |
|
153 MCameraOrientation::TOrientation |
|
154 CxeSettingsMapperSymbian::Map2CameraOrientation(DeviceOrientation uiOrientation) |
|
155 { |
|
156 MCameraOrientation::TOrientation cameraOrientation; |
|
157 switch(uiOrientation) { |
|
158 case Orientation90: |
|
159 cameraOrientation = MCameraOrientation::EOrientation90; |
|
160 break; |
|
161 case Orientation180: |
|
162 cameraOrientation = MCameraOrientation::EOrientation180; |
|
163 break; |
|
164 case Orientation270: |
|
165 cameraOrientation = MCameraOrientation::EOrientation270; |
|
166 break; |
|
167 case Orientation0: // default |
|
168 default: |
|
169 cameraOrientation = MCameraOrientation::EOrientation0; |
|
170 break; |
|
171 } |
|
172 return cameraOrientation; |
|
173 } |
|
174 |
|
175 // end of file |