|
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: Camera Application Engine still image quality level and container |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CAESTILLQUALITYLEVELS_H |
|
21 #define CAESTILLQUALITYLEVELS_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <ecam.h> |
|
25 #include <e32base.h> |
|
26 #include <e32std.h> |
|
27 #include "CaeSdKeys.h" |
|
28 #include "CaeQualityLevels.h" |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 const TInt KCaeMaxStillQltyLevelCount = 6; |
|
33 |
|
34 const TInt KCaeImgWidthQQVGA = 160; |
|
35 const TInt KCaeImgHeightQQVGA = 120; |
|
36 |
|
37 const TInt KCaeImgWidthVGA = 640; |
|
38 const TInt KCaeImgHeightVGA = 480; |
|
39 |
|
40 |
|
41 // FORWARD DECLARATIONS |
|
42 class CStillQualityLevel; |
|
43 |
|
44 |
|
45 // CLASS DECLARATION |
|
46 |
|
47 /** |
|
48 * Camera Application Engine still image quality levels container. |
|
49 * |
|
50 */ |
|
51 NONSHARABLE_CLASS( CCaeStillQualityLevelsCont ) : public CCaeQualityLevelsCont |
|
52 { |
|
53 |
|
54 public: // Constructors and destructor |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 virtual ~CCaeStillQualityLevelsCont(); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 */ |
|
64 static CCaeStillQualityLevelsCont* NewL(); |
|
65 |
|
66 /** |
|
67 * Initializes quality levels to hardcoded default values. |
|
68 * @since 2.1 |
|
69 * @return The count of quality levels initialized |
|
70 */ |
|
71 TInt InitDefaultsL(); |
|
72 |
|
73 /** |
|
74 * Gets the quality level count. |
|
75 * @since 2.1 |
|
76 * @return Quality level count |
|
77 */ |
|
78 TInt Count() const; |
|
79 |
|
80 /** |
|
81 * Gets the specified quality level. |
|
82 * @since 2.1 |
|
83 * @param aIndex Quality level index |
|
84 * @return Still quality level |
|
85 */ |
|
86 CStillQualityLevel& At( |
|
87 TInt aIndex ) const; |
|
88 |
|
89 /** |
|
90 * Gets the Shared Data key of specified quality level. |
|
91 * @since 2.1 |
|
92 * @param aIndex Quality level index |
|
93 * @return Shared Data key |
|
94 */ |
|
95 const TDes& Key( |
|
96 TInt aIndex ) const; |
|
97 |
|
98 private: |
|
99 |
|
100 /** |
|
101 * C++ constructor. |
|
102 */ |
|
103 CCaeStillQualityLevelsCont(); |
|
104 |
|
105 /** |
|
106 * Symbian OS 2nd phase constructor that can leave. |
|
107 */ |
|
108 void ConstructL(); |
|
109 |
|
110 private: |
|
111 |
|
112 /** |
|
113 * Resizes quality level array. |
|
114 * @since 2.1 |
|
115 * @param aQualityLevelCount Quality level count for the new array |
|
116 * @return void |
|
117 */ |
|
118 void ResizeL( |
|
119 TInt aQualityLevelCount ); |
|
120 |
|
121 /** |
|
122 * Gets the quality level count Shared Data key. |
|
123 * @since 2.1 |
|
124 * @return Quality level count Shared Data key |
|
125 */ |
|
126 const TDesC& QltyLevelCountSdKey() const; |
|
127 |
|
128 private: // For Shared Data support. |
|
129 |
|
130 /** |
|
131 * Creates quality level string for SharedData Camera ini file. |
|
132 * @since 2.1 |
|
133 * @param aIndex Quality level index |
|
134 * @param aDefaultQualityLevel Output quality level string |
|
135 * @return void |
|
136 */ |
|
137 void CreateQualityLevelString( |
|
138 TInt aIndex, |
|
139 TDes& aDefaultQualityLevel ); |
|
140 |
|
141 /** |
|
142 * Parses quality level string to quality level object data. |
|
143 * @since 2.1 |
|
144 * @param aQualityLevelString Quality level string to parse |
|
145 * @param aIndex Quality level index |
|
146 * @return void |
|
147 */ |
|
148 void ParseQualityLevelFromStringL( |
|
149 const TDesC& qualityLevelString, |
|
150 TInt aIndex ); |
|
151 |
|
152 private: |
|
153 |
|
154 // Supported still capture quality levels. |
|
155 CArrayFixFlat<CStillQualityLevel>* iQualityLevels; |
|
156 |
|
157 // Quality level count Shared Data key. |
|
158 const TDesC& iQltyLevelCountSdKey; |
|
159 }; |
|
160 |
|
161 |
|
162 |
|
163 // CLASS DECLARATION |
|
164 |
|
165 /** |
|
166 * Camera Application Engine still image quality level. |
|
167 * |
|
168 */ |
|
169 NONSHARABLE_CLASS( CStillQualityLevel ) : public CQualityLevel |
|
170 { |
|
171 public: |
|
172 |
|
173 /** |
|
174 * Constructor. |
|
175 */ |
|
176 CStillQualityLevel(); |
|
177 |
|
178 /** |
|
179 * Destructor. |
|
180 */ |
|
181 virtual ~CStillQualityLevel(); |
|
182 |
|
183 public: |
|
184 |
|
185 // Still image frame size. |
|
186 TSize iFrameSize; |
|
187 |
|
188 // Still image output format. |
|
189 CCamera::TFormat iOutputFormat; |
|
190 |
|
191 // Still image compression quality. |
|
192 TInt iCompressionQuality; |
|
193 |
|
194 // Estimated size of an image in bytes. |
|
195 TInt iByteSize; |
|
196 }; |
|
197 |
|
198 #endif // CAESTILLQUALITYLEVELS_H |