sl@0: // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef ECAMIMAGEPROCESSINGINTF_H sl@0: #define ECAMIMAGEPROCESSINGINTF_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /** This is the UID which is used to obtain the interface MCameraImageProcessing, via the sl@0: CCamera::CustomInterface() call, which provides implementation of the M-class interface. */ sl@0: static const TUid KECamMCameraImageProcessingUid = {KECamMCameraImageProcessingUidValue}; sl@0: sl@0: /** sl@0: This is the UID which is used to obtain the interface MCameraImageProcessing2, via the sl@0: CCamera::CustomInterface() call, which provides implementation of the M-class interface. sl@0: */ sl@0: static const TUid KECamMCameraImageProcessing2Uid = {KECamMCameraImageProcessing2UidValue}; sl@0: sl@0: /** sl@0: This is the UID which is used to obtain the interface MCameraImageProcessing3, via the sl@0: CCamera::CustomInterface() call, which provides implementation of the M-class interface. sl@0: @publishedPartner sl@0: @prototype sl@0: */ sl@0: static const TUid KECamMCameraImageProcessing3Uid = {KECamMCameraImageProcessing3UidValue}; sl@0: sl@0: sl@0: /** sl@0: Mixin class for implementation by providers of the Image Processing Camera Extension API. sl@0: sl@0: This class is used to perform image processing operations on the camera. sl@0: These include brightness, contrast, gamma, hue, sharpness and saturation adjustments. The client is also sl@0: able to perform simple image transformations like cropping, rotation, mirroring, scaling, noise reduction and glare reduction. . sl@0: When an operation selection is complete, all clients are notified with the respective event UID. sl@0: sl@0: As often cameras may support only a subset of discrete values of the allowed range, sl@0: the API allows the client to retrieve those and use them explicitly. sl@0: sl@0: @note it is assumed that setting a new value for a transformations(transform, adjust, effect) effectively sl@0: activates the transformations. Whilst for effects and adjustments there is always a value, transforms sl@0: may have a dependency on other parameters and sl@0: crop - requires setting of source rectangle. sl@0: scale - will use setting of source rectangle, and the magnification factor is sl@0: determined by the source rectangle and the output size. This is always magnification. sl@0: if a value is set, it is assumed to be a scaling factor multiplied by KECamFineResolutionFactor sl@0: and set to integer. sl@0: mirror - values of TMirror type. sl@0: rotation - the angle in degrees. sl@0: noise reduction - TNoiseReduction. sl@0: glare removal - TGlareReduction. sl@0: sl@0: Example sl@0: Let's assume that an application would need to check whether gamma correction is sl@0: supported on a particular platform. After obtaining a valid pointer to the interface, sl@0: it would call GetSupportedTransformationsL() to obtain the list of the supported sl@0: tranformations and check whether KUidECamEventImageProcessingAdjustGamma sl@0: is in the list. If it is then call SetTranformationValue(KUidECamEventImageProcessingAdjustGamma, 200); sl@0: to set the new value. A notification will be generated to the client to indicate success. sl@0: sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: class MCameraImageProcessing sl@0: { sl@0: sl@0: public: sl@0: sl@0: /** sl@0: Releases the interface. sl@0: */ sl@0: virtual void Release()=0; sl@0: sl@0: /** Get all transformations supported on the camera. sl@0: sl@0: @param aTransformations sl@0: An empty RArray of TUids to store the UIDs of the supported transformations. sl@0: sl@0: @leave KErrNoMemory Out of memory. May also leave as a result of other system errors. sl@0: */ sl@0: virtual void GetSupportedTransformationsL(RArray& aTransformations) const=0; sl@0: sl@0: /** Get currently active transformations on the camera. sl@0: sl@0: @param aTransformations sl@0: An empty RArray of TUids to store the UIDs of the supported transformations. sl@0: sl@0: @leave KErrNoMemory Out of memory. May also leave as a result of other system errors. sl@0: */ sl@0: virtual void GetActiveTransformationsL(RArray& aTransformations) const=0; sl@0: sl@0: /** Get all values supported by an active transformation. sl@0: sl@0: @param aTransformation sl@0: The UID of active transform for which values are requested. sl@0: sl@0: @param aValues sl@0: An array of integers to represent the values for the requested transformation. sl@0: sl@0: @param aInfo sl@0: Additional information describing the returned array of values. sl@0: sl@0: @note depending on the value of aInfo parameter, same array of values may describe sl@0: different set of values. sl@0: When camera device doesn't support this, empty array should be returned and TValueInfo should be ENotActive, sl@0: and the corresponding getter/setters for this feature should not be used. sl@0: sl@0: @leave KErrNoMemory Out of memory. May also leave as a result of other system errors. sl@0: */ sl@0: virtual void GetTransformationSupportedValuesL(TUid aTransformation, RArray& aValues, TValueInfo& aInfo) const=0; sl@0: sl@0: /** sl@0: @deprecated Use TInt GetTransformationValue(TUid aTransformation, TInt& aTransformationValue); sl@0: sl@0: Get the current value of a transformation sl@0: sl@0: @param aTransformation sl@0: The UID of the transformation sl@0: sl@0: @return The integer value of the tranformation. sl@0: */ sl@0: virtual TInt TransformationValue(TUid aTransformation) const=0; sl@0: sl@0: /** Get the current value of a transformation sl@0: sl@0: @param aTransformation sl@0: The UID of the transformation sl@0: sl@0: @param aTransformationValue sl@0: Reference to the integer value of the tranformation. sl@0: sl@0: @return system wide error code. sl@0: */ sl@0: virtual TInt GetTransformationValue(TUid aTransformation, TInt& aTransformationValue) const=0; sl@0: sl@0: /** Set new value for a transformation. sl@0: A notification event with the transformation UID is sent to sl@0: all clients. UIDs are in the form KUidECamEventImageProcessingXXXX. sl@0: sl@0: @param aTransformation sl@0: The UID of the transformation sl@0: sl@0: @param aValue sl@0: The integer value of the tranformation. sl@0: */ sl@0: virtual void SetTransformationValue(TUid aTransformation, TInt aValue)=0; sl@0: sl@0: /** Get the sequence of all active transforms, ordered in order of execution. sl@0: sl@0: @param aTransformSequence sl@0: an empty array to be populated with sequence of transform UIDs, sl@0: where transform entries with smaller index are executed earlier. sl@0: sl@0: @leave KErrNoMemory Out of memory. May also leave as a result of other system errors. sl@0: */ sl@0: virtual void GetActiveTransformSequenceL(RArray& aTransformSequence) const=0; sl@0: sl@0: /** sl@0: Set the order of all active transform in terms of execution. The transforms with sl@0: smaller index are executed earlier. sl@0: sl@0: @param aTransformSequence sl@0: The list of ordered transforms, where transforms with smaller sl@0: index are executed earlier. sl@0: sl@0: @leave KErrNoMemory Out of memory. May also leave as a result of other system errors. sl@0: */ sl@0: virtual void SetActiveTransformSequenceL(RArray& aTransformSequence)=0; sl@0: sl@0: /** sl@0: Set the source rectangle for KUidECamEventImageProcessingTransformScale or sl@0: KUidECamEventImageProcessingTransformCrop. sl@0: The coordinates should fall within the current image rectangle. The result sl@0: is always a logical AND operation between the two rectangles. sl@0: sl@0: @param aRect sl@0: a reference to TRect object which describes the coordinates of the sl@0: area of interest. sl@0: */ sl@0: virtual void SetSourceRect(const TRect& aRect)=0; sl@0: sl@0: /** sl@0: Get the source rectangle for KUidECamEventImageProcessingTransformScale or sl@0: KUidECamEventImageProcessingTransformCrop. sl@0: The coordinates should fall within the current image rectangle. The result sl@0: is always a logical AND operation between the two rectangles. sl@0: sl@0: @param aRect sl@0: a reference to a TRect object to hold the current source rectangle sl@0: coordinates. If it has not been set, the coordinates match these of sl@0: the whole image. sl@0: */ sl@0: virtual void GetSourceRect(TRect& aRect) const=0; sl@0: }; sl@0: sl@0: /** sl@0: Mixin class for implementation of extended features like color swap and color accent processing sl@0: by providers of the Image Processing Camera Extension API. sl@0: sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: class MCameraImageProcessing2 sl@0: { sl@0: sl@0: public: sl@0: sl@0: /** sl@0: Releases the interface. sl@0: */ sl@0: virtual void Release()=0; sl@0: sl@0: /** sl@0: Retrieves the maximum number of simultaneous color swapping possible. sl@0: sl@0: @param aConcurrentColorSwappingSupported sl@0: Retrieves the number of simultaneous color swapping supported. sl@0: Retrieves 0 when swapping feature is not supported. sl@0: sl@0: @leave May leave as a result of some error. sl@0: */ sl@0: virtual void GetConcurrentColorSwappingsSupportedL(TInt& aConcurrentColorSwappingSupported) const=0; sl@0: sl@0: /** sl@0: Retrieves the color swapping capabilites per entry, if different entries have different capabilities sl@0: otherwise the same capabilities retrieved for a particular entry can be assumed to be valid for every entry sl@0: sl@0: @param aIndex sl@0: This is a value from 0 to numOfSimultaneousColorSwappings -1. Color swapping capabilities specific to sl@0: a particular entry are retrieved. If uniform capability exists for every entry, then this method need not sl@0: be called per entry. sl@0: sl@0: @param aColorSwapCapabilities sl@0: This retrieves the color swap capabilities. sl@0: sl@0: @leave May leave as a result of some error. sl@0: */ sl@0: virtual void GetColorSwapCapabilitiesL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationCapabilities& aColorSwapCapabilities) const=0; sl@0: sl@0: /** sl@0: Set the color swap entries sl@0: sl@0: @param aIndex sl@0: This is a value from 0 to numOfSimultaneousColorSwappings -1. This helps in managing the limited no. of sl@0: simultaneous color swaps. If parameters are already set for the given entry, then it's up to the implementation sl@0: to replace the existing one or discard it. sl@0: sl@0: @param aColorSwapParameters sl@0: The parameters necessary to define clearly the color swapping operation for the given entry. sl@0: iEntryStatus has to be updated by the implementation as per the result of the setting operation. sl@0: So, iEntryStatus value is redundant at this point. sl@0: sl@0: @note Triggers KUidECamEventCIPSetColorSwapEntry to all MCameraObserver2 clients of the camera. sl@0: HandleEvent is used to report the result or any possible error. TECAMEvent2 class should sl@0: be used in order to provide the entry no. of the color being set. sl@0: Implementation Hint: On success, entry status (iEntryStatus) for that entry should sl@0: be set to TValueInfo::EDiscreteSteps and saved on the implementation side. sl@0: */ sl@0: virtual void SetColorSwapEntry(TInt aIndex, const CCamera::CCameraImageProcessing::TColorOperationEntry& aColorSwapParameters)=0; sl@0: sl@0: /** sl@0: Removes the color swap entry corresponding to the given index sl@0: sl@0: @param aIndex sl@0: This gives the color swapping entry to be removed. sl@0: sl@0: @note Triggers KUidECamEventCIPRemoveColorSwapEntry to all MCameraObserver2 clients of the camera. sl@0: HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be sl@0: used in order to provide the entry no. of the color being removed. sl@0: Implementation Hint: On success, entry status (iEntryStatus) for that entry should sl@0: be set to TValueInfo::ENotActive and saved on the implementation side. sl@0: */ sl@0: virtual void RemoveColorSwapEntry(TInt aIndex)=0; sl@0: sl@0: /** sl@0: Get the details of the color swap entry corresponding to the given index sl@0: sl@0: @param aIndex sl@0: This gives the color swapping entry whose information has to be retrieved. sl@0: sl@0: @param aColorSwapParameters sl@0: This contains the parameters currently being used by the color swapping operation for the given entry. sl@0: sl@0: @leave May leave as a result of some error. sl@0: */ sl@0: virtual void GetColorSwapEntryL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationEntry& aColorSwapParameters) const=0; sl@0: sl@0: /** sl@0: Starts the color swapping process after taking into account the color swap entries updated up to this point. sl@0: sl@0: @note Triggers KUidECamEventCIPStartColorSwap to all MCameraObserver2 sl@0: clients of the camera. HandleEvent is used to report the result or any possible error. sl@0: One possible error case is when more than one entry describe the same color source. sl@0: New ecam error KErrECamColorOperationConflict used in such a case. sl@0: */ sl@0: virtual void StartColorSwapping()=0; sl@0: sl@0: /** sl@0: Cancel the color swapping process. sl@0: sl@0: @leave May leave as a result of some error. sl@0: sl@0: @note Used to cancel the color swapping process which might have been just started. sl@0: If the issued StartColorSwappingL() gets cancelled, its event should report KErrCancel. sl@0: */ sl@0: virtual void CancelColorSwappingL()=0; sl@0: sl@0: /** sl@0: Retrieves the maximum number of color entries on which simultaneous color accent process is possible. sl@0: sl@0: @param aConcurrentColorAccentSupported sl@0: Retrieves the number of color entries on which simultaneous color accent process is possible. sl@0: Retrieves 0 when color accent process is not supported. sl@0: sl@0: @leave May leave as a result of some error. sl@0: */ sl@0: virtual void GetConcurrentColorAccentSupportedL(TInt& aConcurrentColorAccentSupported) const=0; sl@0: sl@0: /** sl@0: Retrieves the color accent capabilites per entry, if different entries have different capabilities sl@0: otherwise the same capabilities retrieved for a particular entry can be assumed to be valid for every entry sl@0: sl@0: @param aIndex sl@0: This is a value from 0 to numOfSimultaneousColorAccent -1. Color accent capabilities specific to sl@0: a particular entry are retrieved. If uniform capability exists for every entry, then this method need not sl@0: be called per entry. sl@0: sl@0: @param aColorAccentCapabilities sl@0: This retrieves the color accent capabilities. sl@0: sl@0: @leave May leave as a result of some error. sl@0: */ sl@0: virtual void GetColorAccentCapabilitiesL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationCapabilities& aColorAccentCapabilities) const=0; sl@0: sl@0: /** sl@0: Set the color accent entries sl@0: sl@0: @param aIndex sl@0: This is a value from 0 to numOfSimultaneousColorAccent -1. This helps in managing the limited no. of sl@0: simultaneous color accent. If parameters are already set for the given entry, then it's up to the implementation sl@0: to replace the existing one or discard it. sl@0: sl@0: @param aColorAccentParameters sl@0: The parameters necessary to define clearly the color accent operation for the given entry. sl@0: iEntryStatus has to be updated by the implementation as per the result of the setting operation. sl@0: So, iEntryStatus value is redundant at this point. The parameters defined for target colors in sl@0: TColorOperationEntry are redundant for color accent. sl@0: sl@0: @note Triggers KUidECamEventCIPSetColorAccentEntry to all MCameraObserver2 clients of the camera. sl@0: HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be sl@0: used in order to provide the entry no. of the color being set. sl@0: Implementation Hint: On success, entry status (iEntryStatus) for that entry should sl@0: be set to TValueInfo::EDiscreteSteps and saved on the implementation side. sl@0: */ sl@0: virtual void SetColorAccentEntry(TInt aIndex, const CCamera::CCameraImageProcessing::TColorOperationEntry& aColorAccentParameters)=0; sl@0: sl@0: /** sl@0: Removes the color accent entry corresponding to the given index sl@0: sl@0: @param aIndex sl@0: This gives the color accent entry to be removed. sl@0: sl@0: @note Triggers KUidECamEventCIPRemoveColorAccentEntry to all MCameraObserver2 clients of the camera. sl@0: HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be sl@0: used in order to provide the entry no. of the color being removed. sl@0: Implementation Hint: On success, entry status (iEntryStatus) for that entry should sl@0: be set to TValueInfo::ENotActive and saved on the implementation side. sl@0: */ sl@0: virtual void RemoveColorAccentEntry(TInt aIndex)=0; sl@0: sl@0: /** sl@0: Get the details of the color accent entry corresponding to the given index sl@0: sl@0: @param aIndex sl@0: This gives the color accent entry whose information has to be retrieved. sl@0: sl@0: @param aColorAccentParameters sl@0: This contains the parameters currently being used by the color accent operation for the given entry. sl@0: The parameters defined for target colors in TColorOperationEntry are redundant for color accent. sl@0: sl@0: @leave May leave as a result of some error. sl@0: */ sl@0: virtual void GetColorAccentEntryL(TInt aIndex, CCamera::CCameraImageProcessing::TColorOperationEntry& aColorAccentParameters) const=0; sl@0: sl@0: /** sl@0: Starts the color accent process after taking into account the color accent entries updated up to this point. sl@0: sl@0: @note Triggers KUidECamEventCIPStartColorAccent to all MCameraObserver2 sl@0: clients of the camera. HandleEvent is used to report the result or any possible error. sl@0: */ sl@0: virtual void StartColorAccent()=0; sl@0: sl@0: /** sl@0: Cancel the color accent process. sl@0: sl@0: @leave May leave as a result of some error. sl@0: sl@0: @note Used to cancel the color accent process which might have been just started. sl@0: If the issued StartColorAccentL() gets cancelled, its event should report KErrCancel. sl@0: */ sl@0: virtual void CancelColorAccentL()=0; sl@0: }; sl@0: sl@0: /** sl@0: Mixin class for implementation of extended features like custom orientation and event filtering sl@0: by providers of the Image Processing Camera Extension API. sl@0: sl@0: @publishedPartner sl@0: @prototype sl@0: */ sl@0: class MCameraImageProcessing3 sl@0: { sl@0: sl@0: public: sl@0: sl@0: /** sl@0: Releases the interface. sl@0: */ sl@0: virtual void Release()=0; sl@0: sl@0: /** sl@0: Retrieves the supported options for a particular orientation reference. sl@0: sl@0: @param aOrientationReference sl@0: A TOrientationReference for which supported relative custom orientation have to retrieved. sl@0: sl@0: @param aSupportedRelativeRotation sl@0: A bitfield which retrieves the supported TRelativeRotation for 'aOrientationReference' sl@0: sl@0: @param aSupportedRelativeMirroring sl@0: A bitfield which retrieves the supported TRelativeMirror for 'aOrientationReference' sl@0: sl@0: @param aSupportedRelativeFlipping sl@0: A bitfield which retrieves the supported TRelativeFlipping for 'aOrientationReference' sl@0: sl@0: @leave May leave with any error code. sl@0: */ sl@0: virtual void GetSupportedRelativeOrientationOptionsL(CCamera::CCameraImageProcessing::TOrientationReference aOrientationReference, sl@0: TUint& aSupportedRelativeRotation, TUint& aSupportedRelativeMirroring, TUint& aSupportedRelativeFlipping) const=0; sl@0: sl@0: /** sl@0: Retrieves the options which is being used for the current orientation reference. sl@0: sl@0: @param aOrientationReference sl@0: A TOrientationReference which is the current orientation reference being used. sl@0: sl@0: @param aRelativeRotation sl@0: A TRelativeRotation which is the current relative rotation being used with aOrientationReference. sl@0: sl@0: @param aRelativeMirror sl@0: A TRelativeMirror which is the current relative mirroring being used with aOrientationReference. sl@0: sl@0: @param aRelativeFlipping sl@0: A TRelativeFlipping which is the current relative flipping being used with aOrientationReference. sl@0: sl@0: @leave May leave with any error code. sl@0: */ sl@0: virtual void GetCurrentRelativeOrientationOptionsL(CCamera::CCameraImageProcessing::TOrientationReference& aOrientationReference, sl@0: CCamera::CCameraImageProcessing::TRelativeRotation& aRelativeRotation, sl@0: CCamera::CCameraImageProcessing::TRelativeMirror& aRelativeMirror, sl@0: CCamera::CCameraImageProcessing::TRelativeFlipping& aRelativeFlipping) const=0; sl@0: sl@0: /** sl@0: Sets the options which would be used with the desired orientation reference. sl@0: sl@0: @param aOrientationReference sl@0: The desired TOrientationReference. sl@0: sl@0: @param aRelativeRotation sl@0: The desired TRelativeRotation which would be used with 'aOrientationReference'. sl@0: sl@0: @param TRelativeMirror sl@0: The desired TRelativeMirror which would be used with 'aOrientationReference' sl@0: sl@0: @param TRelativeFlipping sl@0: The desired TRelativeFlipping which would be used with 'aOrientationReference' sl@0: sl@0: @note Event KUidECamEventImageProcessingTransformRelativeOrientation is used to notify clients about relative sl@0: custom orientation setting operation. sl@0: sl@0: @note If the current picture orientation (Refer CCamera::CCameraAdvancedSettings::TPictureOrientation) is not possible sl@0: to be achieved with the relative custom orientation, event KUidECamEventPictureOrientationUnachievable will be sl@0: notified to the client. sl@0: sl@0: @note If the dimension of the image gets changed by the desired relative orientation options, notification sl@0: KUidECamEventCameraSettingImageSize will be notified to the client. sl@0: */ sl@0: virtual void SetRelativeOrientationOptions(CCamera::CCameraImageProcessing::TOrientationReference aOrientationReference, sl@0: CCamera::CCameraImageProcessing::TRelativeRotation aRelativeRotation, sl@0: CCamera::CCameraImageProcessing::TRelativeMirror aRelativeMirror, sl@0: CCamera::CCameraImageProcessing::TRelativeFlipping aRelativeFlipping) const=0; sl@0: }; sl@0: sl@0: #endif // ECAMIMAGEPROCESSINGINTF_H