|
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 __IEIMAGEENCODER_H__ |
|
19 #define __IEIMAGEENCODER_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 // Forward class declarations |
|
31 class MEncodingObserver |
|
32 { |
|
33 public: |
|
34 virtual void JpegImageReadyL(TInt aError) = 0; |
|
35 }; |
|
36 |
|
37 |
|
38 // Class declaration |
|
39 class CIEImageEncoder : CActive |
|
40 { |
|
41 public: |
|
42 static CIEImageEncoder* NewL(RFs& aFileServer, MEncodingObserver& aObserver); |
|
43 ~CIEImageEncoder(); |
|
44 |
|
45 private: |
|
46 void ConstructL(); |
|
47 CIEImageEncoder(RFs& aFileServer, MEncodingObserver& aObserver); |
|
48 |
|
49 public: |
|
50 void ConvertYuv2JpegL(HBufC8*& aDestBuffer, |
|
51 HBufC8& aSourceBuffer, |
|
52 const TSize aSize, |
|
53 const TImageForamt aFormat); |
|
54 |
|
55 void ConvertYuv2JpegL(TDesC& aFileName, |
|
56 HBufC8& aSourceBuffer, |
|
57 const TSize aSize, |
|
58 const TImageForamt aFormat); |
|
59 |
|
60 void CancelEncoding(); |
|
61 |
|
62 private: |
|
63 void SetJpegImageDataL(); |
|
64 |
|
65 public: // From CAtive |
|
66 void RunL() ; |
|
67 void DoCancel(); |
|
68 |
|
69 private: // Data |
|
70 RFs& iFileServer; |
|
71 MEncodingObserver& iObserver; |
|
72 |
|
73 CImageEncoder* iImageEncoder; |
|
74 CExtJpegEncoder* iExtImageEncoder; |
|
75 |
|
76 CVisualFrame* iVisualFrame; |
|
77 |
|
78 CFrameImageData* iFrameImageData; |
|
79 |
|
80 TBool iEncoderBusy; |
|
81 }; |
|
82 |
|
83 #endif // __IEIMAGEENCODER_H__ |