|
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 __IEIMAGEDECODER_H__ |
|
19 #define __IEIMAGEDECODER_H__ |
|
20 |
|
21 // Include files |
|
22 #include <e32base.h> |
|
23 #include <f32file.h> |
|
24 #include <fbs.h> |
|
25 #include <ImageConversion.h> |
|
26 #include <IclExtJpegApi.h> |
|
27 |
|
28 #include "IEImage.h" |
|
29 |
|
30 class MDecodingObserver |
|
31 { |
|
32 public: |
|
33 //virtual void YuvImageReadyL(TInt aError) = 0; |
|
34 virtual void BitmapReadyL(TInt aError) = 0; |
|
35 }; |
|
36 |
|
37 // Forward class declarations |
|
38 |
|
39 // Class declaration |
|
40 class CIEImageDecoder : CActive |
|
41 { |
|
42 public: |
|
43 static CIEImageDecoder* NewL(RFs& aFileServer, MDecodingObserver& aObserver); |
|
44 ~CIEImageDecoder(); |
|
45 |
|
46 private: |
|
47 void ConstructL(); |
|
48 CIEImageDecoder(RFs& aFileServer, MDecodingObserver& aObserver); |
|
49 |
|
50 public: // From CAtive |
|
51 void RunL() ; |
|
52 void DoCancel(); |
|
53 |
|
54 public: |
|
55 void GetImageSizeL(const TFileName aFileName, TSize& aSize); |
|
56 void ConvertJpeg2YuvL(const TDesC& aSourceFile, |
|
57 HBufC8& aBuffer, |
|
58 const TImageForamt aImageFormat); |
|
59 |
|
60 void ConvertJpeg2BitmapL(CFbsBitmap& aDestBitmap, TDesC8& aSourceData); |
|
61 |
|
62 TPtr8 GetVisualFrame(); |
|
63 |
|
64 void CancelDecoding(); |
|
65 |
|
66 private: // Data |
|
67 RFs& iFileServer; |
|
68 MDecodingObserver& iObserver; |
|
69 CImageDecoder* iImageDecoder; |
|
70 CExtJpegDecoder* iExtImageDecoder; |
|
71 CVisualFrame* iVisualFrame; |
|
72 TBool iDecoderBusy; |
|
73 TBool iDecode2Yuv; |
|
74 TBool iDecode2Bitmap; |
|
75 TPtr8 iSrcPtr; |
|
76 |
|
77 TUint8* iBufU; |
|
78 TInt iNumOfBitmaps; |
|
79 }; |
|
80 |
|
81 #endif // __IEIMAGEDECODER_H__ |