CBitmapScaler Class Reference

#include <bitmaptransforms.h>

Link against: bitmaptransforms.lib

class CBitmapScaler : public CBase

Inherits from

Detailed Description

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

Member Enumeration Documentation

Enum TQualityAlgorithm

An enumeration to specify the level of quality algorithm.

EnumeratorValueDescription
EMinimumQuality

Fastest/lowest quality

EMediumQuality

Middle range speed/middle range quality

EMaximumQuality

Slowest/highest quality

Constructor & Destructor Documentation

~CBitmapScaler ( )

IMPORT_C~CBitmapScaler()

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

Member Function Documentation

Cancel ( )

IMPORT_C voidCancel()

Cancel any outstanding activity.

CustomCommand ( TUid, TAny * )

IMPORT_C TIntCustomCommand(TUidaUid,
TAny *aParam
)

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.

Pre-condition
When a command requires parameters aParam is not NULL.
Parameters
aUidThe ID of the command.
aParamThe command specific information.

DisablePostProcessing ( TBool )

TInt DisablePostProcessing(TBoolaState)[inline]

SetPostProcessing

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

NewL ( )

IMPORT_C CBitmapScaler *NewL()[static]

Constructs a CBitmapScaler object.

Return Value
A pointer to a CBitmapScaler object.

Scale ( TRequestStatus *, CFbsBitmap &, CFbsBitmap &, TBool )

IMPORT_C voidScale(TRequestStatus *aRequestStatus,
CFbsBitmap &aSrcBitmap,
CFbsBitmap &aTgtBitmap,
TBoolaMaintainAspectRatio = ETrue
)

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
aRequestStatusOn return, contains a pointer to the completion status of the rescale of the bitmap.
aSrcBitmapThe bitmap to be re-scaled.
aTgtBitmapThe target location for the re-scaled bitmap.
aMaintainAspectRatioA 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 ( TRequestStatus *, CFbsBitmap &, const TSize &, TBool )

IMPORT_C voidScale(TRequestStatus *aRequestStatus,
CFbsBitmap &aBitmap,
const TSize &aDestinationSize,
TBoolaMaintainAspectRatio = ETrue
)

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
aRequestStatusOn return, contains a pointer to the completion status of the rescale of the bitmap.
aBitmapThe bitmap to be re-scaled. This reference is also the target location for the re-scaled bitmap.
aDestinationSizeThe requested target size for the re-scaled bitmap.
aMaintainAspectRatioA 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.

SetQualityAlgorithm ( TQualityAlgorithm )

TInt SetQualityAlgorithm(TQualityAlgorithmaQualityLevel)[inline]

SetQualityAlgorithm

Parameters
aQualityLevelan enumeration which sets the quality algorithm

UseLowMemoryAlgorithm ( TBool )

TInt UseLowMemoryAlgorithm(TBoolaState)[inline]

UseLowMemory

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