Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: BitmapTransforms.h
Link against: bitmaptransforms.lib

Class CBitmapScaler

class CBitmapScaler : public CBase;

Description

The public API for clients to call the BitmapTransforms Library bitmap scaling.

Derivation

Members

Defined in CBitmapScaler:
Cancel(), CustomCommand(), DisablePostProcessing(), EMaximumQuality, EMediumQuality, EMinimumQuality, NewL(), Scale(), Scale(), SetQualityAlgorithm(), TQualityAlgorithm, UseLowMemoryAlgorithm(), ~CBitmapScaler()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

static IMPORT_C CBitmapScaler *NewL();

Description

Constructs a CBitmapScaler object.

Return value

CBitmapScaler *

A pointer to a CBitmapScaler object.


~CBitmapScaler()

IMPORT_C ~CBitmapScaler();

Description

This is the destructor for the CBitmapScaler and is responsible for deallocating all resources alloctaed by the CBitmapScaler.

[Top]


Member functions


Scale()

IMPORT_C void Scale(TRequestStatus *aRequestStatus, CFbsBitmap &aSrcBitmap, CFbsBitmap &aTgtBitmap, TBool aMaintainAspectRatio=ETrue);

Description

Begins the bitmap re-scaling operation.

The scaling factor is based on the relative sizes of the source and target bitmaps. The operation is asynchronous. KErrOverFlow status is set if the sizes of input bitmaps are too large for the algorithm to handle.

Post-Condition

The result of the operation is pointed to by aRequestStatus.

Parameters

TRequestStatus *aRequestStatus

On return, contains a pointer to the completion status of the rescale of the bitmap.

CFbsBitmap &aSrcBitmap

The bitmap to be re-scaled.

CFbsBitmap &aTgtBitmap

The target location for the re-scaled bitmap.

TBool aMaintainAspectRatio

A boolean indicating if the aspect ratio is maintained. ETrue means the aspect ratio is retained; this is the default. The same scaling factor is applied in both the horizontal and vertical directions. This is the smaller of the horizontal scaling factor and the vertical scaling factor. EFalse means the aspect ratio need not be retained.


Scale()

IMPORT_C void Scale(TRequestStatus *aRequestStatus, CFbsBitmap &aBitmap, const TSize &aDestinationSize, TBool aMaintainAspectRatio=ETrue);

Description

Begins the bitmap re-scaling operation.

The scaling factor is based on the relative value of the source bitmap size and the explicitly supplied size. The operation is asynchronous. When it is complete, successfully or otherwise, the TRequestStatus is set, passing the state of the operation. KErrOverFlow status is set if the sizes of input bitmaps are too large for the algorithm to handle.

Parameters

TRequestStatus *aRequestStatus

On return, contains a pointer to the completion status of the rescale of the bitmap.

CFbsBitmap &aBitmap

The bitmap to be re-scaled. This reference is also the target location for the re-scaled bitmap.

const TSize &aDestinationSize

The requested target size for the re-scaled bitmap.

TBool aMaintainAspectRatio

A boolean indicating if the aspect ratio is maintained. ETrue means the aspect ratio is retained; this is the default. The same scaling factor is applied in both the horizontal and vertical directions. This is the smaller of the horizontal scaling factor and the vertical scaling factor. EFalse means the aspect ratio need not be retained.


Cancel()

IMPORT_C void Cancel();

Description

Cancel any outstanding activity.


CustomCommand()

IMPORT_C TInt CustomCommand(TUid aUid, TAny *aParam);

Pre-Condition

When a command requires parameters aParam is not NULL.

Description

Provides custom command capabilties on CBitmapScaler. The command is dispatched on aUid and if the command is not known KErrNotSupported will be returned. This function is synchronous.

The Default implementation will support one command to enable and disable post processing on the scale operation The uid of this command is published in the header file. Changes to the status of Post Processing Enabled will become effective only after an exising scaling operation has completed.

Parameters

TUid aUid

The ID of the command.

TAny *aParam

The command specific information.

Return value

TInt


DisablePostProcessing()

inline TInt DisablePostProcessing(TBool aState);

Description

SetPostProcessing

Parameters

TBool aState

a boolean flag which if true will set post processing on (Note by defualt the scaler has post processing on)

Return value

TInt


UseLowMemoryAlgorithm()

inline TInt UseLowMemoryAlgorithm(TBool aState);

Description

UseLowMemory

Parameters

TBool aState

a boolean flag which if true will enable the low memory algorithm (Note by defualt the scaler does not use the low memory algorithm)

Return value

TInt


SetQualityAlgorithm()

inline TInt SetQualityAlgorithm(TQualityAlgorithm aQualityLevel);

Description

SetQualityAlgorithm

Parameters

TQualityAlgorithm aQualityLevel

an enumeration which sets the quality algorithm

Return value

TInt

[Top]


Member enumerations


Enum TQualityAlgorithm

TQualityAlgorithm

Description

An enumeration to specify the level of quality algorithm.

EMinimumQuality

Fastest/lowest quality

EMediumQuality

Middle range speed/middle range quality

EMaximumQuality

Slowest/highest quality