TImageConvScaler Class Reference

class TImageConvScaler

Scaling extension for Image Conversion Library. Supports both arbitrary or 'power of two' 1/2, 1/4, 1/8 scaling

Public Member Functions
IMPORT_C voidGetCapabilities(TScalerCaps &)
IMPORT_C voidSetScalingL(const TSize &, TImageConvScaler::TScalerQuality, TBool)
IMPORT_C voidSetScalingL(TInt, TImageConvScaler::TScalerQuality)
Private Member Functions
TImageConvScaler()
voidSetExtension(MImageConvExtension *)
Public Member Enumerations
enumTScalerQuality { EMinimumQuality, EMediumQuality, EMaximumQuality }
Private Attributes
MImageConvScaler *iExtension
TInt iReserved

Constructor & Destructor Documentation

TImageConvScaler()

IMPORT_CTImageConvScaler()[private]

Member Functions Documentation

GetCapabilities(TScalerCaps &)

IMPORT_C voidGetCapabilities(TScalerCaps &aCaps)const

Get the codec plugin's capabilities.

Parameters

TScalerCaps & aCapsReturns scaling capabilities of the codec plugin.

SetExtension(MImageConvExtension *)

voidSetExtension(MImageConvExtension *aExtension)[private]

Parameters

MImageConvExtension * aExtension

SetScalingL(const TSize &, TImageConvScaler::TScalerQuality, TBool)

IMPORT_C voidSetScalingL(const TSize &aDesiredSize,
TImageConvScaler::TScalerQualityaQuality,
TBoolaLockAspectRatio
)

Request scaling to the desired size using the quality specified and specifying if the aspect ratio is to be preserved. Ensure that CImageDecoder::GetDestinationSize is used to obtain the size of destination bitmap passed to CImageDecoder::Convert if scaling is set up by calling this method.

Example: If a plugin is only capable of power of two scaling, with an original image size of 600x400, then calling this SetScalingL function with a desired size of 500x300 will result in a subsequent call to CImageDecoder::GetDestinationSize returning a size of 300x200 (that is, a scaling coefficient of -2).

leave

KErrNotSupported if an invalid size is passed.

leave

KErrNotSupported if aLockAspectRatio is EFalse and codec only supports preservation of aspect ratio.

CImageDecoder::Convert

CImageDecoder::GetDestinationSize

TImageConvScaler::GetCapabilities

Parameters

const TSize & aDesiredSizeProposed size of the scaled image. Note that this may not necessarily be the size returned by a subsequent call to CImageDecoder::GetDestinationSize and is dependant upon the operations (such as scaling, cropping and rotation) requested and also the capabilities of the plugin (which can be queried using TImageConvScaler::GetCapabilities).
TImageConvScaler::TScalerQuality aQualityDesired quality of the image. Allows codec to lower quality targets to improve performance.
TBool aLockAspectRatioSet to ETrue if the aspect ratio of the original image is to be preserved.

SetScalingL(TInt, TImageConvScaler::TScalerQuality)

IMPORT_C voidSetScalingL(TIntaScalingCoeff,
TImageConvScaler::TScalerQualityaScalingQuality
)

Define the scaling to be applied to the image according to the given coefficient at the requested quality. Ensure that CImageDecoder::GetDestinationSize is used to obtain the size of destination bitmap to be passed to CImageDecoder::Convert.

leave

KErrNotSupported if codec cannot perform the requested scale.

CImageDecoder::Convert

Parameters

TInt aScalingCoeffScale to apply to the source. 2 means twice the original size, -2 half the size. Do not confuse this with ReductionFactor where 2 indicates 1/2 size.
TImageConvScaler::TScalerQuality aScalingQualityDesired quality of the image. Allows codec to lower quality targets to improve performance.

Member Enumerations Documentation

Enum TScalerQuality

Quality used during scaling.

Enumerators

EMinimumQuality
EMediumQuality
EMaximumQuality

Member Data Documentation

MImageConvScaler * iExtension

MImageConvScaler *iExtension[private]

TInt iReserved

TInt iReserved[private]