|
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 __IEBITMAPLOADER_H__ |
|
19 #define __IEBITMAPLOADER_H__ |
|
20 |
|
21 // Include files |
|
22 #include <f32file.h> |
|
23 #include <FBS.H> |
|
24 #include <ImageConversion.h> |
|
25 |
|
26 #include <IEEngine.h> |
|
27 #include "IEFileLoader.h" |
|
28 //#include "IEEngineImp.h" |
|
29 #include <iclexifimageframe.h> |
|
30 //#include <oommonitorsession.h> |
|
31 |
|
32 #define DECODE_FROM_BUFFER |
|
33 |
|
34 // Forward class declaration |
|
35 class CIEFileLoader; |
|
36 class CIEEngineUtils; |
|
37 |
|
38 class MBitmapLoaderObserver |
|
39 { |
|
40 public: |
|
41 virtual void BitmapsLoadedL(TInt aError) = 0; |
|
42 virtual CIEFileLoader* GetFileLoader() = 0; |
|
43 virtual TInt GetGleMaxRes() = 0; |
|
44 }; |
|
45 |
|
46 // Class declaration |
|
47 class CIEBitmapLoader : public CActive |
|
48 { |
|
49 public: |
|
50 static CIEBitmapLoader* NewL(RFs& aFileServer, MBitmapLoaderObserver& aBitmapLoaderObserver, RCriticalSection* aCritical); |
|
51 ~CIEBitmapLoader(); |
|
52 private: |
|
53 void ConstructL(); |
|
54 CIEBitmapLoader(RFs& aFileServer, MBitmapLoaderObserver& aBitmapLoaderObserver, RCriticalSection* aCritical); |
|
55 |
|
56 public: // From CActive |
|
57 void RunL(); |
|
58 void DoCancel(); |
|
59 TInt RunError(TInt aError); |
|
60 |
|
61 public: |
|
62 void CIEBitmapLoader::LoadBitmapsL(TInt aIndex, TThumbSize aThumbRes); |
|
63 void GetOneBitmapL(CImageData* aImageData, CFbsBitmap* aBitmap, TThumbSize aThumbRes); |
|
64 void CancelFullSizeLoading(); |
|
65 void SetImageDataMode(TImageArrayMode aMode); |
|
66 |
|
67 private: |
|
68 void TargetDecodingSize(TSize aTgtSize, TSize& aSrcSize); |
|
69 //TPtr8 LoadImageIntoMemoryLC(const TDesC& aFileName); |
|
70 void CropImageL(CFbsBitmap* aOutput, CFbsBitmap* aInput) const; |
|
71 |
|
72 |
|
73 private: //Data |
|
74 RFs& iFileServer; |
|
75 MBitmapLoaderObserver& iBitmapLoaderObserver; |
|
76 CImageDecoder* iImageDecoder; |
|
77 CJPEGExifDecoder* iExifDecoder; |
|
78 RCriticalSection* iCritical; |
|
79 TImageArrayMode iImageArrayMode; |
|
80 CImageData* iImageData; |
|
81 TBool iUseExifTn; |
|
82 HBufC8* iExifTn; |
|
83 CFbsBitmap* iExifBitmap; |
|
84 CFbsBitmap* iOutputBitmap; |
|
85 TUid decoderUid; |
|
86 TThumbSize iThumbRes; |
|
87 #ifdef DECODE_FROM_BUFFER |
|
88 HBufC8* iSourceData; |
|
89 #endif |
|
90 }; |
|
91 |
|
92 |
|
93 #endif // __IEBITMAPLOADER_H__ |