|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #include <ecam/ecamimageprocessingintf.h> |
|
17 #include <ecam/implementationfactoryintf.h> |
|
18 #include <ecamimageprocessing.h> |
|
19 #include "ecamversion.h" |
|
20 #include <ecam/ecamconstants.h> |
|
21 |
|
22 const TInt KBaselinedEffects = 0x000001FF; |
|
23 const TUint KBaselinedImageProcessing = KUidECamEventImageProcessingGlareRemovalUidValue; |
|
24 |
|
25 /** |
|
26 Factory function for creating the CCameraImageProcessing object. |
|
27 The created object is supposed to be meant for image captures only. |
|
28 |
|
29 @param aCamera |
|
30 a reference to a CCamera object providing the settings. |
|
31 |
|
32 @return a pointer to a fully constructed CCameraImageProcessing object. |
|
33 |
|
34 @leave KErrNoMemory Out of memory Or any other system-wide error code. |
|
35 |
|
36 @note Clients using MCameraObserver are not recommended to use this extension class since they cannot handle events. |
|
37 */ |
|
38 EXPORT_C CCamera::CCameraImageProcessing* CCamera::CCameraImageProcessing::NewL(CCamera& aCamera) |
|
39 { |
|
40 CCamera::CCameraImageProcessing* self = new (ELeave)CCamera::CCameraImageProcessing(aCamera); |
|
41 CleanupStack::PushL(self); |
|
42 self->ConstructL(); |
|
43 CleanupStack::Pop(self); |
|
44 |
|
45 return self; |
|
46 } |
|
47 |
|
48 /** |
|
49 @internalComponent |
|
50 |
|
51 Factory function for creating the CCameraImageProcessing object specifically for any one of the following:- |
|
52 VideoCapture and Viewfinder. This may be used in |
|
53 other possible cases as well. |
|
54 |
|
55 The other factory method CCamera::CCameraImageProcessing::NewL is assumed for being operated on image captures only. |
|
56 |
|
57 @param aCamera |
|
58 A reference to a CCamera object providing the settings. |
|
59 |
|
60 @param aImplFactory |
|
61 A reference to the MImplementationFactory derived object. |
|
62 |
|
63 @return a pointer to a fully constructed CCameraImageProcessing object. |
|
64 |
|
65 @leave KErrNoMemory Out of memory. |
|
66 |
|
67 @leave KErrExtensionNotSupported When NewL/NewDuplicateL used instead of New2L/NewDuplicate2L. |
|
68 |
|
69 @note This method is supposed to be used by internal ECAM components only. |
|
70 */ |
|
71 EXPORT_C CCamera::CCameraImageProcessing* CCamera::CCameraImageProcessing::CreateL(CCamera& aCamera, MImplementationFactory& aImplFactory) |
|
72 { |
|
73 if(aCamera.CameraVersion() == KCameraDefaultVersion) |
|
74 { |
|
75 User::Leave(KErrExtensionNotSupported); |
|
76 } |
|
77 |
|
78 CCamera::CCameraImageProcessing* self = new (ELeave)CCamera::CCameraImageProcessing(aCamera); |
|
79 CleanupStack::PushL(self); |
|
80 self->ConstructL(aImplFactory); |
|
81 CleanupStack::Pop(self); |
|
82 |
|
83 return self; |
|
84 } |
|
85 |
|
86 /** |
|
87 CCameraImageProcessing Constructor. |
|
88 |
|
89 @param aOwner |
|
90 a reference to a CCamera object providing the settings. |
|
91 */ |
|
92 EXPORT_C CCamera::CCameraImageProcessing::CCameraImageProcessing(CCamera& aOwner):iOwner(aOwner), iImpl(NULL), iImpl2(NULL), iImpl3(NULL) |
|
93 { |
|
94 } |
|
95 |
|
96 /** |
|
97 CCameraImageProcessing second phase constructor |
|
98 Function used to initialise internal state of the object. Uses reference to the camera to retrieve |
|
99 Camera image processing interface pointer. |
|
100 |
|
101 @leave KErrNoMemory Out of memory. |
|
102 */ |
|
103 EXPORT_C void CCamera::CCameraImageProcessing::ConstructL() |
|
104 { |
|
105 iImpl = static_cast<MCameraImageProcessing*>(iOwner.CustomInterface(KECamMCameraImageProcessingUid)); |
|
106 if (iImpl == NULL) |
|
107 { |
|
108 User::Leave(KErrNotSupported); |
|
109 } |
|
110 |
|
111 iImpl2 = static_cast<MCameraImageProcessing2*>(iOwner.CustomInterface(KECamMCameraImageProcessing2Uid)); |
|
112 iImpl3 = static_cast<MCameraImageProcessing3*>(iOwner.CustomInterface(KECamMCameraImageProcessing3Uid)); |
|
113 } |
|
114 |
|
115 /** |
|
116 @internalComponent |
|
117 |
|
118 CCameraImageProcessing second phase constructor |
|
119 |
|
120 Function used to initialise internal state of the object specifically for any one of the following:- |
|
121 VideoCapture and Viewfinder. This may be used in other possible cases as well. |
|
122 |
|
123 @param aImplFactory |
|
124 A constant reference to the MImplementationFactory derived object. |
|
125 |
|
126 @leave KErrNoMemory Out of memory; or any other error code as well. |
|
127 |
|
128 @note This method is supposed to be used by this class only. |
|
129 */ |
|
130 EXPORT_C void CCamera::CCameraImageProcessing::ConstructL(const MImplementationFactory& aImplFactory) |
|
131 { |
|
132 TInt err = KErrNone; |
|
133 TAny* implPtr = NULL; |
|
134 |
|
135 err = aImplFactory.GetImpl(implPtr, KECamMCameraImageProcessingUid); |
|
136 if (err != KErrNone) |
|
137 { |
|
138 User::Leave(err); |
|
139 } |
|
140 iImpl = static_cast<MCameraImageProcessing*>(implPtr); |
|
141 |
|
142 implPtr = NULL; |
|
143 err = aImplFactory.GetImpl(implPtr, KECamMCameraImageProcessing2Uid); |
|
144 if (err != KErrNone && err != KErrNotSupported) |
|
145 { |
|
146 User::Leave(err); |
|
147 } |
|
148 iImpl2 = static_cast<MCameraImageProcessing2*>(implPtr); |
|
149 |
|
150 implPtr = NULL; |
|
151 err = aImplFactory.GetImpl(implPtr, KECamMCameraImageProcessing3Uid); |
|
152 if (err != KErrNone && err != KErrNotSupported) |
|
153 { |
|
154 User::Leave(err); |
|
155 } |
|
156 iImpl3 = static_cast<MCameraImageProcessing3*>(implPtr); |
|
157 } |
|
158 |
|
159 /** |
|
160 Destructor |
|
161 */ |
|
162 EXPORT_C CCamera::CCameraImageProcessing::~CCameraImageProcessing() |
|
163 { |
|
164 if (iImpl != NULL) |
|
165 { |
|
166 iImpl->Release(); |
|
167 } |
|
168 |
|
169 if (iImpl2 != NULL) |
|
170 { |
|
171 iImpl2->Release(); |
|
172 } |
|
173 |
|
174 if (iImpl3 != NULL) |
|
175 { |
|
176 iImpl3->Release(); |
|
177 } |
|
178 } |
|
179 |
|
180 /** Get all transformations supported on the camera. |
|
181 |
|
182 @param aTransformations |
|
183 An empty RArray of TUids to store the UIDs of the supported transformations. |
|
184 |
|
185 @leave KErrNoMemory Out of memory. |
|
186 */ |
|
187 EXPORT_C void CCamera::CCameraImageProcessing::GetSupportedTransformationsL(RArray<TUid>& aTransformations) const |
|
188 { |
|
189 iImpl->GetSupportedTransformationsL(aTransformations); |
|
190 |
|
191 /* if CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that |
|
192 application is not prepared to receive extra added uid values (new settings added). So, any extra uid value passed |
|
193 from the implementation will be filtered at this point. |
|
194 To receive extra added uid values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
195 to create camera object. In this case, application is assumed to be prepared to receive unrecognised uid values */ |
|
196 if(iOwner.CameraVersion() == KCameraDefaultVersion) |
|
197 { |
|
198 for(TInt index =0; index < aTransformations.Count(); index++) |
|
199 { |
|
200 /** KBaselinedImageProcessing is the baseline. Any image processing attribute with greater uid value means that |
|
201 it has been added in later versions */ |
|
202 if(aTransformations[index].iUid > KBaselinedImageProcessing) |
|
203 { |
|
204 aTransformations.Remove(index); |
|
205 index--; |
|
206 } |
|
207 } |
|
208 } |
|
209 } |
|
210 |
|
211 /** Get currently active transformations on the camera. |
|
212 |
|
213 @param aTransformations |
|
214 An empty RArray of TUids to store the UIDs of the supported transformations. |
|
215 |
|
216 @leave KErrNoMemory Out of memory. |
|
217 */ |
|
218 EXPORT_C void CCamera::CCameraImageProcessing::GetActiveTransformationsL(RArray<TUid>& aTransformations) const |
|
219 { |
|
220 iImpl->GetActiveTransformationsL(aTransformations); |
|
221 |
|
222 /* if CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that |
|
223 application is not prepared to receive extra added uid values (new settings added). So, any extra uid value passed |
|
224 from the implementation will be filtered at this point. |
|
225 To receive extra added uid values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
226 to create camera object. In this case, application is assumed to be prepared to receive unrecognised uid values */ |
|
227 if(iOwner.CameraVersion() == KCameraDefaultVersion) |
|
228 { |
|
229 for(TInt index =0; index < aTransformations.Count(); index++) |
|
230 { |
|
231 /** KBaselinedImageProcessing is the baseline. Any image processing attribute with greater uid value means that |
|
232 it has been added in later versions */ |
|
233 if(aTransformations[index].iUid > KBaselinedImageProcessing) |
|
234 { |
|
235 aTransformations.Remove(index); |
|
236 index--; |
|
237 } |
|
238 } |
|
239 } |
|
240 } |
|
241 |
|
242 /** Get all values supported by an active transformation. |
|
243 |
|
244 @param aTransformation |
|
245 The UID of active transform for which values are requested. |
|
246 |
|
247 @param aValues |
|
248 An array of integers to represent the values for the requested transformation. |
|
249 |
|
250 @param aInfo |
|
251 Additional information describing the returned array of values. |
|
252 |
|
253 @note Depending on the value of aInfo parameter, same array of values may describe |
|
254 different set of values. |
|
255 When camera device doesn't support this, empty array may be returned and TValueInfo may be ENotActive; |
|
256 corresponding getter/setters for this feature should not be used in such a case. |
|
257 |
|
258 @note If CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that |
|
259 application is not prepared to receive extra added enum values for Effects. So, any extra enum value(unrecognised) passed |
|
260 from the implementation will be filtered at this point. |
|
261 To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
262 to create camera object. In this case, application is assumed to be prepared to receive unrecognised enum values |
|
263 |
|
264 @leave KErrNoMemory Out of memory. |
|
265 */ |
|
266 EXPORT_C void CCamera::CCameraImageProcessing::GetTransformationSupportedValuesL(TUid aTransformation, RArray<TInt>& aValues, TValueInfo& aInfo) const |
|
267 { |
|
268 iImpl->GetTransformationSupportedValuesL(aTransformation, aValues, aInfo); |
|
269 |
|
270 /* if CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that |
|
271 application is not prepared to receive extra added enum values for Effects. So, any extra enum value(unrecognised) passed |
|
272 from the implementation will be filtered at this point. |
|
273 To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
274 to create camera object. In this case, application is assumed to be prepared to receive unrecognised enum values */ |
|
275 if(aTransformation == KUidECamEventImageProcessingEffect) |
|
276 { |
|
277 if(iOwner.CameraVersion() == KCameraDefaultVersion) |
|
278 { |
|
279 /** it is assumed that implementation will use EBitField to pack all supported effects */ |
|
280 if(aInfo == EBitField) |
|
281 { |
|
282 aValues[0] &= KBaselinedEffects; |
|
283 } |
|
284 } |
|
285 } |
|
286 } |
|
287 |
|
288 /** |
|
289 @deprecated Use TInt GetTransformationValue(TUid aTransformation, TInt& aTransformationValue); |
|
290 |
|
291 Get the current value of a transformation |
|
292 |
|
293 @param aTransformation |
|
294 The UID of the transformation |
|
295 |
|
296 @return The integer value of the tranformation. |
|
297 |
|
298 @note If CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that |
|
299 application is not prepared to receive extra added enum values for Effects. So, any extra enum value (unrecognised) received |
|
300 from the implementation will be dropped and EEffectNone would be passed instead. |
|
301 To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
302 to create camera object. In this case, application is assumed to be prepared to receive unrecognised enum values |
|
303 */ |
|
304 EXPORT_C TInt CCamera::CCameraImageProcessing::TransformationValue(TUid aTransformation) const |
|
305 { |
|
306 TInt value = iImpl->TransformationValue(aTransformation); |
|
307 |
|
308 /* if CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that |
|
309 application is not prepared to receive extra added enum values for Effects. So, any extra enum value (unrecognised) received |
|
310 from the implementation will be dropped and EEffectNone would be passed instead. |
|
311 To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
312 to create camera object. In this case, application is assumed to be prepared to receive unrecognised enum values */ |
|
313 if(aTransformation == KUidECamEventImageProcessingEffect) |
|
314 { |
|
315 if(iOwner.CameraVersion() == KCameraDefaultVersion) |
|
316 { |
|
317 if(value > KBaselinedEffects) |
|
318 { |
|
319 value = CCamera::CCameraImageProcessing::EEffectNone; |
|
320 } |
|
321 } |
|
322 } |
|
323 return value; |
|
324 } |
|
325 |
|
326 /** Get the current value of a transformation |
|
327 |
|
328 @param aTransformation |
|
329 The UID of the transformation |
|
330 |
|
331 @param aTransformationValue |
|
332 Reference to the integer value of the tranformation. |
|
333 |
|
334 @return system wide error code. |
|
335 |
|
336 @note If CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that |
|
337 application is not prepared to receive extra added enum values for Effects. So, any extra enum value (unrecognised) received |
|
338 from the implementation will be dropped and EEffectNone would be passed instead. |
|
339 To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
340 to create camera object. In this case, application is assumed to be prepared to receive unrecognised enum values |
|
341 |
|
342 @note Use this method instead of deprecated TInt TransformationValue(TUid aTransformation) |
|
343 |
|
344 */ |
|
345 EXPORT_C TInt CCamera::CCameraImageProcessing::GetTransformationValue(TUid aTransformation, TInt& aTransformationValue) const |
|
346 { |
|
347 TInt error = iImpl->GetTransformationValue(aTransformation, aTransformationValue); |
|
348 |
|
349 /* if CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that |
|
350 application is not prepared to receive extra added enum values for Effects. So, any extra enum value (unrecognised) received |
|
351 from the implementation will be dropped and EEffectNone would be passed instead. |
|
352 To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
353 to create camera object. In this case, application is assumed to be prepared to receive unrecognised enum values */ |
|
354 if(aTransformation == KUidECamEventImageProcessingEffect) |
|
355 { |
|
356 if(iOwner.CameraVersion() == KCameraDefaultVersion) |
|
357 { |
|
358 if(aTransformationValue > KBaselinedEffects) |
|
359 { |
|
360 aTransformationValue = CCamera::CCameraImageProcessing::EEffectNone; |
|
361 } |
|
362 } |
|
363 } |
|
364 |
|
365 return error; |
|
366 } |
|
367 |
|
368 /** Set new value for a transformation. |
|
369 A notification event with the transformation UID is sent to |
|
370 all clients. UIDs are in the form KUidECamEventImageProcessingXXXX. |
|
371 |
|
372 @param aTransformation |
|
373 The UID of the transformation |
|
374 |
|
375 @param aValue |
|
376 The integer value of the tranformation. |
|
377 */ |
|
378 EXPORT_C void CCamera::CCameraImageProcessing::SetTransformationValue(TUid aTransformation, TInt aValue) |
|
379 { |
|
380 iImpl->SetTransformationValue(aTransformation, aValue); |
|
381 } |
|
382 |
|
383 /** Get the sequence of all active transforms, ordered in order of execution. |
|
384 |
|
385 @param aTransformSequence |
|
386 an empty array to be populated with sequence of transform UIDs, |
|
387 where transform entries with smaller index are executed earlier. |
|
388 |
|
389 @leave KErrNoMemory Out of memory. |
|
390 */ |
|
391 EXPORT_C void CCamera::CCameraImageProcessing::GetActiveTransformSequenceL(RArray<TUid>& aTransformSequence) const |
|
392 { |
|
393 iImpl->GetActiveTransformSequenceL(aTransformSequence); |
|
394 |
|
395 /* if CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that |
|
396 application is not prepared to receive extra added uid values (new settings added). So, any extra uid value passed |
|
397 from the implementation will be filtered at this point. |
|
398 To receive extra added uid values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() |
|
399 to create camera object. In this case, application is assumed to be prepared to receive unrecognised uid values */ |
|
400 if(iOwner.CameraVersion() == KCameraDefaultVersion) |
|
401 { |
|
402 for(TInt index =0; index < aTransformSequence.Count(); index++) |
|
403 { |
|
404 /** KBaselinedImageProcessing is the baseline. Any image processing attribute with greater uid value means that |
|
405 it has been added in later versions */ |
|
406 if(aTransformSequence[index].iUid > KBaselinedImageProcessing) |
|
407 { |
|
408 aTransformSequence.Remove(index); |
|
409 index--; |
|
410 } |
|
411 } |
|
412 } |
|
413 } |
|
414 |
|
415 /** |
|
416 Set the order of all active transform in terms of execution. The transforms with |
|
417 smaller index are executed earlier. |
|
418 |
|
419 @param aTransformSequence |
|
420 The list of ordered transforms, where transforms with smaller |
|
421 index are executed earlier. |
|
422 |
|
423 @leave KErrNoMemory Out of memory. |
|
424 */ |
|
425 EXPORT_C void CCamera::CCameraImageProcessing::SetActiveTransformSequenceL(RArray<TUid>& aTransformSequence) |
|
426 { |
|
427 iImpl->SetActiveTransformSequenceL(aTransformSequence); |
|
428 } |
|
429 |
|
430 /** |
|
431 Set the source rectangle for KUidECamEventImageProcessingTransformScale or |
|
432 KUidECamEventImageProcessingTransformCrop. |
|
433 The coordinates should fall within the current image rectangle. The result |
|
434 is always a logical AND operation between the two rectangles. |
|
435 |
|
436 @param aRect |
|
437 a reference to TRect object which describes the coordinates of the |
|
438 area of interest. |
|
439 */ |
|
440 EXPORT_C void CCamera::CCameraImageProcessing::SetSourceRect(const TRect& aRect) |
|
441 { |
|
442 iImpl->SetSourceRect(aRect); |
|
443 } |
|
444 |
|
445 /** |
|
446 Get the source rectangle for KUidECamEventImageProcessingTransformScale or |
|
447 KUidECamEventImageProcessingTransformCrop. |
|
448 The coordinates should fall within the current image rectangle. The result |
|
449 is always a logical AND operation between the two rectangles. |
|
450 |
|
451 @param aRect |
|
452 a reference to TRect object to hold the current source rectangle |
|
453 coordinates. If it has not been set, the coordinates match these of |
|
454 the whole image. |
|
455 */ |
|
456 EXPORT_C void CCamera::CCameraImageProcessing::GetSourceRect(TRect& aRect) const |
|
457 { |
|
458 iImpl->GetSourceRect(aRect); |
|
459 } |
|
460 |
|
461 |
|
462 /** |
|
463 Retrieves the maximum number of simultaneous color swapping possible. |
|
464 |
|
465 @param aConcurrentColorSwappingSupported |
|
466 Retrieves the number of simultaneous color swapping supported. |
|
467 Retrieves 0 when swapping feature is not supported. |
|
468 |
|
469 @leave May leave as a result of some error. |
|
470 |
|
471 */ |
|
472 EXPORT_C void CCamera::CCameraImageProcessing::GetConcurrentColorSwappingsSupportedL(TInt& aConcurrentColorSwappingSupported) const |
|
473 { |
|
474 if(iImpl2 != NULL) |
|
475 { |
|
476 iImpl2->GetConcurrentColorSwappingsSupportedL(aConcurrentColorSwappingSupported); |
|
477 } |
|
478 else |
|
479 { |
|
480 User::Leave(KErrNotSupported); |
|
481 } |
|
482 } |
|
483 |
|
484 /** |
|
485 Retrieves the color swapping capabilites per entry, if different entries have different capabilities |
|
486 otherwise the same capabilities retrieved for a particular entry can be assumed to be valid for every entry |
|
487 |
|
488 @param aIndex |
|
489 This is a value from 0 to numOfSimultaneousColorSwappings -1. Color swapping capabilities specific to |
|
490 a particular entry are retrieved. If uniform capability exists for every entry, then this method need not |
|
491 be called per entry. |
|
492 |
|
493 @param aColorSwapCapabilities |
|
494 This retrieves the color swap capabilities. |
|
495 |
|
496 @leave May leave as a result of some error. |
|
497 |
|
498 */ |
|
499 EXPORT_C void CCamera::CCameraImageProcessing::GetColorSwapCapabilitiesL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationCapabilities& aColorSwapCapabilities) const |
|
500 { |
|
501 if(iImpl2 != NULL) |
|
502 { |
|
503 iImpl2->GetColorSwapCapabilitiesL(aIndex, aColorSwapCapabilities); |
|
504 } |
|
505 else |
|
506 { |
|
507 User::Leave(KErrNotSupported); |
|
508 } |
|
509 } |
|
510 |
|
511 /** |
|
512 Set the color swap entries |
|
513 |
|
514 @param aIndex |
|
515 This is a value from 0 to numOfSimultaneousColorSwappings -1. This helps in managing the limited no. of |
|
516 simultaneous color swaps. If parameters are already set for the given entry, then it's up to the implementation |
|
517 to replace the existing one or discard it. |
|
518 |
|
519 @param aColorSwapParameters |
|
520 The parameters necessary to define clearly the color swapping operation for the given entry. |
|
521 iEntryStatus has to be updated by the implementation as per the result of the setting operation. |
|
522 So, iEntryStatus value is redundant at this point. |
|
523 |
|
524 @leave KErrNotSupported if implementation is not present. |
|
525 |
|
526 @note Triggers KUidECamEventCIPSetColorSwapEntry to all MCameraObserver2 clients of the camera. |
|
527 HandleEvent is used to report the result or any possible error. TECAMEvent2 class should |
|
528 be used in order to provide the entry no. of the color being set. |
|
529 |
|
530 */ |
|
531 EXPORT_C void CCamera::CCameraImageProcessing::SetColorSwapEntryL(TInt aIndex, const CCamera::CCameraImageProcessing::TColorOperationEntry& aColorSwapParameters) |
|
532 { |
|
533 if(iImpl2 != NULL) |
|
534 { |
|
535 iImpl2->SetColorSwapEntry(aIndex, aColorSwapParameters); |
|
536 } |
|
537 else |
|
538 { |
|
539 User::Leave(KErrNotSupported); |
|
540 } |
|
541 } |
|
542 |
|
543 /** |
|
544 Removes the color swap entry corresponding to the given index |
|
545 |
|
546 @param aIndex |
|
547 This gives the color swapping entry to be removed. |
|
548 |
|
549 @leave KErrNotSupported if implementation is not present. |
|
550 |
|
551 @note Triggers KUidECamEventCIPRemoveColorSwapEntry to all MCameraObserver2 clients of the camera. |
|
552 HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be |
|
553 used in order to provide the entry no. of the color being removed. |
|
554 |
|
555 */ |
|
556 EXPORT_C void CCamera::CCameraImageProcessing::RemoveColorSwapEntryL(TInt aIndex) |
|
557 { |
|
558 if(iImpl2 != NULL) |
|
559 { |
|
560 iImpl2->RemoveColorSwapEntry(aIndex); |
|
561 } |
|
562 else |
|
563 { |
|
564 User::Leave(KErrNotSupported); |
|
565 } |
|
566 } |
|
567 |
|
568 /** |
|
569 Get the details of the color swap entry corresponding to the given index |
|
570 |
|
571 @param aIndex |
|
572 This gives the color swapping entry whose information has to be retrieved. |
|
573 |
|
574 @param aColorSwapParameters |
|
575 This contains the parameters currently being used by the color swapping operation for the given entry. |
|
576 |
|
577 @leave May leave as a result of some error. |
|
578 |
|
579 */ |
|
580 EXPORT_C void CCamera::CCameraImageProcessing::GetColorSwapEntryL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationEntry& aColorSwapParameters) const |
|
581 { |
|
582 if(iImpl2 != NULL) |
|
583 { |
|
584 iImpl2->GetColorSwapEntryL(aIndex, aColorSwapParameters); |
|
585 } |
|
586 else |
|
587 { |
|
588 User::Leave(KErrNotSupported); |
|
589 } |
|
590 } |
|
591 |
|
592 /** |
|
593 Starts the color swapping process after taking into account the color swap entries updated up to this point. |
|
594 |
|
595 @leave KErrNotSupported if implementation is not present. |
|
596 |
|
597 @note Triggers KUidECamEventCIPStartColorSwap to all MCameraObserver2 clients of the camera. |
|
598 HandleEvent is used to report the result or any possible error. |
|
599 One possible error case is when more than one entry describe the same color source. |
|
600 New ecam error KErrECamColorOperationConflict used in such a case. |
|
601 |
|
602 */ |
|
603 EXPORT_C void CCamera::CCameraImageProcessing::StartColorSwappingL() |
|
604 { |
|
605 if(iImpl2 != NULL) |
|
606 { |
|
607 iImpl2->StartColorSwapping(); |
|
608 } |
|
609 else |
|
610 { |
|
611 User::Leave(KErrNotSupported); |
|
612 } |
|
613 } |
|
614 |
|
615 /** |
|
616 Cancel the color swapping process. |
|
617 |
|
618 @leave May leave as a result of some error. |
|
619 |
|
620 @note Used to cancel the color swapping process which might have been just started. |
|
621 If the issued StartColorSwappingL() gets cancelled, its event should report KErrCancel. |
|
622 |
|
623 */ |
|
624 EXPORT_C void CCamera::CCameraImageProcessing::CancelColorSwappingL() |
|
625 { |
|
626 if(iImpl2 != NULL) |
|
627 { |
|
628 iImpl2->CancelColorSwappingL(); |
|
629 } |
|
630 else |
|
631 { |
|
632 User::Leave(KErrNotSupported); |
|
633 } |
|
634 } |
|
635 |
|
636 /** |
|
637 Retrieves the maximum number of color entries on which simultaneous color accent process is possible. |
|
638 |
|
639 @param aConcurrentColorAccentSupported |
|
640 Retrieves the number of color entries on which simultaneous color accent process is possible. |
|
641 Retrieves 0 when color accent process is not supported. |
|
642 |
|
643 @leave May leave as a result of some error. |
|
644 |
|
645 */ |
|
646 EXPORT_C void CCamera::CCameraImageProcessing::GetConcurrentColorAccentSupportedL(TInt& aConcurrentColorAccentSupported) const |
|
647 { |
|
648 if(iImpl2 != NULL) |
|
649 { |
|
650 iImpl2->GetConcurrentColorAccentSupportedL(aConcurrentColorAccentSupported); |
|
651 } |
|
652 else |
|
653 { |
|
654 User::Leave(KErrNotSupported); |
|
655 } |
|
656 } |
|
657 |
|
658 /** |
|
659 Retrieves the color accent capabilites per entry, if different entries have different capabilities |
|
660 otherwise the same capabilities retrieved for a particular entry can be assumed to be valid for every entry |
|
661 |
|
662 @param aIndex |
|
663 This is a value from 0 to numOfSimultaneousColorAccent -1. Color accent capabilities specific to |
|
664 a particular entry are retrieved. If uniform capability exists for every entry, then this method need not |
|
665 be called per entry. |
|
666 |
|
667 @param aColorAccentCapabilities |
|
668 This retrieves the color accent capabilities. |
|
669 |
|
670 @leave May leave as a result of some error. |
|
671 |
|
672 */ |
|
673 EXPORT_C void CCamera::CCameraImageProcessing::GetColorAccentCapabilitiesL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationCapabilities& aColorAccentCapabilities) const |
|
674 { |
|
675 if(iImpl2 != NULL) |
|
676 { |
|
677 iImpl2->GetColorAccentCapabilitiesL(aIndex, aColorAccentCapabilities); |
|
678 } |
|
679 else |
|
680 { |
|
681 User::Leave(KErrNotSupported); |
|
682 } |
|
683 } |
|
684 |
|
685 /** |
|
686 Set the color accent entries |
|
687 |
|
688 @param aIndex |
|
689 This is a value from 0 to numOfSimultaneousColorAccent -1. This helps in managing the limited no. of |
|
690 simultaneous color accent. If parameters are already set for the given entry, then it's up to the implementation |
|
691 to replace the existing one or discard it. |
|
692 |
|
693 @param aColorAccentParameters |
|
694 The parameters necessary to define clearly the color accent operation for the given entry. |
|
695 iEntryStatus has to be updated by the implementation as per the result of the setting operation. |
|
696 So, iEntryStatus value is redundant at this point. The parameters defined for target colors in |
|
697 TColorOperationEntry are redundant for color accent. |
|
698 |
|
699 @leave KErrNotSupported if implementation is not present. |
|
700 |
|
701 @note Triggers KUidECamEventCIPSetColorAccentEntry to all MCameraObserver2 clients of the camera. |
|
702 HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be |
|
703 used in order to provide the entry no. of the color being set. |
|
704 |
|
705 */ |
|
706 EXPORT_C void CCamera::CCameraImageProcessing::SetColorAccentEntryL(TInt aIndex, const CCamera::CCameraImageProcessing::TColorOperationEntry& aColorAccentParameters) |
|
707 { |
|
708 if(iImpl2 != NULL) |
|
709 { |
|
710 iImpl2->SetColorAccentEntry(aIndex, aColorAccentParameters); |
|
711 } |
|
712 else |
|
713 { |
|
714 User::Leave(KErrNotSupported); |
|
715 } |
|
716 } |
|
717 |
|
718 /** |
|
719 Removes the color accent entry corresponding to the given index |
|
720 |
|
721 @param aIndex |
|
722 This gives the color accent entry to be removed. |
|
723 |
|
724 @leave KErrNotSupported if implementation is not present. |
|
725 |
|
726 @note Triggers KUidECamEventCIPRemoveColorAccentEntry to all MCameraObserver2 clients of the camera. |
|
727 HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be |
|
728 used in order to provide the entry no. of the color being removed. |
|
729 |
|
730 */ |
|
731 EXPORT_C void CCamera::CCameraImageProcessing::RemoveColorAccentEntryL(TInt aIndex) |
|
732 { |
|
733 if(iImpl2 != NULL) |
|
734 { |
|
735 iImpl2->RemoveColorAccentEntry(aIndex); |
|
736 } |
|
737 else |
|
738 { |
|
739 User::Leave(KErrNotSupported); |
|
740 } |
|
741 } |
|
742 |
|
743 /** |
|
744 Get the details of the color accent entry corresponding to the given index |
|
745 |
|
746 @param aIndex |
|
747 This gives the color accent entry whose information has to be retrieved. |
|
748 |
|
749 @param aColorAccentParameters |
|
750 This contains the parameters currently being used by the color accent operation for the given entry. |
|
751 The parameters defined for target colors in TColorOperationEntry are redundant for color accent. |
|
752 |
|
753 @leave May leave as a result of some error. |
|
754 |
|
755 */ |
|
756 EXPORT_C void CCamera::CCameraImageProcessing::GetColorAccentEntryL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationEntry& aColorAccentParameters) const |
|
757 { |
|
758 if(iImpl2 != NULL) |
|
759 { |
|
760 iImpl2->GetColorAccentEntryL(aIndex, aColorAccentParameters); |
|
761 } |
|
762 else |
|
763 { |
|
764 User::Leave(KErrNotSupported); |
|
765 } |
|
766 } |
|
767 |
|
768 /** |
|
769 Starts the color accent process after taking into account the color accent entries updated up to this point. |
|
770 |
|
771 @leave KErrNotSupported if implementation is not present. |
|
772 |
|
773 @note Triggers KUidECamEventCIPStartColorAccent to all MCameraObserver2 clients of the camera. |
|
774 HandleEvent is used to report the result or any possible error. |
|
775 |
|
776 */ |
|
777 EXPORT_C void CCamera::CCameraImageProcessing::StartColorAccentL() |
|
778 { |
|
779 if(iImpl2 != NULL) |
|
780 { |
|
781 iImpl2->StartColorAccent(); |
|
782 } |
|
783 else |
|
784 { |
|
785 User::Leave(KErrNotSupported); |
|
786 } |
|
787 } |
|
788 |
|
789 /** |
|
790 Cancel the color accent process. |
|
791 |
|
792 @leave May leave as a result of some error. |
|
793 |
|
794 @note Used to cancel the color accent process which might have been just started. |
|
795 If the issued StartColorAccentL() gets cancelled, its event should report KErrCancel. |
|
796 |
|
797 */ |
|
798 EXPORT_C void CCamera::CCameraImageProcessing::CancelColorAccentL() |
|
799 { |
|
800 if(iImpl2 != NULL) |
|
801 { |
|
802 iImpl2->CancelColorAccentL(); |
|
803 } |
|
804 else |
|
805 { |
|
806 User::Leave(KErrNotSupported); |
|
807 } |
|
808 } |
|
809 |
|
810 /** |
|
811 Retrieves the supported options for a particular orientation reference. |
|
812 |
|
813 @param aOrientationReference |
|
814 A TOrientationReference for which supported relative custom orientation have to retrieved. |
|
815 |
|
816 @param aSupportedRelativeRotation |
|
817 A bitfield which retrieves the supported TRelativeRotation for 'aOrientationReference' |
|
818 |
|
819 @param aSupportedRelativeMirroring |
|
820 A bitfield which retrieves the supported TRelativeMirror for 'aOrientationReference' |
|
821 |
|
822 @param aSupportedRelativeFlipping |
|
823 A bitfield which retrieves the supported TRelativeFlipping for 'aOrientationReference' |
|
824 |
|
825 @leave May leave with any error code. |
|
826 |
|
827 @publishedPartner |
|
828 @prototype |
|
829 */ |
|
830 EXPORT_C void CCamera::CCameraImageProcessing::GetSupportedRelativeOrientationOptionsL(CCamera::CCameraImageProcessing::TOrientationReference aOrientationReference, |
|
831 TUint& aSupportedRelativeRotation, TUint& aSupportedRelativeMirroring, TUint& aSupportedRelativeFlipping) const |
|
832 { |
|
833 if(iImpl3 != NULL) |
|
834 { |
|
835 iImpl3->GetSupportedRelativeOrientationOptionsL(aOrientationReference, aSupportedRelativeRotation, |
|
836 aSupportedRelativeMirroring, aSupportedRelativeFlipping); |
|
837 } |
|
838 else |
|
839 { |
|
840 User::Leave(KErrNotSupported); |
|
841 } |
|
842 } |
|
843 |
|
844 /** |
|
845 Retrieves the options which is being used for the current orientation reference. |
|
846 |
|
847 @param aOrientationReference |
|
848 A TOrientationReference which is the current orientation reference being used. |
|
849 |
|
850 @param aRelativeRotation |
|
851 A TRelativeRotation which is the current relative rotation being used with aOrientationReference. |
|
852 |
|
853 @param aRelativeMirror |
|
854 A TRelativeMirror which is the current relative mirroring being used with aOrientationReference. |
|
855 |
|
856 @param aRelativeFlipping |
|
857 A TRelativeFlipping which is the current relative flipping being used with aOrientationReference. |
|
858 |
|
859 @leave May leave with any error code. |
|
860 |
|
861 @publishedPartner |
|
862 @prototype |
|
863 */ |
|
864 EXPORT_C void CCamera::CCameraImageProcessing::GetCurrentRelativeOrientationOptionsL(CCamera::CCameraImageProcessing::TOrientationReference& aOrientationReference, |
|
865 CCamera::CCameraImageProcessing::TRelativeRotation& aRelativeRotation, |
|
866 CCamera::CCameraImageProcessing::TRelativeMirror& aRelativeMirror, |
|
867 CCamera::CCameraImageProcessing::TRelativeFlipping& aRelativeFlipping) const |
|
868 { |
|
869 if(iImpl3 != NULL) |
|
870 { |
|
871 iImpl3->GetCurrentRelativeOrientationOptionsL(aOrientationReference, aRelativeRotation, aRelativeMirror, aRelativeFlipping); |
|
872 } |
|
873 else |
|
874 { |
|
875 User::Leave(KErrNotSupported); |
|
876 } |
|
877 } |
|
878 |
|
879 /** |
|
880 Sets the options which would be used with the desired orientation reference. |
|
881 |
|
882 @param aOrientationReference |
|
883 The desired TOrientationReference. |
|
884 |
|
885 @param aRelativeRotation |
|
886 The desired TRelativeRotation which would be used with 'aOrientationReference'. |
|
887 |
|
888 @param TRelativeMirror |
|
889 The desired TRelativeMirror which would be used with 'aOrientationReference' |
|
890 |
|
891 @param TRelativeFlipping |
|
892 The desired TRelativeFlipping which would be used with 'aOrientationReference' |
|
893 |
|
894 @leave KErrNotSupported if the implementation of this method is not present. |
|
895 |
|
896 @note Event KUidECamEventImageProcessingTransformRelativeOrientation is used to notify clients about relative |
|
897 custom orientation setting operation. |
|
898 |
|
899 @note If the current picture orientation (Refer CCamera::CCameraAdvancedSettings::TPictureOrientation) is not possible |
|
900 to be achieved with the relative custom orientation, event KUidECamEventPictureOrientationUnachievable will be |
|
901 notified to the client. |
|
902 |
|
903 @note If the dimension of the image gets changed by the desired relative orientation options, notification |
|
904 KUidECamEventCameraSettingImageSize will be notified to the client. |
|
905 |
|
906 @publishedPartner |
|
907 @prototype |
|
908 */ |
|
909 EXPORT_C void CCamera::CCameraImageProcessing::SetRelativeOrientationOptionsL(CCamera::CCameraImageProcessing::TOrientationReference aOrientationReference, |
|
910 CCamera::CCameraImageProcessing::TRelativeRotation aRelativeRotation, |
|
911 CCamera::CCameraImageProcessing::TRelativeMirror aRelativeMirror, |
|
912 CCamera::CCameraImageProcessing::TRelativeFlipping aRelativeFlipping) |
|
913 { |
|
914 if(iImpl3 != NULL) |
|
915 { |
|
916 iImpl3->SetRelativeOrientationOptions(aOrientationReference, aRelativeRotation, aRelativeMirror, aRelativeFlipping); |
|
917 } |
|
918 else |
|
919 { |
|
920 User::Leave(KErrNotSupported); |
|
921 } |
|
922 } |
|
923 |
|
924 /** |
|
925 Constructor for the TColorOperationCapabilities class. |
|
926 Sets the size and version of this class. |
|
927 */ |
|
928 EXPORT_C CCamera::CCameraImageProcessing::TColorOperationCapabilities::TColorOperationCapabilities() |
|
929 { |
|
930 iSize = sizeof(CCamera::CCameraImageProcessing::TColorOperationCapabilities); |
|
931 iVersion = KECamColorOperationCapabilitiesCurrentVersion; |
|
932 } |
|
933 |
|
934 /** |
|
935 Returns the size of the class. Used for extensibility by deriving from this base class and adding new member variables. |
|
936 Intended to be used for implementation of methods where this class reference is passed as function arguments. |
|
937 Implementation of such methods can find out the whether the actual class passed is base or the derived one. So, if a new application |
|
938 is made to run on an old implementation, an error may occur in such cases after the old implementation detects this by getting |
|
939 the size information of the T class passed. Also, if old application is made to run on a new implementation, this could be |
|
940 properly handled if the derived class variables handling is done in a proper 'if-else' statement. |
|
941 |
|
942 @return The size of the class. |
|
943 |
|
944 @note The size will be modified when the T-class gets updated. |
|
945 */ |
|
946 EXPORT_C TInt CCamera::CCameraImageProcessing::TColorOperationCapabilities::Size() const |
|
947 { |
|
948 return static_cast<TInt>(iSize); |
|
949 } |
|
950 |
|
951 /** |
|
952 Returns the version of the class. Used for extensibility specially when the class members are not added but the Reserved |
|
953 members get used at a later stage. |
|
954 |
|
955 @return The version of this class. |
|
956 |
|
957 @note The version will be modified when the T-class gets updated. |
|
958 */ |
|
959 EXPORT_C TUint CCamera::CCameraImageProcessing::TColorOperationCapabilities::Version() const |
|
960 { |
|
961 return iVersion; |
|
962 } |
|
963 |
|
964 /** |
|
965 Constructor for the TBitsIgnore class. |
|
966 Sets the size and version of this class. |
|
967 */ |
|
968 EXPORT_C CCamera::CCameraImageProcessing::TBitsIgnore::TBitsIgnore() |
|
969 { |
|
970 iSize = sizeof(CCamera::CCameraImageProcessing::TBitsIgnore); |
|
971 iVersion = KECamBitsIgnoreCurrentVersion; |
|
972 iRedBitsIgnore = 0; |
|
973 iGreenBitsIgnore = 0; |
|
974 iBlueBitsIgnore = 0; |
|
975 iAlphaBitsIgnore = 0; |
|
976 } |
|
977 |
|
978 /** |
|
979 Returns the size of the class. Used for extensibility by deriving from this base class and adding new member variables. |
|
980 Intended to be used for implementation of methods where this class reference is passed as function arguments. |
|
981 Implementation of such methods can find out the whether the actual class passed is base or the derived one. So, if a new application |
|
982 is made to run on an old implementation, an error may occur in such cases after the old implementation detects this by getting |
|
983 the size information of the T class passed. Also, if old application is made to run on a new implementation, this could be |
|
984 properly handled if the derived class variables handling is done in a proper 'if-else' statement. |
|
985 |
|
986 @return The size of the class. |
|
987 |
|
988 @note The size will be modified when the T-class gets updated. |
|
989 */ |
|
990 EXPORT_C TInt CCamera::CCameraImageProcessing::TBitsIgnore::Size() const |
|
991 { |
|
992 return static_cast<TInt>(iSize); |
|
993 } |
|
994 |
|
995 /** |
|
996 Returns the version of the class. Used for extensibility specially when the class members are not added but the Reserved |
|
997 members get used at a later stage. |
|
998 |
|
999 @return The version of this class. |
|
1000 |
|
1001 @note The version will be modified when the T-class gets updated. |
|
1002 */ |
|
1003 EXPORT_C TUint CCamera::CCameraImageProcessing::TBitsIgnore::Version() const |
|
1004 { |
|
1005 return iVersion; |
|
1006 } |
|
1007 |
|
1008 /** |
|
1009 Constructor for the TColorOperationEntry class. |
|
1010 Sets the size and version of this class. |
|
1011 */ |
|
1012 EXPORT_C CCamera::CCameraImageProcessing::TColorOperationEntry::TColorOperationEntry() |
|
1013 { |
|
1014 iSize = sizeof(CCamera::CCameraImageProcessing::TColorOperationEntry); |
|
1015 iVersion = KECamColorOperationEntryCurrentVersion; |
|
1016 } |
|
1017 |
|
1018 /** |
|
1019 Returns the size of the class. Used for extensibility by deriving from this base class and adding new member variables. |
|
1020 Intended to be used for implementation of methods where this class reference is passed as function arguments. |
|
1021 Implementation of such methods can find out the whether the actual class passed is base or the derived one. So, if a new application |
|
1022 is made to run on an old implementation, an error may occur in such cases after the old implementation detects this by getting |
|
1023 the size information of the T class passed. Also, if old application is made to run on a new implementation, this could be |
|
1024 properly handled if the derived class variables handling is done in a proper 'if-else' statement. |
|
1025 |
|
1026 @return The size of the class. |
|
1027 |
|
1028 @note The size will be modified when the T-class gets updated. |
|
1029 */ |
|
1030 EXPORT_C TInt CCamera::CCameraImageProcessing::TColorOperationEntry::Size() const |
|
1031 { |
|
1032 return static_cast<TInt>(iSize); |
|
1033 } |
|
1034 |
|
1035 /** |
|
1036 Returns the version of the class. Used for extensibility specially when the class members are not added but the Reserved |
|
1037 members get used at a later stage. |
|
1038 |
|
1039 @return The version of this class. |
|
1040 |
|
1041 @note The version will be modified when the T-class gets updated. |
|
1042 */ |
|
1043 EXPORT_C TUint CCamera::CCameraImageProcessing::TColorOperationEntry::Version() const |
|
1044 { |
|
1045 return iVersion; |
|
1046 } |