class CGifScaler : public CBase |
The public API for clients to call the GifScaler scaling and color quantization library.
Public Member Functions | |
---|---|
~CGifScaler() | |
IMPORT_C void | Cancel() |
IMPORT_C CGifScaler * | NewL(CFbsBitmap &, TOptions) |
IMPORT_C CGifScaler * | NewL(CFbsBitmap &, CFbsBitmap &, TOptions) |
IMPORT_C void | Scale(TRequestStatus *, CFbsBitmap &, CPalette &, TBool) |
IMPORT_C void | ThresholdScale(TRequestStatus *, CFbsBitmap &, CPalette &, TUint8, TBool) |
Private Member Functions | |
---|---|
CGifScaler() | |
void | ConstructL(CFbsBitmap &, CFbsBitmap *, TOptions) |
Public Member Enumerations | |
---|---|
enum | TOptions { ELowQualityQuantization, EMediumQualityQuantization, EHighQualityQuantization, EMaximumQualityQuantization } |
Private Attributes | |
---|---|
CBody * | iBody |
IMPORT_C | ~CGifScaler | ( | ) |
This is the destructor for the CGifScaler and is responsible for deallocating all resources allocated by the CGifScaler.
void | ConstructL | ( | CFbsBitmap & | aSource, |
CFbsBitmap * | aSourceMask, | |||
TOptions | aOptions | |||
) | [private] |
ConstructL Performs second phase of contruction
CFbsBitmap & aSource | |
CFbsBitmap * aSourceMask | |
TOptions aOptions |
IMPORT_C CGifScaler * | NewL | ( | CFbsBitmap & | aSource, |
TOptions | aOptions = 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)
leave
KErrArgument if the source bitmap or the options are invalid.
panic
ENoSourceBitmap if the source bitmap has not been created.
A pointer to a fully constructed CGifScaler
CFbsBitmap & aSource | The bitmap to be re-scaled. |
TOptions aOptions = EHighQualityQuantization | Scaling and color quantization options. |
IMPORT_C CGifScaler * | NewL | ( | CFbsBitmap & | aSource, |
CFbsBitmap & | aSourceMask, | |||
TOptions | aOptions = EHighQualityQuantization | |||
) | [static] |
The function NewL constructs a CGifScaler. This version constructs a scaler for scaling and color quantizing an image with transparency.
leave
KErrArgument if the source bitmap, source mask bitmap, or the options are invalid.
panic
ENoSourceBitmap if the source bitmap has not been created.
panic
ENoSourceMaskBitmap if the source mask bitmap has not been created.
A pointer to a fully constructed CGifScaler
CFbsBitmap & aSource | The bitmap to be re-scaled. |
CFbsBitmap & aSourceMask | The mask bitmap that provides the transparency data. |
TOptions aOptions = EHighQualityQuantization | Scaling and color quantization options. |
IMPORT_C void | Scale | ( | TRequestStatus * | aStatus, |
CFbsBitmap & | aDestination, | |||
CPalette & | aPalette, | |||
TBool | aMaintainAspectRatio = 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.
TRequestStatus * aStatus | Request status to signal when scaling is complete. |
CFbsBitmap & aDestination | The destination bitmap. (EColor256) |
CPalette & aPalette | The output palette. |
TBool aMaintainAspectRatio = ETrue | ETrue - 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. |
IMPORT_C void | ThresholdScale | ( | TRequestStatus * | aStatus, |
CFbsBitmap & | aDestination, | |||
CPalette & | aPalette, | |||
TUint8 | aTransparencyThreshold, | |||
TBool | aMaintainAspectRatio = 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.
TRequestStatus * aStatus | Request status to signal when scaling is complete. |
CFbsBitmap & aDestination | The destination bitmap. (EColor256) |
CPalette & aPalette | The output palette. |
TUint8 aTransparencyThreshold | The transparency level used to determine if destination pixels are transparent. |
TBool aMaintainAspectRatio = ETrue | ETrue - 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. |
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)
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. |