vtengines/videoteleng/Inc/Media/CVtEngImageScaler.h
changeset 0 ed9695c8bcbe
equal deleted inserted replaced
-1:000000000000 0:ed9695c8bcbe
       
     1 /*
       
     2 * Copyright (c) 2004-2006 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:  Scaler for bitmaps.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CVTENGIMAGESCALER_H
       
    21 #define CVTENGIMAGESCALER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "MVtEngImageScaler.h"
       
    25 #include <cvtimagescaler.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MVtEngScalerObserver;
       
    29 class CVtImageScaler;
       
    30 class CVtImageBitmap;
       
    31 
       
    32 /**
       
    33 * Image scaler implementation class.
       
    34 *
       
    35 *  @lib videoteleng.lib
       
    36 *  @since Series 60 2.8
       
    37 */
       
    38 NONSHARABLE_CLASS( CVtEngImageScaler ) : public CBase,
       
    39     public MVtImageScalerObserver,
       
    40     public MVtEngImageScaler
       
    41     {
       
    42     public: // constructor and destructor
       
    43 
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         * @param aObserver scaling finished callback.
       
    47         * @return scaler
       
    48         */
       
    49         static MVtEngImageScaler* NewL(
       
    50             MVtEngScalerObserver& aObserver );
       
    51 
       
    52         /**
       
    53         * Destructor
       
    54         */
       
    55         virtual ~CVtEngImageScaler();
       
    56 
       
    57     private: // constructor
       
    58         
       
    59         /**
       
    60         * C++ constructor.
       
    61         * @param aObserver scaling finished callback.
       
    62         */
       
    63         CVtEngImageScaler(
       
    64             MVtEngScalerObserver& aObserver );
       
    65 
       
    66 
       
    67         /**
       
    68         * Symbian constructor that may leave.
       
    69         */
       
    70         void ConstructL();
       
    71 
       
    72     public: // From MVtEngImageScaler.
       
    73 
       
    74         /**
       
    75         * @see MVtEngImageScaler.
       
    76         */
       
    77         virtual void ScaleL(
       
    78             TInt aSourceIndex );
       
    79 
       
    80         /**
       
    81         * @see MVtEngImageScaler
       
    82         */
       
    83         virtual TBool ConfigureL(
       
    84             TDisplayMode aDisplayMode,
       
    85             TSize aSize, 
       
    86             TInt aSourceHandle1,
       
    87             TInt aSourceHandle2 );
       
    88 
       
    89         /**
       
    90         * @see MVtEngImageScaler.
       
    91         */
       
    92         virtual void Release();
       
    93 
       
    94         /**
       
    95         * @see MVtEngImageScaler.
       
    96         */
       
    97         virtual TInt Cancel();
       
    98 
       
    99     public: // From MVtImageScalerObserver.
       
   100 
       
   101         /**
       
   102         * @ see MVtImageScalerObserver.
       
   103         */
       
   104         virtual void ScalingFinished( TInt aError );
       
   105 
       
   106     private:
       
   107         /**
       
   108         * EFirstBitmap 
       
   109         *  Use the first bitmap.
       
   110         * ESecondBitmap 
       
   111         *  Use the second bitmap.
       
   112         */
       
   113         enum 
       
   114 	        {
       
   115             EFirstBitmap  = 0,
       
   116             ESecondBitmap = 1
       
   117             };
       
   118 
       
   119         /**
       
   120         * Fetches the used scaling method from locally.
       
   121         * variated properties, and stores it into iScalingMethod.
       
   122         */
       
   123         void GetScalingMethodL();
       
   124 
       
   125     private:
       
   126 
       
   127         // Observer receiving scaled bitmaps.
       
   128         MVtEngScalerObserver& iObserver;
       
   129 
       
   130         // Actual component doing the scaling.
       
   131         CVtImageScaler* iVtScaler;
       
   132 
       
   133         // Target bitmaps.
       
   134         RPointerArray<CVtImageBitmap> iTargets;
       
   135 
       
   136         // Source bitmaps.
       
   137         RPointerArray<CVtImageBitmap> iSources;
       
   138 
       
   139         // Bitmap index in targets.
       
   140         TInt                iTargetBitmapInUse;
       
   141 
       
   142         // Display mode.
       
   143         TDisplayMode        iMode;
       
   144 
       
   145         // Scaled size.
       
   146         TSize               iSize;
       
   147 
       
   148         // Method of scaling
       
   149         CVtImageScaler::TQuality    iScalingMethod;
       
   150     };
       
   151 
       
   152 #endif  // CVTENGIMAGESCALER_H
       
   153 
       
   154 // End of File