|
1 /* |
|
2 * Copyright (c) 2010 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: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __GIFANIMATOR_H__ |
|
21 #define __GIFANIMATOR_H__ |
|
22 |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 #include "sgengine.h" |
|
26 |
|
27 |
|
28 |
|
29 class CImageEncoder; |
|
30 |
|
31 class MDialogCallback |
|
32 { |
|
33 public: |
|
34 virtual void DialogDismissedL( TInt aButtonId ) = 0; |
|
35 }; |
|
36 |
|
37 |
|
38 class CGifAnimator : public CBase |
|
39 { |
|
40 public: |
|
41 static int CreateGifAnimation(const TDesC& aFileName, TSize aDimensions, CVideoFrameArray* aVideoFrameArray, EngineWrapper& aEngineWrapper); |
|
42 ~CGifAnimator(); |
|
43 |
|
44 private: |
|
45 CGifAnimator(); |
|
46 void StartL(const TDesC& aFileName, const TSize& aDimensions, CVideoFrameArray* aVideoFrameArray, EngineWrapper& aEngineWrapper); |
|
47 void WriteHeaderL(const TSize& aDimensions); |
|
48 void WriteGraphicControlL(const TVideoFrame& aFrame); |
|
49 void WriteImageDescriptorL(const TVideoFrame& aFrame); |
|
50 CFbsBitmap* GetBitmapLC(TVideoFrame& aFrame, const TSize& aDimensions); |
|
51 void WriteRasterDataL(CFbsBitmap* aBitmap); |
|
52 void WriteFooterL(); |
|
53 void FinishL(); |
|
54 void WriteInt8L(TInt aValue); |
|
55 void WriteInt16L(TInt aValue); |
|
56 |
|
57 |
|
58 |
|
59 private: |
|
60 RFs iFs; |
|
61 RFile iOutFile; |
|
62 CImageEncoder* iImageEncoder; |
|
63 HBufC8* iGIFImageData; |
|
64 |
|
65 }; |
|
66 |
|
67 |
|
68 |
|
69 #endif // __GIFANIMATOR_H__ |