AppInc/CDrawMagGlass.h
changeset 3 93fff7023be8
equal deleted inserted replaced
2:e1e28b0273b0 3:93fff7023be8
       
     1 /*
       
     2 * Copyright (c) 2009 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: Juha Kauppinen, Mika Hokkanen
       
    13 * 
       
    14 * Description: Photo Browser
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef DRAWMAGGLASS_H
       
    19 #define DRAWMAGGLASS_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <e32std.h>
       
    23 #include <e32base.h>
       
    24 #include "ImagicContainerBrowser.h"
       
    25 #include "CDrawOneByOne.h"
       
    26 
       
    27 #define VERTICES_PER_LINE 32
       
    28 
       
    29 // CLASS DECLARATION
       
    30 class CDrawOneByOne;
       
    31 
       
    32 
       
    33 /**
       
    34  *  CDrawMagGlass
       
    35  * 
       
    36  */
       
    37 class CDrawMagGlass : public CBase
       
    38     {
       
    39 public:
       
    40     // Constructors and destructor
       
    41 
       
    42     /**
       
    43      * Destructor.
       
    44      */
       
    45     ~CDrawMagGlass();
       
    46 
       
    47     /**
       
    48      * Two-phased constructor.
       
    49      */
       
    50     static CDrawMagGlass* NewL(CImagicContainerBrowser* aContainer, CDrawOneByOne* aDrawOneByOne);
       
    51 
       
    52     /**
       
    53      * Two-phased constructor.
       
    54      */
       
    55     static CDrawMagGlass* NewLC(CImagicContainerBrowser* aContainer, CDrawOneByOne* aDrawOneByOne);
       
    56 
       
    57 private:
       
    58 
       
    59     /**
       
    60      * Constructor for performing 1st stage construction
       
    61      */
       
    62     CDrawMagGlass();
       
    63 
       
    64     /**
       
    65      * EPOC default constructor for performing 2nd stage construction
       
    66      */
       
    67     void ConstructL(CImagicContainerBrowser* aContainer, CDrawOneByOne* aDrawOneByOne);
       
    68     void Interpolate(float &aValue, const float aTarget, const float aStep);
       
    69     
       
    70 public:
       
    71     void InitDrawMagGlass();
       
    72     void DrawMagGlass(const TSize &aScreenPhysicalSize, TReal aImageAspectRatio);
       
    73     TReal GetMagGlassZoomFactor();
       
    74     
       
    75 private:
       
    76     CImagicContainerBrowser* iContainer;
       
    77     CDrawOneByOne*           iDrawOneByOne;
       
    78     
       
    79     float                    iMagGlassZoomFactor;
       
    80     
       
    81     
       
    82     static const GLfixed iGlobalTexCoords[4*2];
       
    83     static GLfixed       iMagGlassVertices[VERTICES_PER_LINE*VERTICES_PER_LINE*3];
       
    84     static GLfixed       iMagGlassTex[VERTICES_PER_LINE*VERTICES_PER_LINE*2];
       
    85            
       
    86     static const TInt    iMagGlassTriCount;
       
    87     static GLushort      iMagGlassIndices[];
       
    88     };
       
    89 
       
    90 #endif // DRAWMAGGLASS_H