|
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 /** |
|
17 @file |
|
18 @publishedPartner |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef ECAMIMAGEPROCESSINGINTF_H |
|
23 #define ECAMIMAGEPROCESSINGINTF_H |
|
24 |
|
25 #include <ecamimageprocessing.h> |
|
26 #include <ecam/ecamadvsettingsintfuids.hrh> |
|
27 |
|
28 /** This is the UID which is used to obtain the interface MCameraImageProcessing, via the |
|
29 CCamera::CustomInterface() call, which provides implementation of the M-class interface. */ |
|
30 static const TUid KECamMCameraImageProcessingUid = {KECamMCameraImageProcessingUidValue}; |
|
31 |
|
32 /** |
|
33 This is the UID which is used to obtain the interface MCameraImageProcessing2, via the |
|
34 CCamera::CustomInterface() call, which provides implementation of the M-class interface. |
|
35 */ |
|
36 static const TUid KECamMCameraImageProcessing2Uid = {KECamMCameraImageProcessing2UidValue}; |
|
37 |
|
38 /** |
|
39 This is the UID which is used to obtain the interface MCameraImageProcessing3, via the |
|
40 CCamera::CustomInterface() call, which provides implementation of the M-class interface. |
|
41 @publishedPartner |
|
42 @prototype |
|
43 */ |
|
44 static const TUid KECamMCameraImageProcessing3Uid = {KECamMCameraImageProcessing3UidValue}; |
|
45 |
|
46 |
|
47 /** |
|
48 Mixin class for implementation by providers of the Image Processing Camera Extension API. |
|
49 |
|
50 This class is used to perform image processing operations on the camera. |
|
51 These include brightness, contrast, gamma, hue, sharpness and saturation adjustments. The client is also |
|
52 able to perform simple image transformations like cropping, rotation, mirroring, scaling, noise reduction and glare reduction. . |
|
53 When an operation selection is complete, all clients are notified with the respective event UID. |
|
54 |
|
55 As often cameras may support only a subset of discrete values of the allowed range, |
|
56 the API allows the client to retrieve those and use them explicitly. |
|
57 |
|
58 @note it is assumed that setting a new value for a transformations(transform, adjust, effect) effectively |
|
59 activates the transformations. Whilst for effects and adjustments there is always a value, transforms |
|
60 may have a dependency on other parameters and |
|
61 crop - requires setting of source rectangle. |
|
62 scale - will use setting of source rectangle, and the magnification factor is |
|
63 determined by the source rectangle and the output size. This is always magnification. |
|
64 if a value is set, it is assumed to be a scaling factor multiplied by KECamFineResolutionFactor |
|
65 and set to integer. |
|
66 mirror - values of TMirror type. |
|
67 rotation - the angle in degrees. |
|
68 noise reduction - TNoiseReduction. |
|
69 glare removal - TGlareReduction. |
|
70 |
|
71 Example |
|
72 Let's assume that an application would need to check whether gamma correction is |
|
73 supported on a particular platform. After obtaining a valid pointer to the interface, |
|
74 it would call GetSupportedTransformationsL() to obtain the list of the supported |
|
75 tranformations and check whether KUidECamEventImageProcessingAdjustGamma |
|
76 is in the list. If it is then call SetTranformationValue(KUidECamEventImageProcessingAdjustGamma, 200); |
|
77 to set the new value. A notification will be generated to the client to indicate success. |
|
78 |
|
79 @publishedPartner |
|
80 @released |
|
81 */ |
|
82 class MCameraImageProcessing |
|
83 { |
|
84 |
|
85 public: |
|
86 |
|
87 /** |
|
88 Releases the interface. |
|
89 */ |
|
90 virtual void Release()=0; |
|
91 |
|
92 /** Get all transformations supported on the camera. |
|
93 |
|
94 @param aTransformations |
|
95 An empty RArray of TUids to store the UIDs of the supported transformations. |
|
96 |
|
97 @leave KErrNoMemory Out of memory. May also leave as a result of other system errors. |
|
98 */ |
|
99 virtual void GetSupportedTransformationsL(RArray<TUid>& aTransformations) const=0; |
|
100 |
|
101 /** Get currently active transformations on the camera. |
|
102 |
|
103 @param aTransformations |
|
104 An empty RArray of TUids to store the UIDs of the supported transformations. |
|
105 |
|
106 @leave KErrNoMemory Out of memory. May also leave as a result of other system errors. |
|
107 */ |
|
108 virtual void GetActiveTransformationsL(RArray<TUid>& aTransformations) const=0; |
|
109 |
|
110 /** Get all values supported by an active transformation. |
|
111 |
|
112 @param aTransformation |
|
113 The UID of active transform for which values are requested. |
|
114 |
|
115 @param aValues |
|
116 An array of integers to represent the values for the requested transformation. |
|
117 |
|
118 @param aInfo |
|
119 Additional information describing the returned array of values. |
|
120 |
|
121 @note depending on the value of aInfo parameter, same array of values may describe |
|
122 different set of values. |
|
123 When camera device doesn't support this, empty array should be returned and TValueInfo should be ENotActive, |
|
124 and the corresponding getter/setters for this feature should not be used. |
|
125 |
|
126 @leave KErrNoMemory Out of memory. May also leave as a result of other system errors. |
|
127 */ |
|
128 virtual void GetTransformationSupportedValuesL(TUid aTransformation, RArray<TInt>& aValues, TValueInfo& aInfo) const=0; |
|
129 |
|
130 /** |
|
131 @deprecated Use TInt GetTransformationValue(TUid aTransformation, TInt& aTransformationValue); |
|
132 |
|
133 Get the current value of a transformation |
|
134 |
|
135 @param aTransformation |
|
136 The UID of the transformation |
|
137 |
|
138 @return The integer value of the tranformation. |
|
139 */ |
|
140 virtual TInt TransformationValue(TUid aTransformation) const=0; |
|
141 |
|
142 /** Get the current value of a transformation |
|
143 |
|
144 @param aTransformation |
|
145 The UID of the transformation |
|
146 |
|
147 @param aTransformationValue |
|
148 Reference to the integer value of the tranformation. |
|
149 |
|
150 @return system wide error code. |
|
151 */ |
|
152 virtual TInt GetTransformationValue(TUid aTransformation, TInt& aTransformationValue) const=0; |
|
153 |
|
154 /** Set new value for a transformation. |
|
155 A notification event with the transformation UID is sent to |
|
156 all clients. UIDs are in the form KUidECamEventImageProcessingXXXX. |
|
157 |
|
158 @param aTransformation |
|
159 The UID of the transformation |
|
160 |
|
161 @param aValue |
|
162 The integer value of the tranformation. |
|
163 */ |
|
164 virtual void SetTransformationValue(TUid aTransformation, TInt aValue)=0; |
|
165 |
|
166 /** Get the sequence of all active transforms, ordered in order of execution. |
|
167 |
|
168 @param aTransformSequence |
|
169 an empty array to be populated with sequence of transform UIDs, |
|
170 where transform entries with smaller index are executed earlier. |
|
171 |
|
172 @leave KErrNoMemory Out of memory. May also leave as a result of other system errors. |
|
173 */ |
|
174 virtual void GetActiveTransformSequenceL(RArray<TUid>& aTransformSequence) const=0; |
|
175 |
|
176 /** |
|
177 Set the order of all active transform in terms of execution. The transforms with |
|
178 smaller index are executed earlier. |
|
179 |
|
180 @param aTransformSequence |
|
181 The list of ordered transforms, where transforms with smaller |
|
182 index are executed earlier. |
|
183 |
|
184 @leave KErrNoMemory Out of memory. May also leave as a result of other system errors. |
|
185 */ |
|
186 virtual void SetActiveTransformSequenceL(RArray<TUid>& aTransformSequence)=0; |
|
187 |
|
188 /** |
|
189 Set the source rectangle for KUidECamEventImageProcessingTransformScale or |
|
190 KUidECamEventImageProcessingTransformCrop. |
|
191 The coordinates should fall within the current image rectangle. The result |
|
192 is always a logical AND operation between the two rectangles. |
|
193 |
|
194 @param aRect |
|
195 a reference to TRect object which describes the coordinates of the |
|
196 area of interest. |
|
197 */ |
|
198 virtual void SetSourceRect(const TRect& aRect)=0; |
|
199 |
|
200 /** |
|
201 Get the source rectangle for KUidECamEventImageProcessingTransformScale or |
|
202 KUidECamEventImageProcessingTransformCrop. |
|
203 The coordinates should fall within the current image rectangle. The result |
|
204 is always a logical AND operation between the two rectangles. |
|
205 |
|
206 @param aRect |
|
207 a reference to a TRect object to hold the current source rectangle |
|
208 coordinates. If it has not been set, the coordinates match these of |
|
209 the whole image. |
|
210 */ |
|
211 virtual void GetSourceRect(TRect& aRect) const=0; |
|
212 }; |
|
213 |
|
214 /** |
|
215 Mixin class for implementation of extended features like color swap and color accent processing |
|
216 by providers of the Image Processing Camera Extension API. |
|
217 |
|
218 @publishedPartner |
|
219 @released |
|
220 */ |
|
221 class MCameraImageProcessing2 |
|
222 { |
|
223 |
|
224 public: |
|
225 |
|
226 /** |
|
227 Releases the interface. |
|
228 */ |
|
229 virtual void Release()=0; |
|
230 |
|
231 /** |
|
232 Retrieves the maximum number of simultaneous color swapping possible. |
|
233 |
|
234 @param aConcurrentColorSwappingSupported |
|
235 Retrieves the number of simultaneous color swapping supported. |
|
236 Retrieves 0 when swapping feature is not supported. |
|
237 |
|
238 @leave May leave as a result of some error. |
|
239 */ |
|
240 virtual void GetConcurrentColorSwappingsSupportedL(TInt& aConcurrentColorSwappingSupported) const=0; |
|
241 |
|
242 /** |
|
243 Retrieves the color swapping capabilites per entry, if different entries have different capabilities |
|
244 otherwise the same capabilities retrieved for a particular entry can be assumed to be valid for every entry |
|
245 |
|
246 @param aIndex |
|
247 This is a value from 0 to numOfSimultaneousColorSwappings -1. Color swapping capabilities specific to |
|
248 a particular entry are retrieved. If uniform capability exists for every entry, then this method need not |
|
249 be called per entry. |
|
250 |
|
251 @param aColorSwapCapabilities |
|
252 This retrieves the color swap capabilities. |
|
253 |
|
254 @leave May leave as a result of some error. |
|
255 */ |
|
256 virtual void GetColorSwapCapabilitiesL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationCapabilities& aColorSwapCapabilities) const=0; |
|
257 |
|
258 /** |
|
259 Set the color swap entries |
|
260 |
|
261 @param aIndex |
|
262 This is a value from 0 to numOfSimultaneousColorSwappings -1. This helps in managing the limited no. of |
|
263 simultaneous color swaps. If parameters are already set for the given entry, then it's up to the implementation |
|
264 to replace the existing one or discard it. |
|
265 |
|
266 @param aColorSwapParameters |
|
267 The parameters necessary to define clearly the color swapping operation for the given entry. |
|
268 iEntryStatus has to be updated by the implementation as per the result of the setting operation. |
|
269 So, iEntryStatus value is redundant at this point. |
|
270 |
|
271 @note Triggers KUidECamEventCIPSetColorSwapEntry to all MCameraObserver2 clients of the camera. |
|
272 HandleEvent is used to report the result or any possible error. TECAMEvent2 class should |
|
273 be used in order to provide the entry no. of the color being set. |
|
274 Implementation Hint: On success, entry status (iEntryStatus) for that entry should |
|
275 be set to TValueInfo::EDiscreteSteps and saved on the implementation side. |
|
276 */ |
|
277 virtual void SetColorSwapEntry(TInt aIndex, const CCamera::CCameraImageProcessing::TColorOperationEntry& aColorSwapParameters)=0; |
|
278 |
|
279 /** |
|
280 Removes the color swap entry corresponding to the given index |
|
281 |
|
282 @param aIndex |
|
283 This gives the color swapping entry to be removed. |
|
284 |
|
285 @note Triggers KUidECamEventCIPRemoveColorSwapEntry to all MCameraObserver2 clients of the camera. |
|
286 HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be |
|
287 used in order to provide the entry no. of the color being removed. |
|
288 Implementation Hint: On success, entry status (iEntryStatus) for that entry should |
|
289 be set to TValueInfo::ENotActive and saved on the implementation side. |
|
290 */ |
|
291 virtual void RemoveColorSwapEntry(TInt aIndex)=0; |
|
292 |
|
293 /** |
|
294 Get the details of the color swap entry corresponding to the given index |
|
295 |
|
296 @param aIndex |
|
297 This gives the color swapping entry whose information has to be retrieved. |
|
298 |
|
299 @param aColorSwapParameters |
|
300 This contains the parameters currently being used by the color swapping operation for the given entry. |
|
301 |
|
302 @leave May leave as a result of some error. |
|
303 */ |
|
304 virtual void GetColorSwapEntryL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationEntry& aColorSwapParameters) const=0; |
|
305 |
|
306 /** |
|
307 Starts the color swapping process after taking into account the color swap entries updated up to this point. |
|
308 |
|
309 @note Triggers KUidECamEventCIPStartColorSwap to all MCameraObserver2 |
|
310 clients of the camera. HandleEvent is used to report the result or any possible error. |
|
311 One possible error case is when more than one entry describe the same color source. |
|
312 New ecam error KErrECamColorOperationConflict used in such a case. |
|
313 */ |
|
314 virtual void StartColorSwapping()=0; |
|
315 |
|
316 /** |
|
317 Cancel the color swapping process. |
|
318 |
|
319 @leave May leave as a result of some error. |
|
320 |
|
321 @note Used to cancel the color swapping process which might have been just started. |
|
322 If the issued StartColorSwappingL() gets cancelled, its event should report KErrCancel. |
|
323 */ |
|
324 virtual void CancelColorSwappingL()=0; |
|
325 |
|
326 /** |
|
327 Retrieves the maximum number of color entries on which simultaneous color accent process is possible. |
|
328 |
|
329 @param aConcurrentColorAccentSupported |
|
330 Retrieves the number of color entries on which simultaneous color accent process is possible. |
|
331 Retrieves 0 when color accent process is not supported. |
|
332 |
|
333 @leave May leave as a result of some error. |
|
334 */ |
|
335 virtual void GetConcurrentColorAccentSupportedL(TInt& aConcurrentColorAccentSupported) const=0; |
|
336 |
|
337 /** |
|
338 Retrieves the color accent capabilites per entry, if different entries have different capabilities |
|
339 otherwise the same capabilities retrieved for a particular entry can be assumed to be valid for every entry |
|
340 |
|
341 @param aIndex |
|
342 This is a value from 0 to numOfSimultaneousColorAccent -1. Color accent capabilities specific to |
|
343 a particular entry are retrieved. If uniform capability exists for every entry, then this method need not |
|
344 be called per entry. |
|
345 |
|
346 @param aColorAccentCapabilities |
|
347 This retrieves the color accent capabilities. |
|
348 |
|
349 @leave May leave as a result of some error. |
|
350 */ |
|
351 virtual void GetColorAccentCapabilitiesL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationCapabilities& aColorAccentCapabilities) const=0; |
|
352 |
|
353 /** |
|
354 Set the color accent entries |
|
355 |
|
356 @param aIndex |
|
357 This is a value from 0 to numOfSimultaneousColorAccent -1. This helps in managing the limited no. of |
|
358 simultaneous color accent. If parameters are already set for the given entry, then it's up to the implementation |
|
359 to replace the existing one or discard it. |
|
360 |
|
361 @param aColorAccentParameters |
|
362 The parameters necessary to define clearly the color accent operation for the given entry. |
|
363 iEntryStatus has to be updated by the implementation as per the result of the setting operation. |
|
364 So, iEntryStatus value is redundant at this point. The parameters defined for target colors in |
|
365 TColorOperationEntry are redundant for color accent. |
|
366 |
|
367 @note Triggers KUidECamEventCIPSetColorAccentEntry to all MCameraObserver2 clients of the camera. |
|
368 HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be |
|
369 used in order to provide the entry no. of the color being set. |
|
370 Implementation Hint: On success, entry status (iEntryStatus) for that entry should |
|
371 be set to TValueInfo::EDiscreteSteps and saved on the implementation side. |
|
372 */ |
|
373 virtual void SetColorAccentEntry(TInt aIndex, const CCamera::CCameraImageProcessing::TColorOperationEntry& aColorAccentParameters)=0; |
|
374 |
|
375 /** |
|
376 Removes the color accent entry corresponding to the given index |
|
377 |
|
378 @param aIndex |
|
379 This gives the color accent entry to be removed. |
|
380 |
|
381 @note Triggers KUidECamEventCIPRemoveColorAccentEntry to all MCameraObserver2 clients of the camera. |
|
382 HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be |
|
383 used in order to provide the entry no. of the color being removed. |
|
384 Implementation Hint: On success, entry status (iEntryStatus) for that entry should |
|
385 be set to TValueInfo::ENotActive and saved on the implementation side. |
|
386 */ |
|
387 virtual void RemoveColorAccentEntry(TInt aIndex)=0; |
|
388 |
|
389 /** |
|
390 Get the details of the color accent entry corresponding to the given index |
|
391 |
|
392 @param aIndex |
|
393 This gives the color accent entry whose information has to be retrieved. |
|
394 |
|
395 @param aColorAccentParameters |
|
396 This contains the parameters currently being used by the color accent operation for the given entry. |
|
397 The parameters defined for target colors in TColorOperationEntry are redundant for color accent. |
|
398 |
|
399 @leave May leave as a result of some error. |
|
400 */ |
|
401 virtual void GetColorAccentEntryL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationEntry& aColorAccentParameters) const=0; |
|
402 |
|
403 /** |
|
404 Starts the color accent process after taking into account the color accent entries updated up to this point. |
|
405 |
|
406 @note Triggers KUidECamEventCIPStartColorAccent to all MCameraObserver2 |
|
407 clients of the camera. HandleEvent is used to report the result or any possible error. |
|
408 */ |
|
409 virtual void StartColorAccent()=0; |
|
410 |
|
411 /** |
|
412 Cancel the color accent process. |
|
413 |
|
414 @leave May leave as a result of some error. |
|
415 |
|
416 @note Used to cancel the color accent process which might have been just started. |
|
417 If the issued StartColorAccentL() gets cancelled, its event should report KErrCancel. |
|
418 */ |
|
419 virtual void CancelColorAccentL()=0; |
|
420 }; |
|
421 |
|
422 /** |
|
423 Mixin class for implementation of extended features like custom orientation and event filtering |
|
424 by providers of the Image Processing Camera Extension API. |
|
425 |
|
426 @publishedPartner |
|
427 @prototype |
|
428 */ |
|
429 class MCameraImageProcessing3 |
|
430 { |
|
431 |
|
432 public: |
|
433 |
|
434 /** |
|
435 Releases the interface. |
|
436 */ |
|
437 virtual void Release()=0; |
|
438 |
|
439 /** |
|
440 Retrieves the supported options for a particular orientation reference. |
|
441 |
|
442 @param aOrientationReference |
|
443 A TOrientationReference for which supported relative custom orientation have to retrieved. |
|
444 |
|
445 @param aSupportedRelativeRotation |
|
446 A bitfield which retrieves the supported TRelativeRotation for 'aOrientationReference' |
|
447 |
|
448 @param aSupportedRelativeMirroring |
|
449 A bitfield which retrieves the supported TRelativeMirror for 'aOrientationReference' |
|
450 |
|
451 @param aSupportedRelativeFlipping |
|
452 A bitfield which retrieves the supported TRelativeFlipping for 'aOrientationReference' |
|
453 |
|
454 @leave May leave with any error code. |
|
455 */ |
|
456 virtual void GetSupportedRelativeOrientationOptionsL(CCamera::CCameraImageProcessing::TOrientationReference aOrientationReference, |
|
457 TUint& aSupportedRelativeRotation, TUint& aSupportedRelativeMirroring, TUint& aSupportedRelativeFlipping) const=0; |
|
458 |
|
459 /** |
|
460 Retrieves the options which is being used for the current orientation reference. |
|
461 |
|
462 @param aOrientationReference |
|
463 A TOrientationReference which is the current orientation reference being used. |
|
464 |
|
465 @param aRelativeRotation |
|
466 A TRelativeRotation which is the current relative rotation being used with aOrientationReference. |
|
467 |
|
468 @param aRelativeMirror |
|
469 A TRelativeMirror which is the current relative mirroring being used with aOrientationReference. |
|
470 |
|
471 @param aRelativeFlipping |
|
472 A TRelativeFlipping which is the current relative flipping being used with aOrientationReference. |
|
473 |
|
474 @leave May leave with any error code. |
|
475 */ |
|
476 virtual void GetCurrentRelativeOrientationOptionsL(CCamera::CCameraImageProcessing::TOrientationReference& aOrientationReference, |
|
477 CCamera::CCameraImageProcessing::TRelativeRotation& aRelativeRotation, |
|
478 CCamera::CCameraImageProcessing::TRelativeMirror& aRelativeMirror, |
|
479 CCamera::CCameraImageProcessing::TRelativeFlipping& aRelativeFlipping) const=0; |
|
480 |
|
481 /** |
|
482 Sets the options which would be used with the desired orientation reference. |
|
483 |
|
484 @param aOrientationReference |
|
485 The desired TOrientationReference. |
|
486 |
|
487 @param aRelativeRotation |
|
488 The desired TRelativeRotation which would be used with 'aOrientationReference'. |
|
489 |
|
490 @param TRelativeMirror |
|
491 The desired TRelativeMirror which would be used with 'aOrientationReference' |
|
492 |
|
493 @param TRelativeFlipping |
|
494 The desired TRelativeFlipping which would be used with 'aOrientationReference' |
|
495 |
|
496 @note Event KUidECamEventImageProcessingTransformRelativeOrientation is used to notify clients about relative |
|
497 custom orientation setting operation. |
|
498 |
|
499 @note If the current picture orientation (Refer CCamera::CCameraAdvancedSettings::TPictureOrientation) is not possible |
|
500 to be achieved with the relative custom orientation, event KUidECamEventPictureOrientationUnachievable will be |
|
501 notified to the client. |
|
502 |
|
503 @note If the dimension of the image gets changed by the desired relative orientation options, notification |
|
504 KUidECamEventCameraSettingImageSize will be notified to the client. |
|
505 */ |
|
506 virtual void SetRelativeOrientationOptions(CCamera::CCameraImageProcessing::TOrientationReference aOrientationReference, |
|
507 CCamera::CCameraImageProcessing::TRelativeRotation aRelativeRotation, |
|
508 CCamera::CCameraImageProcessing::TRelativeMirror aRelativeMirror, |
|
509 CCamera::CCameraImageProcessing::TRelativeFlipping aRelativeFlipping) const=0; |
|
510 }; |
|
511 |
|
512 #endif // ECAMIMAGEPROCESSINGINTF_H |