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.
williamr@2
     1
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
// This is the public client API for the GifScaler Library
williamr@2
    15
// 
williamr@2
    16
//
williamr@2
    17
williamr@2
    18
#ifndef __GIFSCALER_H__
williamr@2
    19
#define __GIFSCALER_H__
williamr@2
    20
williamr@2
    21
#include <e32base.h>
williamr@2
    22
#include <fbs.h>
williamr@2
    23
williamr@2
    24
williamr@2
    25
/**
williamr@2
    26
The public API for clients to call the GifScaler scaling and color quantization library.
williamr@2
    27
williamr@2
    28
@publishedAll
williamr@2
    29
@released
williamr@2
    30
*/
williamr@2
    31
class CGifScaler : public CBase
williamr@2
    32
	{
williamr@2
    33
public:
williamr@2
    34
	/**
williamr@2
    35
	TOptions is an enumeration within the namespace CGifScaler
williamr@2
    36
	The enumeration provides a set of supported quantization levels:
williamr@2
    37
	(EHighQualityQuantization is the default setting as it provides the
williamr@2
    38
	best balance between quality and speed)
williamr@2
    39
	*/
williamr@2
    40
	enum TOptions
williamr@2
    41
		{
williamr@2
    42
		/** Provides the lowest quality, but also the fastest.
williamr@2
    43
		*/
williamr@2
    44
		ELowQualityQuantization,
williamr@2
    45
		/** Provides medium quality quantization
williamr@2
    46
		*/
williamr@2
    47
		EMediumQualityQuantization,
williamr@2
    48
		/** Provides high quality quantization
williamr@2
    49
		*/
williamr@2
    50
		EHighQualityQuantization,
williamr@2
    51
		/** Provides the highest quality quantization, but is also the slowest.
williamr@2
    52
		*/
williamr@2
    53
		EMaximumQualityQuantization
williamr@2
    54
		};
williamr@2
    55
williamr@2
    56
public:
williamr@2
    57
	IMPORT_C static CGifScaler* NewL(CFbsBitmap& aSource, TOptions aOptions = EHighQualityQuantization);
williamr@2
    58
	IMPORT_C static CGifScaler* NewL(CFbsBitmap& aSource, CFbsBitmap& aSourceMask, TOptions aOptions = EHighQualityQuantization);
williamr@2
    59
	IMPORT_C ~CGifScaler();
williamr@2
    60
williamr@2
    61
	// Scale source and mask -> 8bpp destination. (One of the palette indices is transparent, if a mask is supplied)
williamr@2
    62
	IMPORT_C void Scale(TRequestStatus* aStatus, CFbsBitmap& aDestination, CPalette& aPalette, TBool aMaintainAspectRatio = ETrue);
williamr@2
    63
williamr@2
    64
	// Scale source and mask -> 8bpp destination. (As above, except that the transparency threshold must be specified)
williamr@2
    65
	IMPORT_C void ThresholdScale(TRequestStatus* aStatus, CFbsBitmap& aDestination, CPalette& aPalette, TUint8 aTransparencyThreshold, TBool aMaintainAspectRatio = ETrue);
williamr@2
    66
williamr@2
    67
	// Cancel scaling.
williamr@2
    68
	IMPORT_C void Cancel();
williamr@2
    69
williamr@2
    70
private:
williamr@2
    71
	CGifScaler();
williamr@2
    72
	void ConstructL(CFbsBitmap& aSource, CFbsBitmap* aSourceMask, TOptions aOptions);
williamr@2
    73
williamr@2
    74
private:
williamr@2
    75
	class CBody;
williamr@2
    76
	CBody* iBody;
williamr@2
    77
	};
williamr@2
    78
williamr@2
    79
#endif // __GIFSCALER_H__