imagehandling_plat/image_handling_library_api/inc/MIHLScaler.h
changeset 0 2014ca87e772
equal deleted inserted replaced
-1:000000000000 0:2014ca87e772
       
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Pure virtual interface to bitmap scaler
       
    15 *              : using Font and Bitmap Server bitmaps.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef MIHLSCALER_H
       
    21 #define MIHLSCALER_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32std.h>
       
    25 
       
    26 // FORWARD DECLARATION
       
    27 class MIHLScaler;
       
    28 class MIHFilter;
       
    29 class CFbsBitmap;
       
    30 
       
    31 // FACTORY DECLARATION
       
    32 class IHLScaler
       
    33     {
       
    34     public:
       
    35 		
       
    36         /**
       
    37         * Create new MIHLScaler instance.
       
    38         * @since 3.0
       
    39 		* @param aOptions Special options for bitmap scaling. Use MIHLScaler::TOptions values.
       
    40 		* @return New scaler instance.
       
    41 		*/
       
    42         IMPORT_C static MIHLScaler* CreateL( const TUint32 aOptions = 0 );
       
    43 	};
       
    44 
       
    45 // CLASS DECLARATION
       
    46 /**
       
    47 *  MIHLScaler
       
    48 *
       
    49 *  Pure virtual interface to bitmap scaler
       
    50 *  using Font and Bitmap Server bitmaps.
       
    51 *
       
    52 *  If interface needs to be pushed into CleanupStack,
       
    53 *  remember to use CleanupStackDeletePushL() function!
       
    54 *  DO NOT USE CleanupStack::PushL()!!
       
    55 *
       
    56 *  @lib IHL.lib
       
    57 *  @since 3.0
       
    58 */
       
    59 class MIHLScaler
       
    60     {
       
    61     public:
       
    62 
       
    63         /**
       
    64         * Virtual destructor.
       
    65 		*/
       
    66         virtual ~MIHLScaler() {}
       
    67 
       
    68 	public:
       
    69 
       
    70 		/**
       
    71 		* Flags to control scaler functionality.
       
    72 		* These can be combined using an OR operation.
       
    73 		* @since 3.0
       
    74 		*/
       
    75 		enum TOptions
       
    76 			{
       
    77 			EOptionUseBilinearInterpolation	= 0x01,
       
    78 			};
       
    79 
       
    80     public:
       
    81 
       
    82         /**
       
    83         * Scale rectangle from source bitmap to a rectangle
       
    84 		* in destination bitmap. Scaled area can be also
       
    85 		* rotated and/or mirrored during process.
       
    86 		*
       
    87 		* Rotating is done by defining SOURCE rectangle
       
    88 		* topleft and bottomright corners in following way:
       
    89 		*
       
    90 		* No rotate:  tl-----    90 degree:   -----tl
       
    91 		*             |      |               |      |
       
    92 		*             |      |               |      |
       
    93 		*              -----br               br-----
       
    94 		*
       
    95 		* 180 degree: br-----    270 degree:  -----br
       
    96 		*             |      |               |      |
       
    97 		*             |      |               |      |
       
    98 		*              -----tl               tl-----
       
    99 		*
       
   100   		* Mirroring is done by defining DESTINATION rectangle
       
   101 		* topleft and bottomright corners in following way:
       
   102 		*
       
   103 		* No mirroring:         tl-----
       
   104 		*                       |      |
       
   105 		*                       |      |
       
   106 		*                        -----br
       
   107 		*
       
   108 		* X-axis mirroring:      -----tl
       
   109 		*                       |      |
       
   110 		*                       |      |
       
   111 		*                       br-----
       
   112 		*
       
   113 		* Y-axis mirroring:      -----br
       
   114 		*                       |      |
       
   115 		*                       |      |
       
   116 		*                       tl-----
       
   117         *
       
   118 		* X and Y-axis          br-----
       
   119 		* mirroring:            |      |
       
   120 		*                       |      |
       
   121 		*                        -----tl
       
   122 		*
       
   123         * @since 3.0
       
   124         * @param aStatus Process request status reference.
       
   125         * @param aSrcBitmap Source bitmap reference.
       
   126         * @param aSrcRect Rectangle that is processed from source bitmap.
       
   127         * @param aDstBitmap Destination bitmap reference.
       
   128 		*                   If destination bitmap has null handle,
       
   129 		*                   processor will create new bitmap using size of
       
   130 		*                   destination rectangle.
       
   131         * @param aDstRect Rectangle that is filled in destination bitmap.
       
   132 		* @return Return system wide error codes:
       
   133 		*         KerrArgument - rectangles are outside of bitmap area.
       
   134 		*                      - source bitmap is empty (handle is null).
       
   135 		*                      - destination bitmap displaymode differs
       
   136 		*                        from source bitmap displaymode.
       
   137 		*         KErrBusy     - processor has request pending already.
       
   138         */
       
   139 		virtual TInt Scale( TRequestStatus& aStatus,
       
   140 							const CFbsBitmap& aSrcBitmap,
       
   141 							const TRect& aSrcRect,
       
   142 							CFbsBitmap& aDstBitmap,
       
   143 							const TRect& aDstRect ) = 0;
       
   144 
       
   145         /**
       
   146         * Check if processor has request pending.
       
   147         * @since 3.0
       
   148 		* @return ETrue if request is pending, EFalse if not.
       
   149         */
       
   150 		virtual TBool IsBusy() const = 0;
       
   151 
       
   152         /**
       
   153         * Cancel pending request.
       
   154 		* If not active, method does nothing.
       
   155         * @since 3.0
       
   156         */
       
   157 		virtual void CancelProcess() = 0;
       
   158 
       
   159         /**
       
   160         * Set filter.
       
   161 		* For future use, not used currently!
       
   162         * @since 3.0
       
   163         */
       
   164 		virtual void SetFilter( MIHFilter* aFilter ) = 0;
       
   165     };
       
   166 
       
   167 #endif // MIHLSCALER_H
       
   168 
       
   169 // End of File