epoc32/include/gifscaler.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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 "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // This is the public client API for the GifScaler Library
    15 // 
    16 //
    17 
    18 #ifndef __GIFSCALER_H__
    19 #define __GIFSCALER_H__
    20 
    21 #include <e32base.h>
    22 #include <fbs.h>
    23 
    24 
    25 /**
    26 The public API for clients to call the GifScaler scaling and color quantization library.
    27 
    28 @publishedAll
    29 @released
    30 */
    31 class CGifScaler : public CBase
    32 	{
    33 public:
    34 	/**
    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)
    39 	*/
    40 	enum TOptions
    41 		{
    42 		/** Provides the lowest quality, but also the fastest.
    43 		*/
    44 		ELowQualityQuantization,
    45 		/** Provides medium quality quantization
    46 		*/
    47 		EMediumQualityQuantization,
    48 		/** Provides high quality quantization
    49 		*/
    50 		EHighQualityQuantization,
    51 		/** Provides the highest quality quantization, but is also the slowest.
    52 		*/
    53 		EMaximumQualityQuantization
    54 		};
    55 
    56 public:
    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();
    60 
    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);
    63 
    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);
    66 
    67 	// Cancel scaling.
    68 	IMPORT_C void Cancel();
    69 
    70 private:
    71 	CGifScaler();
    72 	void ConstructL(CFbsBitmap& aSource, CFbsBitmap* aSourceMask, TOptions aOptions);
    73 
    74 private:
    75 	class CBody;
    76 	CBody* iBody;
    77 	};
    78 
    79 #endif // __GIFSCALER_H__