1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // This is the public client API for the GifScaler Library
18 #ifndef __GIFSCALER_H__
19 #define __GIFSCALER_H__
26 The public API for clients to call the GifScaler scaling and color quantization library.
31 class CGifScaler : public CBase
35 TOptions is an enumeration within the namespace CGifScaler
36 The enumeration provides a set of supported quantization levels:
37 (EHighQualityQuantization is the default setting as it provides the
38 best balance between quality and speed)
42 /** Provides the lowest quality, but also the fastest.
44 ELowQualityQuantization,
45 /** Provides medium quality quantization
47 EMediumQualityQuantization,
48 /** Provides high quality quantization
50 EHighQualityQuantization,
51 /** Provides the highest quality quantization, but is also the slowest.
53 EMaximumQualityQuantization
57 IMPORT_C static CGifScaler* NewL(CFbsBitmap& aSource, TOptions aOptions = EHighQualityQuantization);
58 IMPORT_C static CGifScaler* NewL(CFbsBitmap& aSource, CFbsBitmap& aSourceMask, TOptions aOptions = EHighQualityQuantization);
59 IMPORT_C ~CGifScaler();
61 // Scale source and mask -> 8bpp destination. (One of the palette indices is transparent, if a mask is supplied)
62 IMPORT_C void Scale(TRequestStatus* aStatus, CFbsBitmap& aDestination, CPalette& aPalette, TBool aMaintainAspectRatio = ETrue);
64 // Scale source and mask -> 8bpp destination. (As above, except that the transparency threshold must be specified)
65 IMPORT_C void ThresholdScale(TRequestStatus* aStatus, CFbsBitmap& aDestination, CPalette& aPalette, TUint8 aTransparencyThreshold, TBool aMaintainAspectRatio = ETrue);
68 IMPORT_C void Cancel();
72 void ConstructL(CFbsBitmap& aSource, CFbsBitmap* aSourceMask, TOptions aOptions);
79 #endif // __GIFSCALER_H__