#include <ecamimageprocessing.h>
class CCamera::CCameraImageProcessing : public CBase |
This class is used to perform image processing operations on the camera. These include brightness, contrast, gamma, hue, sharpness and saturation adjustments. The client is also able to perform simple image transformations like cropping, rotation, mirroring, scaling, noise reduction and glare reduction. . When an operation selection is complete, all clients are notified with the respective event UID.
As often cameras may support only a subset of discrete values of the allowed range, the API allows the client to retrieve those and use them explicitly.
This class is not intended for sub-classing and used to standardise existing varieties of implementations.
it is assumed that setting a new value for a transformations(transform, adjust, effect) effectively activates the transformations. Whilst for effects and adjustments there is always a value, transforms may have a dependency on other parameters and crop - requires setting of source rectangle. scale - will use setting of source rectangle, and the magnification factor is determined by the source rectangle and the output size. This is always magnification. if a value is set, it is assumed to be a scaling factor multiplied by KECamFineResolutionFactor and set to integer. mirror - values of TMirror type. rotation - the angle in degrees. noise reduction - TNoiseReduction. glare removal - TGlareReduction.
// Lets assume that an application would need to check whether gamma correction is // supported on a particular platform. After obtaining a valid pointer to the interface, // it would call GetSupportedTransformationsL() to obtain the list of the supported // transformations and check whether KUidECamEventImageProcessingAdjustGamma // is in the list. If it is then call SetTranformationValue(KUidECamEventImageProcessingAdjustGamma, 200); // to set the new value. A notification will be generated to the client to indicate success. RArray<TUid> suppTransforms; // array of supported transformations CleanupClosePushL(suppTransforms); imageProcess->GetSupportedTransformationsL(suppTransfUids); ... // if the gamma is supported TInt gammaCorrection = 200; // gamma correction of 2.0 imageProcess->SetTranformationValue(KUidECamEventImageProcessingAdjustGamma, gammaCorrection); ... // pop stack to close the RArray
If the class methods leave, the output type parameter value is not guaranteed to be valid.
Used for color swap and color accent feature in TEffect. It describes whether the given source or target color represents itself or a group of color.
Used for color swap and color accent feature in TEffect. It describes the type of grouping for source and target colors when they represent a group of color.
Different types of contrast enhancement options. The enumeration list may be extended in future.
Settings for the supported effects
Enumerator | Value | Description |
---|---|---|
EEffectNone | 0x00000000 |
Effects off is default, always supported |
EEffectNegative | 0x00000001 |
Negative visual effect. |
EEffectMonochrome | 0x00000002 |
Black and white visual effect. |
EEffectSolarize | 0x00000004 |
Solarization visual effect. |
EEffectSepia | 0x00000008 |
Sepia visual effect. |
EEffectEmboss | 0x00000010 |
Emboss visual effect. |
EEffectRedEyeReduction | 0x00000020 |
Red eye glare reduction visual effect. |
EEffectVivid | 0x00000040 |
Vivid colour visual effect. |
EEffectNeutral | 0x00000080 |
Neutral colour visual effect. |
EEffectLowSharpening | 0x00000100 |
Selective sharpening visual effect. |
EEffectNatural | 0x00000200 |
Natural visual effect. This enum value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(). |
EEffectCine | 0x00000400 |
Cine visual effect. This enum value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(). |
EEffectOldFilm | 0x00000800 |
Old film visual effect. This enum value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(). |
EEffectColorSwap | 0x00001000 |
Color swap visual effect. This enum value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(). |
EEffectColorAccent | 0x00002000 |
Where a list of color can be kept as they are and the rest converted to gray. This enum value is available from the 'supported' or 'getter' methods only to the API clients using CCamera::New2L() or CCamera::NewDuplicate2L(). |
Used to provide different types of references for orientation of images retrieved. These references are the various means by the orientation of an image can be defined. Client needs to choose a particular TOrientationReference and specify any relative rotation, mirroring and flipping on top of it.
This enumeration has nothing to do with absolute rotation. Uid KUidECamEventImageProcessingTransformRotate is used for absolute rotation purposes.
The enumeration list may be extended in future.
Different types of software-based red eye reduction options. The enumeration list may be extended in future.
Used to describe the various relative flipping. The term 'relative' means that the flipping is applied after the image undergoes orientation as given by TOrientationReference.
The enumeration list may be extended in future.
Used to describe the various relative mirroring. The term 'relative' means that the mirroring is applied after the image undergoes orientation as given by TOrientationReference.
The enumeration list may be extended in future.
Used to describe the various relative rotation. The term 'relative' means that the rotation is applied after the image undergoes orientation as given by TOrientationReference.
The enumeration list may be extended in future.
IMPORT_C void | CancelColorAccentL | ( | ) |
Cancel the color accent process.
Used to cancel the color accent process which might have been just started. If the issued StartColorAccentL() gets cancelled, its event should report KErrCancel.
IMPORT_C void | CancelColorSwappingL | ( | ) |
Cancel the color swapping process.
Used to cancel the color swapping process which might have been just started. If the issued StartColorSwappingL() gets cancelled, its event should report KErrCancel.
IMPORT_C CCameraImageProcessing * | CreateL | ( | CCamera & | aCamera, |
MImplementationFactory & | aImplFactory | |||
) | [static] |
Factory function for creating the CCameraImageProcessing object specifically for any one of the following:- VideoCapture and Viewfinder. This may be used in other possible cases as well.
The other factory method CCamera::CCameraImageProcessing::NewL is assumed for being operated on image captures only.
This method is supposed to be used by internal ECAM components only.
Parameter | Description |
---|---|
aCamera | A reference to a CCamera object providing the settings. |
aImplFactory | A reference to the MImplementationFactory derived object. |
Returns: a pointer to a fully constructed CCameraImageProcessing object.
Get the sequence of all active transforms, ordered in order of execution.
Parameter | Description |
---|---|
aTransformSequence | an empty array to be populated with sequence of transform UIDs, where transform entries with smaller index are executed earlier. |
IMPORT_C void | GetColorAccentCapabilitiesL | ( | TInt | aIndex, |
TColorOperationCapabilities & | aColorAccentCapabilities | |||
) | const |
Retrieves the color accent capabilites per entry, if different entries have different capabilities otherwise the same capabilities retrieved for a particular entry can be assumed to be valid for every entry
Parameter | Description |
---|---|
aIndex | This is a value from 0 to numOfSimultaneousColorAccent -1. Color accent capabilities specific to a particular entry are retrieved. If uniform capability exists for every entry, then this method need not be called per entry. |
aColorAccentCapabilities | This retrieves the color accent capabilities. |
IMPORT_C void | GetColorAccentEntryL | ( | TInt | aIndex, |
TColorOperationEntry & | aColorAccentParameters | |||
) | const |
Get the details of the color accent entry corresponding to the given index
Parameter | Description |
---|---|
aIndex | This gives the color accent entry whose information has to be retrieved. |
aColorAccentParameters | This contains the parameters currently being used by the color accent operation for the given entry. The parameters defined for target colors in TColorOperationEntry are redundant for color accent. |
IMPORT_C void | GetColorSwapCapabilitiesL | ( | TInt | aIndex, |
TColorOperationCapabilities & | aColorSwapCapabilities | |||
) | const |
Retrieves the color swapping capabilites per entry, if different entries have different capabilities otherwise the same capabilities retrieved for a particular entry can be assumed to be valid for every entry
Parameter | Description |
---|---|
aIndex | This is a value from 0 to numOfSimultaneousColorSwappings -1. Color swapping capabilities specific to a particular entry are retrieved. If uniform capability exists for every entry, then this method need not be called per entry. |
aColorSwapCapabilities | This retrieves the color swap capabilities. |
IMPORT_C void | GetColorSwapEntryL | ( | TInt | aIndex, |
TColorOperationEntry & | aColorSwapParameters | |||
) | const |
Get the details of the color swap entry corresponding to the given index
Parameter | Description |
---|---|
aIndex | This gives the color swapping entry whose information has to be retrieved. |
aColorSwapParameters | This contains the parameters currently being used by the color swapping operation for the given entry. |
IMPORT_C void | GetConcurrentColorAccentSupportedL | ( | TInt & | aConcurrentColorAccentSupported | ) | const |
Retrieves the maximum number of color entries on which simultaneous color accent process is possible.
Parameter | Description |
---|---|
aConcurrentColorAccentSupported | Retrieves the number of color entries on which simultaneous color accent process is possible. Retrieves 0 when color accent process is not supported. |
IMPORT_C void | GetConcurrentColorSwappingsSupportedL | ( | TInt & | aConcurrentColorSwappingSupported | ) | const |
Retrieves the maximum number of simultaneous color swapping possible.
Parameter | Description |
---|---|
aConcurrentColorSwappingSupported | Retrieves the number of simultaneous color swapping supported. Retrieves 0 when swapping feature is not supported. |
IMPORT_C void | GetCurrentRelativeOrientationOptionsL | ( | TOrientationReference & | aOrientationReference, |
TRelativeRotation & | aRelativeRotation, | |||
TRelativeMirror & | aRelativeMirror, | |||
TRelativeFlipping & | aRelativeFlipping | |||
) | const |
Retrieves the options which is being used for the current orientation reference.
Parameter | Description |
---|---|
aOrientationReference | A TOrientationReference which is the current orientation reference being used. |
aRelativeRotation | A TRelativeRotation which is the current relative rotation being used with aOrientationReference. |
aRelativeMirror | A TRelativeMirror which is the current relative mirroring being used with aOrientationReference. |
aRelativeFlipping | A TRelativeFlipping which is the current relative flipping being used with aOrientationReference. |
IMPORT_C void | GetSourceRect | ( | TRect & | aRect | ) | const |
Get the source rectangle for KUidECamEventImageProcessingTransformScale or KUidECamEventImageProcessingTransformCrop. The coordinates should fall within the current image rectangle. The result is always a logical AND operation between the two rectangles.
Parameter | Description |
---|---|
aRect | a reference to TRect object to hold the current source rectangle coordinates. If it has not been set, the coordinates match these of the whole image. |
IMPORT_C void | GetSupportedRelativeOrientationOptionsL | ( | TOrientationReference | aOrientationReference, |
TUint & | aSupportedRelativeRotation, | |||
TUint & | aSupportedRelativeMirroring, | |||
TUint & | aSupportedRelativeFlipping | |||
) | const |
Retrieves the supported options for a particular orientation reference.
Parameter | Description |
---|---|
aOrientationReference | A TOrientationReference for which supported relative custom orientation have to retrieved. |
aSupportedRelativeRotation | A bitfield which retrieves the supported TRelativeRotation for 'aOrientationReference' |
aSupportedRelativeMirroring | A bitfield which retrieves the supported TRelativeMirror for 'aOrientationReference' |
aSupportedRelativeFlipping | A bitfield which retrieves the supported TRelativeFlipping for 'aOrientationReference' |
IMPORT_C void | GetTransformationSupportedValuesL | ( | TUid | aTransformation, |
RArray< TInt > & | aValues, | |||
TValueInfo & | aInfo | |||
) | const |
Get all values supported by an active transformation.
Depending on the value of aInfo parameter, same array of values may describe different set of values. When camera device doesn't support this, empty array may be returned and TValueInfo may be ENotActive; corresponding getter/setters for this feature should not be used in such a case.
If CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that application is not prepared to receive extra added enum values for Effects. So, any extra enum value(unrecognised) passed from the implementation will be filtered at this point. To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() to create camera object. In this case, application is assumed to be prepared to receive unrecognised enum values
Parameter | Description |
---|---|
aTransformation | The UID of active transform for which values are requested. |
aValues | An array of integers to represent the values for the requested transformation. |
aInfo | Additional information describing the returned array of values. |
Get the current value of a transformation
If CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that application is not prepared to receive extra added enum values for Effects. So, any extra enum value (unrecognised) received from the implementation will be dropped and EEffectNone would be passed instead. To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() to create camera object. In this case, application is assumed to be prepared to receive unrecognised enum values
Use this method instead of deprecated TInt TransformationValue(TUid aTransformation)
Parameter | Description |
---|---|
aTransformation | The UID of the transformation |
aTransformationValue | Reference to the integer value of the tranformation. |
Returns: system wide error code.
IMPORT_C CCameraImageProcessing * | NewL | ( | CCamera & | aCamera | ) | [static] |
Factory function for creating the CCameraImageProcessing object. The created object is supposed to be meant for image captures only.
Clients using MCameraObserver are not recommended to use this extension class since they cannot handle events.
Parameter | Description |
---|---|
aCamera | a reference to a CCamera object providing the settings. |
Returns: a pointer to a fully constructed CCameraImageProcessing object.
IMPORT_C void | RemoveColorAccentEntryL | ( | TInt | aIndex | ) |
Removes the color accent entry corresponding to the given index
Triggers KUidECamEventCIPRemoveColorAccentEntry to all MCameraObserver2 clients of the camera. HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be used in order to provide the entry no. of the color being removed.
Parameter | Description |
---|---|
aIndex | This gives the color accent entry to be removed. |
IMPORT_C void | RemoveColorSwapEntryL | ( | TInt | aIndex | ) |
Removes the color swap entry corresponding to the given index
Triggers KUidECamEventCIPRemoveColorSwapEntry to all MCameraObserver2 clients of the camera. HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be used in order to provide the entry no. of the color being removed.
Parameter | Description |
---|---|
aIndex | This gives the color swapping entry to be removed. |
Set the order of all active transform in terms of execution. The transforms with smaller index are executed earlier.
Parameter | Description |
---|---|
aTransformSequence | The list of ordered transforms, where transforms with smaller index are executed earlier. |
IMPORT_C void | SetColorAccentEntryL | ( | TInt | aIndex, |
const TColorOperationEntry & | aColorAccentParameters | |||
) |
Set the color accent entries
Triggers KUidECamEventCIPSetColorAccentEntry to all MCameraObserver2 clients of the camera. HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be used in order to provide the entry no. of the color being set.
Parameter | Description |
---|---|
aIndex | This is a value from 0 to numOfSimultaneousColorAccent -1. This helps in managing the limited no. of simultaneous color accent. If parameters are already set for the given entry, then it's up to the implementation to replace the existing one or discard it. |
aColorAccentParameters | The parameters necessary to define clearly the color accent operation for the given entry. iEntryStatus has to be updated by the implementation as per the result of the setting operation. So, iEntryStatus value is redundant at this point. The parameters defined for target colors in TColorOperationEntry are redundant for color accent. |
IMPORT_C void | SetColorSwapEntryL | ( | TInt | aIndex, |
const TColorOperationEntry & | aColorSwapParameters | |||
) |
Set the color swap entries
Triggers KUidECamEventCIPSetColorSwapEntry to all MCameraObserver2 clients of the camera. HandleEvent is used to report the result or any possible error. TECAMEvent2 class should be used in order to provide the entry no. of the color being set.
Parameter | Description |
---|---|
aIndex | This is a value from 0 to numOfSimultaneousColorSwappings -1. This helps in managing the limited no. of simultaneous color swaps. If parameters are already set for the given entry, then it's up to the implementation to replace the existing one or discard it. |
aColorSwapParameters | The parameters necessary to define clearly the color swapping operation for the given entry. iEntryStatus has to be updated by the implementation as per the result of the setting operation. So, iEntryStatus value is redundant at this point. |
IMPORT_C void | SetRelativeOrientationOptionsL | ( | TOrientationReference | aOrientationReference, |
TRelativeRotation | aRelativeRotation, | |||
TRelativeMirror | aRelativeMirror, | |||
TRelativeFlipping | aRelativeFlipping | |||
) |
Sets the options which would be used with the desired orientation reference.
Event KUidECamEventImageProcessingTransformRelativeOrientation is used to notify clients about relative custom orientation setting operation.
If the current picture orientation (Refer CCamera::CCameraAdvancedSettings::TPictureOrientation) is not possible to be achieved with the relative custom orientation, event KUidECamEventPictureOrientationUnachievable will be notified to the client.
If the dimension of the image gets changed by the desired relative orientation options, notification KUidECamEventCameraSettingImageSize will be notified to the client.
Parameter | Description |
---|---|
aOrientationReference | The desired TOrientationReference. |
aRelativeRotation | The desired TRelativeRotation which would be used with 'aOrientationReference'. |
IMPORT_C void | SetSourceRect | ( | const TRect & | aRect | ) |
Set the source rectangle for KUidECamEventImageProcessingTransformScale or KUidECamEventImageProcessingTransformCrop. The coordinates should fall within the current image rectangle. The result is always a logical AND operation between the two rectangles.
Parameter | Description |
---|---|
aRect | a reference to TRect object which describes the coordinates of the area of interest. |
Set new value for a transformation. A notification event with the transformation UID is sent to all clients. UIDs are in the form KUidECamEventImageProcessingXXXX.
Parameter | Description |
---|---|
aTransformation | The UID of the transformation |
aValue | The integer value of the tranformation. |
IMPORT_C void | StartColorAccentL | ( | ) |
Starts the color accent process after taking into account the color accent entries updated up to this point.
Triggers KUidECamEventCIPStartColorAccent to all MCameraObserver2 clients of the camera. HandleEvent is used to report the result or any possible error.
IMPORT_C void | StartColorSwappingL | ( | ) |
Starts the color swapping process after taking into account the color swap entries updated up to this point.
Triggers KUidECamEventCIPStartColorSwap to all MCameraObserver2 clients of the camera. HandleEvent is used to report the result or any possible error. One possible error case is when more than one entry describe the same color source. New ecam error KErrECamColorOperationConflict used in such a case.
DeprecatedUse TInt GetTransformationValue(TUid aTransformation, TInt& aTransformationValue);
Get the current value of a transformation
If CCamera::New2L() or CCamera::NewDuplicate2L() is not used to create CCamera object, it is assumed that application is not prepared to receive extra added enum values for Effects. So, any extra enum value (unrecognised) received from the implementation will be dropped and EEffectNone would be passed instead. To receive extra added enum values, application should rather use CCamera::New2L() or CCamera::NewDuplicate2L() to create camera object. In this case, application is assumed to be prepared to receive unrecognised enum values
Parameter | Description |
---|---|
aTransformation | The UID of the transformation |
Returns: The integer value of the tranformation.