CGifScaler Class Reference

#include <gifscaler.h>

Link against: gifscaler.lib

class CGifScaler : public CBase

Inherits from

Detailed Description

The public API for clients to call the GifScaler scaling and color quantization library.

Member Enumeration Documentation

Enum TOptions

TOptions is an enumeration within the namespace CGifScaler The enumeration provides a set of supported quantization levels: (EHighQualityQuantization is the default setting as it provides the best balance between quality and speed)

EnumeratorValueDescription
ELowQualityQuantization

Provides the lowest quality, but also the fastest.

EMediumQualityQuantization

Provides medium quality quantization

EHighQualityQuantization

Provides high quality quantization

EMaximumQualityQuantization

Provides the highest quality quantization, but is also the slowest.

Constructor & Destructor Documentation

~CGifScaler ( )

IMPORT_C~CGifScaler()

This is the destructor for the CGifScaler and is responsible for deallocating all resources allocated by the CGifScaler.

Member Function Documentation

Cancel ( )

IMPORT_C voidCancel()

Cancel any outstanding activity.

NewL ( CFbsBitmap &, TOptions )

IMPORT_C CGifScaler *NewL(CFbsBitmap &aSource,
TOptionsaOptions = EHighQualityQuantization
)[static]

The function NewL constructs a CGifScaler. This version constructs a scaler for scaling and color quantizing only. No mask data is required in this case)

Parameters
aSourceThe bitmap to be re-scaled.
aOptionsScaling and color quantization options.
Return Value
A pointer to a fully constructed CGifScaler
Leave Codes
KErrArgumentif the source bitmap or the options are invalid.
Panic Codes
ENoSourceBitmapif the source bitmap has not been created.

NewL ( CFbsBitmap &, CFbsBitmap &, TOptions )

IMPORT_C CGifScaler *NewL(CFbsBitmap &aSource,
CFbsBitmap &aSourceMask,
TOptionsaOptions = EHighQualityQuantization
)[static]

The function NewL constructs a CGifScaler. This version constructs a scaler for scaling and color quantizing an image with transparency.

Parameters
aSourceThe bitmap to be re-scaled.
aSourceMaskThe mask bitmap that provides the transparency data.
aOptionsScaling and color quantization options.
Return Value
A pointer to a fully constructed CGifScaler
Leave Codes
KErrArgumentif the source bitmap, source mask bitmap, or the options are invalid.
Panic Codes
ENoSourceBitmapif the source bitmap has not been created.
ENoSourceMaskBitmapif the source mask bitmap has not been created.

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

IMPORT_C voidScale(TRequestStatus *aStatus,
CFbsBitmap &aDestination,
CPalette &aPalette,
TBoolaMaintainAspectRatio = ETrue
)

Scale the source bitmap and mask to produce a single 8bpp bitmap and an output palette. If a mask was supplied during construction the last index in the palette will be used for transparency.

The scaling factor is based on the relative sizes of the source and target bitmaps. The operation is asynchronous. When it is complete, successfully or otherwise, the TRequestStatus aStatus is set, passing the state of the operation.

Parameters
aStatusRequest status to signal when scaling is complete.
aDestinationThe destination bitmap. (EColor256)
aPaletteThe output palette.
aMaintainAspectRatioETrue - 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 - the aspect ratio need not be retained.

ThresholdScale ( TRequestStatus *, CFbsBitmap &, CPalette &, TUint8, TBool )

IMPORT_C voidThresholdScale(TRequestStatus *aStatus,
CFbsBitmap &aDestination,
CPalette &aPalette,
TUint8aTransparencyThreshold,
TBoolaMaintainAspectRatio = ETrue
)

Scale the source bitmap and mask to produce a single 8bpp bitmap and an output palette, specifying a transparency level to be used when determining whether destination pixels are transparent. If a mask was supplied during construction the last index in the palette will be used for transparency.

The scaling factor is based on the relative sizes of the source and target bitmaps. The operation is asynchronous. When it is complete, successfully or otherwise, the TRequestStatus aStatus is set, passing the state of the operation.

Parameters
aStatusRequest status to signal when scaling is complete.
aDestinationThe destination bitmap. (EColor256)
aPaletteThe output palette.
aTransparencyThresholdThe transparency level used to determine if destination pixels are transparent.
aMaintainAspectRatioETrue - 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 - the aspect ratio need not be retained.