epoc32/include/bitmaptransforms.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 bitmaptransforms.h
     1 // Copyright (c) 2002-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // This is the public client API for the BitmapTransforms Library
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __BITMAPTRANSFORMS_H__
       
    19 #define __BITMAPTRANSFORMS_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <fbs.h>
       
    23 #include <bitdev.h>
       
    24 
       
    25 class CBitmapRotatorBody;
       
    26 class CBitmapScalerBody;
       
    27 class CBitmapConverterBody;
       
    28 
       
    29 
       
    30 /**
       
    31 The public API for clients to call the BitmapTransforms Library bitmap rotation.
       
    32 
       
    33 @publishedAll
       
    34 @released
       
    35 */
       
    36 
       
    37 //The public API for clients to call the BitmapTransforms Library bitmap rotation
       
    38 class CBitmapRotator : public CBase
       
    39 {
       
    40 public:
       
    41 
       
    42 	/**
       
    43 	The enumeration provides a set of supported rotation and mirror angles.
       
    44 	TRotationAngle is an enumeration within the namespace CBitmapRotator.
       
    45 	*/
       
    46 	enum TRotationAngle
       
    47 		{
       
    48 		/** Used to rotate a bitmap 90 degrees clockwise.
       
    49 		*/
       
    50 		ERotation90DegreesClockwise,
       
    51 		/** Used to rotate a bitmap 180 degrees clockwise.
       
    52 		*/
       
    53 		ERotation180DegreesClockwise,
       
    54 		/** Used to rotate a bitmap 270 degrees clockwise.
       
    55 		*/
       
    56 		ERotation270DegreesClockwise,
       
    57 		/** Used to mirror a bitmap about the horizontal axis.
       
    58 		*/
       
    59 		EMirrorHorizontalAxis,
       
    60 		/** Used to mirror a bitmap about the vertical axis.
       
    61 		*/
       
    62 		EMirrorVerticalAxis
       
    63 		};
       
    64 
       
    65 public:
       
    66 	IMPORT_C static CBitmapRotator* NewL();
       
    67 	IMPORT_C ~CBitmapRotator();
       
    68 	IMPORT_C void Rotate(TRequestStatus* aRequestStatus, CFbsBitmap& aSrcBitmap, CFbsBitmap& aTgtBitmap, TRotationAngle aAngle);
       
    69 	IMPORT_C void Rotate(TRequestStatus* aRequestStatus, CFbsBitmap& aBitmap, TRotationAngle aAngle);
       
    70 	IMPORT_C TInt CustomCommand(TUid aUid, TAny* aParam);
       
    71 	IMPORT_C void Cancel();
       
    72 
       
    73 private:
       
    74 	CBitmapRotator();
       
    75 	void ConstructL();
       
    76 
       
    77 private:
       
    78 	CBitmapRotatorBody	*iBody;
       
    79 };
       
    80 
       
    81 /**
       
    82 The public API for clients to call the BitmapTransforms Library bitmap scaling.
       
    83 
       
    84 @publishedAll
       
    85 @released
       
    86 */
       
    87 
       
    88 //The public API for clients to call the BitmapTransforms library bitmap scaling
       
    89 class CBitmapScaler : public CBase
       
    90 {
       
    91 public:
       
    92 	/** An enumeration to specify the level of quality algorithm.
       
    93 	*/
       
    94 	enum TQualityAlgorithm
       
    95 		{
       
    96 		/**
       
    97 		Fastest/lowest quality
       
    98 		*/
       
    99 		EMinimumQuality,
       
   100 		/**
       
   101 		Middle range speed/middle range quality
       
   102 		*/
       
   103 		EMediumQuality,
       
   104 		/**
       
   105 		Slowest/highest quality
       
   106 		*/
       
   107 		EMaximumQuality
       
   108 		};
       
   109 
       
   110 public:
       
   111 	IMPORT_C static CBitmapScaler* NewL();
       
   112 	IMPORT_C ~CBitmapScaler();
       
   113 	IMPORT_C void Scale(TRequestStatus* aRequestStatus, CFbsBitmap& aSrcBitmap, CFbsBitmap& aTgtBitmap, TBool aMaintainAspectRatio = ETrue);
       
   114 	IMPORT_C void Scale(TRequestStatus* aRequestStatus, CFbsBitmap& aBitmap, const TSize& aDestinationSize, TBool aMaintainAspectRatio = ETrue);
       
   115 	IMPORT_C void Cancel();
       
   116 	IMPORT_C TInt CustomCommand(TUid aUid, TAny* aParam);
       
   117     inline TInt DisablePostProcessing( TBool aState );
       
   118 	inline TInt UseLowMemoryAlgorithm( TBool aState );
       
   119 	inline TInt SetQualityAlgorithm( TQualityAlgorithm aQualityLevel );
       
   120 private:
       
   121 	CBitmapScaler();
       
   122 	void ConstructL();
       
   123 
       
   124 private:
       
   125 	CBitmapScalerBody* iBody;
       
   126 	};
       
   127 
       
   128 #include <bitmaptransforms.inl>
       
   129 
       
   130 #endif //__BITMAPTRANSFORMS_H__