Common/Inc/IEImageData.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 __IEIMAGEDATA_H__
       
    19 #define __IEIMAGEDATA_H__
       
    20 
       
    21 // Include files
       
    22 #include <e32base.h> 
       
    23 #include <IEImage.h>
       
    24 
       
    25 class HGridData
       
    26     {
       
    27 public:
       
    28     TBool       iCorrupted;
       
    29     float       iRotationAngle; // rotation angle of one image
       
    30     float       iTargetRotationAngle; // target rotation angle of one image
       
    31     float       iX, iY, iZ; // OpenGL coordinates
       
    32     float       iScale; // OpenGL iScale
       
    33     TUint       iGlLQ32TextIndex; // OpenGL 128x128 texture index
       
    34     TUint       iGlLQ128TextIndex; // OpenGL 128x128 texture index
       
    35     TUint       iGlHQ512TextIndex; // OpenGL 512x512 texture index
       
    36     TUint       iGlSuperHQTextIndex; // OpenGL 2048x2048 texture index
       
    37     
       
    38     // Returns opengl index for best quality image that has been loaded
       
    39     inline TUint BestImage(void)
       
    40         {
       
    41         if (iGlSuperHQTextIndex!=0)
       
    42             return iGlSuperHQTextIndex;
       
    43         if (iGlHQ512TextIndex!=0)
       
    44             return iGlHQ512TextIndex;
       
    45         if (iGlLQ128TextIndex!=0)
       
    46             return iGlLQ128TextIndex;
       
    47         if (iGlLQ32TextIndex!=0)
       
    48             return iGlLQ32TextIndex;
       
    49         return 0;
       
    50         }
       
    51     };
       
    52 
       
    53 
       
    54 class CImageData
       
    55     {
       
    56 public:
       
    57     IMPORT_C static CImageData* NewL(TUint32 aImagesReady = 0);
       
    58     IMPORT_C ~CImageData();
       
    59     
       
    60 protected:    
       
    61     TReal       iAspectRatio; 
       
    62     TSize       iSize;
       
    63     TTime       iFileTime, iCreatedTime;
       
    64     HBufC*      iPath;
       
    65     HBufC*      iFileName;
       
    66     TUint16     iImagesReady;
       
    67     TUint16     iOrientation;
       
    68     TInt        iNumberOfFaces;
       
    69 
       
    70     void ConstructL(TUint32 aImagesReady);
       
    71     TBool IsCreatedTimeSet() const;
       
    72     CImageData();
       
    73     
       
    74 public:    
       
    75     HGridData   iGridData;
       
    76     TInt        iPersonId;  // TODO temp solution, -1 = no person
       
    77     
       
    78     IMPORT_C void GetFileName(TFileName & aFullFileName, TThumbSize aSize) const;
       
    79     IMPORT_C void GetPath(TFileName & aPath) const;
       
    80     IMPORT_C void GetFileName(TFileName & aFileName) const;
       
    81     IMPORT_C void SetFileNameL(const TFileName & aFullFileName);
       
    82     IMPORT_C TBool IsImageReady(TThumbSize aSize) const;
       
    83     IMPORT_C void SetImageReady(TThumbSize aSize, TBool bReady);
       
    84     IMPORT_C const TReal GetAspectRatio() const;
       
    85     IMPORT_C void SetSize(const TSize aSize);
       
    86     IMPORT_C TSize GetSize() const;
       
    87     IMPORT_C const TTime & GetFileTime() const;
       
    88     IMPORT_C void SetFileTime(const TTime & aTime);
       
    89     IMPORT_C const TTime & GetCreatedTime() const;
       
    90     IMPORT_C void SetCreatedTime(const TTime & aTime);
       
    91     IMPORT_C TUint16 GetOrientation() const;
       
    92     IMPORT_C void SetOrientation(TUint16 aOrientation);
       
    93     IMPORT_C TInt GetNumberOfFaces() const;
       
    94     IMPORT_C void SetNumberOfFaces(TInt aValue);
       
    95     IMPORT_C TBool IsSamePath(CImageData& aImageData) const;
       
    96     };  
       
    97 
       
    98 #endif // __IEIMAGEDATA_H__