1 /* |
|
2 * Copyright (c) 2002 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: Still Image Decoder for Camera Application Engine |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CAESTILLDECODER_H |
|
21 #define CAESTILLDECODER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <s32file.h> |
|
26 #include <imageconversion.h> |
|
27 #include <ecam.h> |
|
28 |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Still decoder observer class. |
|
34 * User of CCaeStillDecoder class must derive from this interface. |
|
35 * |
|
36 * @lib CAESTILLCONVERTER.LIB |
|
37 * @since 2.1 |
|
38 */ |
|
39 class MCaeStillDecoderObserver |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * Called back by CCaeStillDecoder when it completes conversion (decoding) to CFbsBitmap image. |
|
44 * @since 2.1 |
|
45 * @param aImageData Source image (as JPEG) |
|
46 * @param aBitmap Converted Symbian OS bitmap image |
|
47 * @param aError Error code KErrNone to indicate success or a standard Symbian OS error code |
|
48 * @param aImageSize Decoded image size |
|
49 * @return void |
|
50 */ |
|
51 virtual void McaesdoCFbsBitmapImageReady( |
|
52 HBufC8* aImageData, |
|
53 CFbsBitmap* aBitmap, |
|
54 TInt aError, |
|
55 TInt aImageSize ) = 0; |
|
56 }; |
|
57 |
|
58 |
|
59 // CLASS DECLARATION |
|
60 |
|
61 /** |
|
62 * Still Decoder class. |
|
63 * Implements still image decoding for Camera Application Engine |
|
64 * using Symbian Image Conversion Library (ICL) |
|
65 * |
|
66 * @lib CAESTILLCONVERTER.LIB |
|
67 * @since 2.1 |
|
68 */ |
|
69 NONSHARABLE_CLASS( CCaeStillDecoder ) : public CCaeStillConverter |
|
70 { |
|
71 public: // Constructor and destructor |
|
72 /** |
|
73 * Two-phased constructor. |
|
74 */ |
|
75 IMPORT_C static CCaeStillDecoder* NewL(); |
|
76 |
|
77 /** |
|
78 * Destructor. |
|
79 */ |
|
80 IMPORT_C virtual ~CCaeStillDecoder(); |
|
81 |
|
82 public: // From CCaeStillConverter: |
|
83 |
|
84 void SetImageCodecL( |
|
85 TUid aCodecUid ); |
|
86 |
|
87 public: // New functions |
|
88 /** |
|
89 * Sets Still Decoder observer. |
|
90 * @since 2.1 |
|
91 * @param aObserver Still Decoder observer |
|
92 * @return void |
|
93 */ |
|
94 IMPORT_C void SetObserver( |
|
95 MCaeStillDecoderObserver* aObserver ); |
|
96 |
|
97 /** |
|
98 * Creates the CImageItem object, places it in the internal queue and |
|
99 * starts the memory image conversion where the memory image (e.g. JPEG) |
|
100 * is converted to bitmap. |
|
101 * @param aImageBuffer Memory image to convert. Ownership is given. |
|
102 * @param aTargetBitmapMode Target/destination bitmap color mode |
|
103 * @param aTargetBitmapSize Target/destination bitmap size without free scaling decoder |
|
104 * @param aFullyScaledTargetBitmapSize Target/destination bitmap size with free scaling decoder |
|
105 * @return void |
|
106 */ |
|
107 IMPORT_C void ConvertHBufC8ToCFbsBitmapL( |
|
108 HBufC8* aImageBuffer, |
|
109 TDisplayMode aTargetBitmapMode, |
|
110 const TSize& aTargetBitmapSize, |
|
111 const TSize& aFullyScaledTargetBitmapSize = TSize( 0, 0 ) ); |
|
112 |
|
113 /** |
|
114 * Destroys all allocations for decoding, as the images from the queue. |
|
115 * @return void |
|
116 */ |
|
117 IMPORT_C void Cleanup(); |
|
118 |
|
119 protected: // Constructors |
|
120 /** |
|
121 * C++ constructor. |
|
122 */ |
|
123 CCaeStillDecoder(); |
|
124 |
|
125 /** |
|
126 * Symbian 2nd phase constructor that can leave. |
|
127 */ |
|
128 void ConstructL(); |
|
129 |
|
130 private: // From CCaeStillConverter: |
|
131 |
|
132 /** |
|
133 * From CActive, implements cancellation of an outstanding request. |
|
134 * @return void |
|
135 */ |
|
136 void DoCancel(); |
|
137 |
|
138 protected: // From CCaeStillConverter |
|
139 |
|
140 void ConvertL(); |
|
141 |
|
142 void ConversionComplete( |
|
143 TInt aError ); |
|
144 |
|
145 private: // Data |
|
146 |
|
147 // Still Decoder observer. |
|
148 MCaeStillDecoderObserver* iObserver; |
|
149 |
|
150 // Pointer to ICL decoder object. |
|
151 CImageDecoder* iDecoder; |
|
152 |
|
153 // Pointer to decoded image. |
|
154 CFbsBitmap* iDecodedImage; |
|
155 |
|
156 // Class wide file server handle for file operations |
|
157 RFs iFs; |
|
158 }; |
|
159 |
|
160 |
|
161 #endif // CAESTILLDECODER_H |
|
162 |
|
163 |
|
164 // End of File |
|