Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
23 #ifndef ECAMIMAGEPROCESSING_H
24 #define ECAMIMAGEPROCESSING_H
29 #include <ecamadvsettingsuids.hrh>
30 #include <ecam/ecamconstants.h>
32 class MCameraImageProcessing;
33 class MCameraImageProcessing2;
34 class MCameraImageProcessing3;
36 class MImplementationFactory;
39 The current Version of the TColorOperationCapabilities class.
42 static const TUint KECamColorOperationCapabilitiesCurrentVersion = 1;
45 The current Version of the TBitsIgnore class.
48 static const TUint KECamBitsIgnoreCurrentVersion = 1;
51 The current Version of the TColorOperationEntry class.
54 static const TUint KECamColorOperationEntryCurrentVersion = 1;
57 /* General purpose constants */
60 Uid used to identify the CCamera Post Processing API.
61 Such image operations are performed on the acquired image by the camera itself.
62 @see CCamera::CCameraPresets
64 static const TUid KECamImageProcessingUid = {KECamImageProcessingUidValue};
66 /** Transformations */
68 /** Brightness adjustment - recognized range [-100:100] */
69 static const TUid KUidECamEventImageProcessingAdjustBrightness = {KUidECamEventImageProcessingAdjustBrightnessUidValue};
70 /** Contrast adjustment - recognized range [-100:100] */
71 static const TUid KUidECamEventImageProcessingAdjustContrast = {KUidECamEventImageProcessingAdjustContrastUidValue};
72 /** Gamma adjustment - recognized range [0:1000] */
73 static const TUid KUidECamEventImageProcessingAdjustGamma = {KUidECamEventImageProcessingAdjustGammaUidValue};
74 /** Sharpness adjustment - recognized range [-100:100] */
75 static const TUid KUidECamEventImageProcessingAdjustSharpness = {KUidECamEventImageProcessingAdjustSharpnessUidValue};
76 /** Saturation adjustment - recognized range [-100:100] */
77 static const TUid KUidECamEventtImageProcessingAdjustSaturation = {KUidECamEventtImageProcessingAdjustSaturationUidValue};
78 static const TUid KUidECamEventImageProcessingAdjustSaturation = {KUidECamEventtImageProcessingAdjustSaturationUidValue};
79 /** Hue adjustment - recognized range [-100:100] */
80 static const TUid KUidECamEventtImageProcessingAdjustHue = {KUidECamEventtImageProcessingAdjustHueUidValue};
81 static const TUid KUidECamEventImageProcessingAdjustHue = {KUidECamEventtImageProcessingAdjustHueUidValue};
82 /** Contrast Enhancement
84 This uid value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or
85 CCamera::NewDuplicate2L().
89 static const TUid KUidECamEventCIPAdjustContrastEnhancement = {KUidECamEventCIPAdjustContrastEnhancementUidValue};
90 /** Software based Red Eye Reduction
92 This uid value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or
93 CCamera::NewDuplicate2L()
97 static const TUid KUidECamEventCIPAdjustRedEyeReduction = {KUidECamEventCIPAdjustRedEyeReductionUidValue};
100 Image distortion correction.
102 This uid value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or
103 CCamera::NewDuplicate2L()
107 static const TUid KUidECamEventCIPImageDistortionCorrection = {KUidECamEventCIPImageDistortionCorrectionUidValue};
111 static const TUid KUidECamEventImageProcessingEffect = {KUidECamEventImageProcessingEffectUidValue};
115 static const TUid KUidECamEventImageProcessingTransformCrop = {KUidECamEventImageProcessingTransformCropUidValue};
117 static const TUid KUidECamEventImageProcessingTransformRotate = {KUidECamEventImageProcessingTransformRotateUidValue};
119 static const TUid KUidECamEventImageProcessingTransformMirror = {KUidECamEventImageProcessingTransformMirrorUidValue};
121 static const TUid KUidECamEventImageProcessingTransformScale = {KUidECamEventImageProcessingTransformScaleUidValue};
123 static const TUid KUidECamEventImageProcessingSourceRect = {KUidECamEventImageProcessingSourceRectUidValue};
124 /** Noise reduction */
125 static const TUid KUidECamEventImageProcessingNoiseReduction = {KUidECamEventImageProcessingNoiseReductionUidValue};
127 static const TUid KUidECamEventImageProcessingGlareRemoval = {KUidECamEventImageProcessingGlareRemovalUidValue};
128 /** Relative Orientation
130 This uid value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or
131 CCamera::NewDuplicate2L().
136 static const TUid KUidECamEventImageProcessingTransformRelativeOrientation = {KUidECamEventImageProcessingTransformRelativeOrientationUidValue};
138 /** Default value for image processing */
139 static const TInt KECamImageProcessingDefaultValue = 0;
142 Uid used to indicate completion of StartColorSwap
145 static const TUid KUidECamEventCIPStartColorSwap = {KUidECamEventCIPStartColorSwapUidValue};
148 Uid used to indicate completion of StartColorAccent
151 static const TUid KUidECamEventCIPStartColorAccent = {KUidECamEventCIPStartColorAccentUidValue};
154 Uid used to notify that the current picture orientation is unachievable after setting the relative custom orientation.
156 @see CCamera::CCameraImageProcessing::SetRelativeCustomOrientationL(TOrientationReference aOrientationReference,
157 TRelativeCustomOrientation aRelativeCustomOrientation);
162 static const TUid KUidECamEventPictureOrientationUnachievable = {KUidECamEventPictureOrientationUnachievableUidValue};
165 This class is used to perform image processing operations on the camera.
166 These include brightness, contrast, gamma, hue, sharpness and saturation adjustments. The client is also
167 able to perform simple image transformations like cropping, rotation, mirroring, scaling, noise reduction and glare reduction. .
168 When an operation selection is complete, all clients are notified with the respective event UID.
170 As often cameras may support only a subset of discrete values of the allowed range,
171 the API allows the client to retrieve those and use them explicitly.
173 @note This class is not intended for sub-classing and used to standardise existing
174 varieties of implementations.
176 @note it is assumed that setting a new value for a transformations(transform, adjust, effect) effectively
177 activates the transformations. Whilst for effects and adjustments there is always a value, transforms
178 may have a dependency on other parameters and
179 crop - requires setting of source rectangle.
180 scale - will use setting of source rectangle, and the magnification factor is
181 determined by the source rectangle and the output size. This is always magnification.
182 if a value is set, it is assumed to be a scaling factor multiplied by KECamFineResolutionFactor
184 mirror - values of TMirror type.
185 rotation - the angle in degrees.
186 noise reduction - TNoiseReduction.
187 glare removal - TGlareReduction.
192 // Lets assume that an application would need to check whether gamma correction is
193 // supported on a particular platform. After obtaining a valid pointer to the interface,
194 // it would call GetSupportedTransformationsL() to obtain the list of the supported
195 // transformations and check whether KUidECamEventImageProcessingAdjustGamma
196 // is in the list. If it is then call SetTranformationValue(KUidECamEventImageProcessingAdjustGamma, 200);
197 // to set the new value. A notification will be generated to the client to indicate success.
199 RArray<TUid> suppTransforms; // array of supported transformations
200 CleanupClosePushL(suppTransforms);
202 imageProcess->GetSupportedTransformationsL(suppTransfUids);
204 // if the gamma is supported
205 TInt gammaCorrection = 200; // gamma correction of 2.0
206 imageProcess->SetTranformationValue(KUidECamEventImageProcessingAdjustGamma, gammaCorrection);
208 // pop stack to close the RArray
211 @note If the class methods leave, the output type parameter value is not guaranteed to be valid.
216 class CCamera::CCameraImageProcessing : public CBase
219 // so can use internal factory functions etc.
220 friend class CCamera;
224 /** Gamma settings */
227 /** Sets the gamma adjustment automatically. */
228 EGammaAuto = KMinTInt
230 /** Sharpness Settings */
233 /** Sets the sharpness adjustment automatically. */
234 ESharpnessAuto = KMinTInt
236 /** Saturation Settings */
239 /** Sets the saturation adjustment automatically. */
240 ESaturationAuto = KMinTInt
245 /** Sets the hue adjustment automatically. */
249 /** Settings for the supported effects */
252 /** Effects off is default, always supported */
253 EEffectNone = 0x00000000,
254 /** Negative visual effect. */
255 EEffectNegative = 0x00000001,
256 /** Black and white visual effect. */
257 EEffectMonochrome = 0x00000002,
258 /** Solarization visual effect. */
259 EEffectSolarize = 0x00000004,
260 /** Sepia visual effect. */
261 EEffectSepia = 0x00000008,
262 /** Emboss visual effect. */
263 EEffectEmboss = 0x00000010,
264 /** Red eye glare reduction visual effect. */
265 EEffectRedEyeReduction = 0x00000020,
266 /** Vivid colour visual effect. */
267 EEffectVivid = 0x00000040,
268 /** Neutral colour visual effect. */
269 EEffectNeutral = 0x00000080,
270 /** Selective sharpening visual effect. */
271 EEffectLowSharpening = 0x00000100,
273 Natural visual effect.
275 This enum value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or
276 CCamera::NewDuplicate2L().
279 EEffectNatural = 0x00000200,
283 This enum value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or
284 CCamera::NewDuplicate2L().
287 EEffectCine = 0x00000400,
289 Old film visual effect.
291 This enum value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or
292 CCamera::NewDuplicate2L().
295 EEffectOldFilm = 0x00000800,
297 Color swap visual effect.
299 This enum value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or
300 CCamera::NewDuplicate2L().
303 EEffectColorSwap = 0x00001000,
305 Where a list of color can be kept as they are and the rest converted to gray.
307 This enum value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or
308 CCamera::NewDuplicate2L().
311 EEffectColorAccent = 0x00002000
314 /** Mirror settings */
317 /** Default value. Mirroring is disabled. */
318 EMirrorNone = 0x00000000,
319 /** Mirror along horizontal axis. */
320 EMirrorHorizontal = 0x00000001,
321 /** Mirror along vertical axis. */
322 EMirrorVertical = 0x00000002,
323 /** Mirror along horizontal and vertical axis. */
324 EMirrorBoth = 0x00000003
327 /** Noise filter settings */
330 /** Default value. Noise reduction disabled. */
331 ENoiseReductionNone = 0x0000,
332 /** most basic noise reduction. */
333 ENoiseReductionBasic = 0x0001
336 /** Glare reduction settings */
339 /** Default value. Glare reduction disabled. */
340 EGlareReductionNone = 0x0000,
341 /** most basic glare reduction. */
342 EGlareReductionBasic = 0x0001
346 Used for color swap and color accent feature in TEffect. It describes whether the given source
347 or target color represents itself or a group of color.
350 enum TColorOperationRepresentation
352 /** Feature is not supported */
353 ERepresentationNone = 0x00,
354 /** The given color is uniquely represented */
355 ERepresentationSingle = 0x01,
356 /** The given color represents a group of colors */
357 ERepresentationMultiple = 0x02
361 Used for color swap and color accent feature in TEffect. It describes the type of grouping for
362 source and target colors when they represent a group of color.
365 enum TColorOperationRgbGroupingMode
367 /** Feature is not supported */
368 ERgbGroupingNone = 0x00,
369 /** This means no neighbourhood colors are considered */
370 ERgbGroupingFixed = 0x01,
371 /** This means neighbourhood colors are to be automatically decided by the implementation or hardware */
372 ERgbGroupingAutomatic = 0x02,
373 /** This means neighbourhood colors for source have to be decided by ignoring few starting bits. Used for source only */
374 ERgbGroupingSignificantBits = 0x04,
375 /** This means colors in target are obtained as some uniform proportion using source. Used for target only */
376 ERgbGroupingUniform = 0x08
380 Used to provide different types of references for orientation of images retrieved. These references are the various
381 means by the orientation of an image can be defined. Client needs to choose a particular TOrientationReference and
382 specify any relative rotation, mirroring and flipping on top of it.
384 This enumeration has nothing to do with absolute rotation. Uid KUidECamEventImageProcessingTransformRotate is used
385 for absolute rotation purposes.
387 The enumeration list may be extended in future.
392 enum TOrientationReference
394 /** The retrieved images will follow the camera sensor orientation. This orientation would be relative
395 to the current screen mode as given by the reference screen. */
396 EOrientationReferenceCameraSensorOrientation,
398 /** The retrieved images will get oriented as per the tilt sensor information.
399 So,the orientation would be relative to the current screen mode as given by the reference screen. */
400 EOrientationReferenceTiltOrientation
404 Used to describe the various relative rotation. The term 'relative' means that the rotation is applied after the
405 image undergoes orientation as given by TOrientationReference.
407 The enumeration list may be extended in future.
412 enum TRelativeRotation
414 /** Zero degree Rotation applied on top of orientation reference and is relative to current reference screen. */
415 ERelativeRotation0Degrees = 0x00,
416 /** 90 degree clockwise Rotation applied on top of orientation reference and is relative to current reference screen. */
417 ERelativeRotation90DegreesClockwise = 0x01,
418 /** 180 degree clockwise Rotation applied on top of orientation reference and is relative to current reference screen. */
419 ERelativeRotation180DegreesClockwise = 0x02,
420 /** 270 degree clockwise Rotation applied on top of orientation reference and is relative to current reference screen. */
421 ERelativeRotation270DegreesClockwise = 0x04
425 Used to describe the various relative mirroring. The term 'relative' means that the mirroring is applied after the
426 image undergoes orientation as given by TOrientationReference.
428 The enumeration list may be extended in future.
436 ERelativeMirrorNone = 0x00,
437 /** Used to mirror an image about the horizontal axis. This is applied on top of orientation reference and is
438 relative to current reference screen. */
439 ERelativeMirrorHorizontalAxis = 0x10,
440 /** Used to mirror an image about the vertical axis. This is applied on top of orientation reference and is
441 relative to current reference screen. */
442 ERelativeMirrorVerticalAxis = 0x20
446 Used to describe the various relative flipping. The term 'relative' means that the flipping is applied after the
447 image undergoes orientation as given by TOrientationReference.
449 The enumeration list may be extended in future.
454 enum TRelativeFlipping
457 ERelativeFlippingNone = 0x00,
458 /** Used to flip an image horizontally. This is applied on top of orientation reference and is relative to current
460 ERelativeFlippingHorizontal = 0x10,
461 /** Used to flip an image vertically. This is applied on top of orientation reference and is relative to current
463 ERelativeFlippingVertical = 0x20
467 Different types of contrast enhancement options.
468 The enumeration list may be extended in future.
473 enum TContrastEnhancement
475 /** Not Supported. */
476 EContrastEnhancementNone =0x00,
477 /** Contrast Enhancement switched off. */
478 EContrastEnhancementSwitchOff =0x01,
479 /** Contrast Enhacement switched On manually. */
480 EContrastEnhancementManualSwitchOn =0x02,
481 /** Contrast Enhancement in auto mode. */
482 EContrastEnhancementSwitchAuto =0x04
486 Different types of software-based red eye reduction options.
487 The enumeration list may be extended in future.
492 enum TRedEyeReduction
494 /** Not Supported. */
495 ERedEyeReductionNone =0x00,
496 /** Software based Red Eye Reduction can be switched off(disabled). */
497 ERedEyeReductionSwitchOff =0x01,
498 /** Software based Red Eye Reduction can be switched on (enabled). */
499 ERedEyeReductionManualSwitchOn =0x02,
500 /** Software based Red Eye Reduction can be put to auto mode. */
501 ERedEyeReductionSwitchAuto =0x04
505 Color operation capabilities characterizing both color swap and color accent feature
508 class TColorOperationCapabilities
513 Sets the size of this class in iSize.
515 IMPORT_C TColorOperationCapabilities();
517 IMPORT_C TInt Size() const;
518 IMPORT_C TUint Version() const;
521 //for future expansion
525 // reserved for future expansion
529 /** The source color representation that the server supports.
530 The supported representations are held as a bitwise logical OR of the relevant individual modes
531 defined in CCamera::CCameraImageProcessing:: TColorOperationRepresentation. */
532 TUint iSupportedSourceRepresentation;
534 /** The target color representation that the server supports.
535 The supported representations are held as a bitwise logical OR of the relevant individual modes
536 defined in CCamera::CCameraImageProcessing:: TColorOperationRepresentation.
537 Not applicable for color accent */
538 TUint iSupportedTargetRepresentation;
540 /** The source color Rgb grouping modes that the server supports.
541 The modes are held as a bitwise logical OR of the relevant individual modes
542 defined in CCamera::CCameraImageProcessing:: TColorOperationRgbGroupingMode. */
543 TUint iSupportedSourceRgbGroupingMode;
545 /** The target color Rgb grouping modes that the server supports.
546 The modes are held as a bitwise logical OR of the relevant individual modes
547 defined in CCamera::CCameraImageProcessing:: TColorOperationRgbGroupingMode.
548 Not applicable for color accent */
549 TUint iSupportedTargetRgbGroupingMode;
551 /** This indicates whether the mapping mode and Rgb grouping mode uniform for every color entry */
552 TBool iIsCapabilityUniform;
556 Class used to control the number of bits to ignore for Red, Green, Blue or Alpha.
557 This may be used when deciding for neighbourhood for source color in case of color swap and color accent feature
565 Sets the size of this class in iSize.
567 IMPORT_C TBitsIgnore();
569 IMPORT_C TInt Size() const;
570 IMPORT_C TUint Version() const;
573 //for future expansion
578 TUint iReservedBits:16;
581 /** This gives the no. of bits to ignore for Red color. Varies from 0 to 8.
582 Any other value should be an error */
583 TUint iRedBitsIgnore:4;
585 /** This gives the no. of bits to ignore for Green color. Varies from 0 to 8.
586 Any other value should be an error */
587 TUint iGreenBitsIgnore:4;
589 /** This gives the no. of bits to ignore for Blue color. Varies from 0 to 8.
590 Any other value should be an error */
591 TUint iBlueBitsIgnore:4;
593 /** This gives the no. of bits to ignore for Alpha. Varies from 0 to 8.
594 Any other value should be an error */
595 TUint iAlphaBitsIgnore:4;
599 Color operation parameters characterizing both color swap and color accent feature; and for a particular entry.
602 class TColorOperationEntry
607 Sets the size of this class in iSize.
609 IMPORT_C TColorOperationEntry();
611 IMPORT_C TInt Size() const;
612 IMPORT_C TUint Version() const;
615 //for future expansion
619 // reserved for future expansion
623 /** The source color (rgb triplet) which is changed to target color in case of Color Swap operation
624 and remains unaffected in case of Color Accent operation */
627 /** The target color (rgb triplet) which replaces the source color in case of Color Swap operation.
628 Redundant for Color Accent operation */
631 /** This defines whether the given source color represents itself or a group of colors */
632 TColorOperationRepresentation iSourceColorRepresentation;
634 /** This defines whether the given target color represents itself or a group of colors in case of
635 Color Swap operation. Redundant for Color Accent operation */
636 TColorOperationRepresentation iTargetColorRepresentation;
638 /** This defines the type of grouping for multiple representation of source color */
639 TColorOperationRgbGroupingMode iColorOperationSourceRgbGroupingMode;
641 /** This defines the type of grouping for multiple representation of target color in case of
642 Color Swap operation. Redundant for Color Accent operation */
643 TColorOperationRgbGroupingMode iColorOperationTargetRgbGroupingMode;
645 /** This gives the number of bits to ignore in case ERgbGroupingSignificantBits is used for
646 multiple representation of source color. For any other case, no. of bits ignored for red, green,
647 blue or alpha should be 0 */
648 TBitsIgnore iNumBitsIgnored;
650 /** This gives the entry status of every color operation entry. If entry is not set or removed,
651 this is ENotActive. And if entry is set, then this is EDiscreteSteps */
652 TValueInfo iEntryStatus;
657 IMPORT_C static CCameraImageProcessing* NewL(CCamera& aCamera);
659 IMPORT_C static CCameraImageProcessing* CreateL(CCamera& aCamera, MImplementationFactory& aImplFactory);
661 IMPORT_C void GetSupportedTransformationsL(RArray<TUid>& aTransformations) const;
663 IMPORT_C void GetActiveTransformationsL(RArray<TUid>& aTransformations) const;
665 IMPORT_C void GetTransformationSupportedValuesL(TUid aTransformation, RArray<TInt>& aValues, TValueInfo& aInfo) const;
667 IMPORT_C TInt TransformationValue(TUid aTransformation) const;
669 IMPORT_C TInt GetTransformationValue(TUid aTransformation, TInt& aTransformationValue) const;
671 IMPORT_C void SetTransformationValue(TUid aTransformation, TInt aValue);
673 IMPORT_C void GetActiveTransformSequenceL(RArray<TUid>& aTransformSequence) const;
675 IMPORT_C void SetActiveTransformSequenceL(RArray<TUid>& aTransformSequence);
677 IMPORT_C void SetSourceRect(const TRect& aRect);
679 IMPORT_C void GetSourceRect(TRect& aRect) const;
681 IMPORT_C ~CCameraImageProcessing();
683 IMPORT_C void GetConcurrentColorSwappingsSupportedL(TInt& aConcurrentColorSwappingSupported) const;
685 IMPORT_C void GetColorSwapCapabilitiesL(TInt aIndex, TColorOperationCapabilities& aColorSwapCapabilities) const;
687 IMPORT_C void SetColorSwapEntryL(TInt aIndex, const TColorOperationEntry& aColorSwapParameters);
689 IMPORT_C void RemoveColorSwapEntryL(TInt aIndex);
691 IMPORT_C void GetColorSwapEntryL(TInt aIndex, TColorOperationEntry& aColorSwapParameters) const;
693 IMPORT_C void StartColorSwappingL();
695 IMPORT_C void CancelColorSwappingL();
697 IMPORT_C void GetConcurrentColorAccentSupportedL(TInt& aConcurrentColorAccentSupported) const;
699 IMPORT_C void GetColorAccentCapabilitiesL(TInt aIndex, TColorOperationCapabilities& aColorAccentCapabilities) const;
701 IMPORT_C void SetColorAccentEntryL(TInt aIndex, const TColorOperationEntry& aColorAccentParameters);
703 IMPORT_C void RemoveColorAccentEntryL(TInt aIndex);
705 IMPORT_C void GetColorAccentEntryL(TInt aIndex, TColorOperationEntry& aColorAccentParameters) const;
707 IMPORT_C void StartColorAccentL();
709 IMPORT_C void CancelColorAccentL();
711 IMPORT_C void GetSupportedRelativeOrientationOptionsL(TOrientationReference aOrientationReference,
712 TUint& aSupportedRelativeRotation, TUint& aSupportedRelativeMirroring, TUint& aSupportedRelativeFlipping) const;
714 IMPORT_C void GetCurrentRelativeOrientationOptionsL(TOrientationReference& aOrientationReference,
715 TRelativeRotation& aRelativeRotation, TRelativeMirror& aRelativeMirror, TRelativeFlipping& aRelativeFlipping) const;
717 IMPORT_C void SetRelativeOrientationOptionsL(TOrientationReference aOrientationReference,
718 TRelativeRotation aRelativeRotation, TRelativeMirror aRelativeMirror, TRelativeFlipping aRelativeFlipping);
721 CCameraImageProcessing(CCamera& aOwner);
723 void ConstructL(const MImplementationFactory& aImplFactory);
727 MCameraImageProcessing* iImpl; // not owned
728 MCameraImageProcessing2* iImpl2; //not owned
729 MCameraImageProcessing3* iImpl3; //not owned
731 #endif//ECAMIMAGEPROCESSING_H