|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @publishedPartner |
|
19 @prototype |
|
20 */ |
|
21 |
|
22 #ifndef MCAMERAHISTOGRAM_H |
|
23 #define MCAMERAHISTOGRAM_H |
|
24 |
|
25 #include <ecam/camerahistogram.h> |
|
26 #include <ecam/ecamcommonuidif.hrh> |
|
27 |
|
28 /** |
|
29 This is the UID which is used to obtain the MCameraHistogram interface, |
|
30 via a call to CCamera::CustomInterface(), which provides implementation of the M-class interface. |
|
31 |
|
32 @see KECamMCameraHistogramUidValue |
|
33 @deprecated use KECamMCameraV2HistogramUid |
|
34 */ |
|
35 static const TUid KECamMCameraHistogramUid = {KECamMCameraHistogramUidValue}; |
|
36 |
|
37 /** |
|
38 This is the UID which is used to obtain the MCameraV2Histogram interface, |
|
39 via a call to CCamera::CustomInterface(), which provides implementation of the M-class interface. |
|
40 |
|
41 @see KECamMCameraV2HistogramUidValue |
|
42 */ |
|
43 static const TUid KECamMCameraV2HistogramUid = {KECamMCameraV2HistogramUidValue}; |
|
44 |
|
45 /** |
|
46 This is a mixin class to be implemented by providers of the extension API for the camera histogram. |
|
47 |
|
48 Histograms can be sent to the client or directly displayed on the viewfinder. |
|
49 |
|
50 @note This class is intended for sub classing by licensees only. |
|
51 |
|
52 @see CCamera::CCameraHistogram |
|
53 |
|
54 @publishedPartner |
|
55 @deprecated use MCameraV2Histogram |
|
56 */ |
|
57 class MCameraHistogram |
|
58 { |
|
59 |
|
60 public: |
|
61 /** |
|
62 @deprecated use void MCameraV2Histogram::GetSupportedHistogramsL(TUint& aSupportedHistogramType) |
|
63 |
|
64 Gets a list of the types of histograms the ECam implementation supports. |
|
65 |
|
66 @return A bit field representing all supported types of histograms. |
|
67 |
|
68 @see CCamera::CCameraHistogram::THistogramType |
|
69 */ |
|
70 virtual TUint32 SupportedHistograms()=0; |
|
71 |
|
72 /** |
|
73 @deprecated use void MCameraV2Histogram::PrepareClientHistogramL |
|
74 |
|
75 Request to prepare a non direct histogram. |
|
76 |
|
77 @note A direct histogram is directly embedded into the viewfinder. |
|
78 If a non direct histogram is requested the histogram data will be passed to the camera client. |
|
79 |
|
80 @param aType |
|
81 The type of histogram to be prepared. This must be one of the supported histogram types returned by |
|
82 SupportedHistograms(). |
|
83 |
|
84 @leave KErrNotSupported if the histogram type supplied in aType is not supported. |
|
85 |
|
86 @return An integer value which is the handle of the histogram on the ECam implementation. |
|
87 This value must be passed to other API functions when requesting operations |
|
88 involving this particular histogram. |
|
89 |
|
90 @see PrepareDSAHistogramL |
|
91 */ |
|
92 virtual TUint PrepareHistogramL(CCamera::CCameraHistogram::THistogramType aType)=0; |
|
93 |
|
94 /** |
|
95 @deprecated use void MCameraV2Histogram::PrepareDirectHistogramL |
|
96 |
|
97 Request to prepare a direct histogram. |
|
98 |
|
99 @note A direct histogram is directly embedded into the viewfinder. |
|
100 |
|
101 @param aType |
|
102 The type of histogram to be prepared. This must be one of the supported histogram types returned by |
|
103 SupportedHistograms(). |
|
104 @param aPosition |
|
105 The position on the screen (in pixels) where the histogram is to be displayed. |
|
106 @param aSize |
|
107 The size of histogram in pixels. |
|
108 @param aColor |
|
109 The colour and alpha blending with which the histogram will be displayed. |
|
110 |
|
111 @leave KErrNotSupported if the histogram type supplied in aType is not supported. |
|
112 |
|
113 @return An integer value which is the handle of the histogram on the ECam implementation. |
|
114 This value must be passed to other API functions when requesting operations |
|
115 involving this particular histogram. |
|
116 |
|
117 @see PrepareHistogramL |
|
118 */ |
|
119 virtual TUint PrepareDSAHistogramL(CCamera::CCameraHistogram::THistogramType aType, const TPoint& aPosition, const TSize& aSize, const TRgb& aColor)=0; |
|
120 |
|
121 /** |
|
122 @deprecated use void MCameraV2Histogram::StartHistogram() |
|
123 |
|
124 Request to start getting histogram notifications. |
|
125 |
|
126 @param aHistHandle |
|
127 The handle identifying the histogram on the ECam implementation. |
|
128 |
|
129 @leave KErrArgument if aHistHandle is out of range; also any system wide error. |
|
130 */ |
|
131 virtual void StartHistogramL(TUint aHistHandle)=0; |
|
132 |
|
133 /** |
|
134 @deprecated use void MCameraV2Histogram::StopHistogram() |
|
135 |
|
136 Request to stop getting histogram notifications. |
|
137 |
|
138 @param aHistHandle |
|
139 The handle identifying the histogram on the ECam implementation. |
|
140 |
|
141 @leave KErrArgument if aHistHandle is out of range; also any system wide error. |
|
142 */ |
|
143 virtual void StopHistogramL(TUint aHistHandle)=0; |
|
144 |
|
145 /** |
|
146 @deprecated only one histogram is available per buffer with the usage of MHistogramV2Buffer and MCameraV2Histogram. |
|
147 |
|
148 Destroys a histogram on the ECam implementation and releases its handle. |
|
149 |
|
150 @param aHistHandle |
|
151 The handle identifying the histogram on the ECam implementation. |
|
152 |
|
153 @leave KErrArgument if aHistHandle is out of range; also any system wide error. |
|
154 */ |
|
155 virtual void DestroyHistogramL(TUint aHistHandle)=0; |
|
156 |
|
157 /** |
|
158 @deprecated use void MCameraV2Histogram::Release(CCamera::CCameraV2Histogram *aHistogramHandle) |
|
159 |
|
160 Releases all the histogram handles created by this object and destroys them on the ECam implementation. |
|
161 This function is called from the destructor of CCamera::CCameraHistogram. |
|
162 */ |
|
163 virtual void Release()=0; |
|
164 |
|
165 /** |
|
166 @deprecated use void MCameraV2Histogram::GetHistogramStateL(TBool& aIsHistogramActive) |
|
167 |
|
168 Gets a list of all histograms that are active on the ECam implementation. |
|
169 A histogram is in an active state if StartHistogramL() has been called on it. |
|
170 |
|
171 @param aActiveHistograms |
|
172 Returned list of histogram handles for which StartHistogramL() has been called. |
|
173 |
|
174 @leave KErrNoMemory if the ECam implementation cannot add more histogram handles due to low memory; also any system wide error. |
|
175 */ |
|
176 virtual void GetActiveHistogramsL(RArray<TUint>& aActiveHistograms)=0; |
|
177 |
|
178 /** |
|
179 @deprecated use void MCameraV2Histogram::UpdateDirectHistogramPropertiesL |
|
180 |
|
181 Updates the properties of a direct histogram. |
|
182 |
|
183 @param aHistHandle |
|
184 The handle identifying the histogram on the ECam implementation. |
|
185 @param aPosition |
|
186 The new position on the screen (in pixels) where the histogram is to be displayed. |
|
187 @param aSize |
|
188 The new size of histogram in pixels. |
|
189 @param aColor |
|
190 The new colour and alpha blending with which the histogram will be displayed. |
|
191 |
|
192 @leave KErrArgument if aHistHandle is out of range; also any system wide error. |
|
193 */ |
|
194 virtual void UpdateDSAHistogramPropertiesL(TUint aHistHandle, const TPoint& aPosition, const TSize& aSize, const TRgb& aColor)=0; |
|
195 |
|
196 /** |
|
197 @deprecated use void MCameraV2Histogram::GetDirectHistogramPropertiesL |
|
198 |
|
199 Gets the properties of a direct histogram. |
|
200 |
|
201 @param aHistHandle |
|
202 The handle on the ECam implementation of the direct histogram whose properties are to be retrieved. |
|
203 @param aPosition |
|
204 A reference to a TPoint object that will receive the position (in pixels) of the histogram on the screen. |
|
205 @param aSize |
|
206 A reference to a TSize object that will receive the size of the histogram in pixels. |
|
207 @param aColor |
|
208 A reference to a TRgb object that will receive the colour and alpha blending of the histogram. |
|
209 |
|
210 @leave KErrArgument if aHistHandle is out of range; also any system wide error. |
|
211 */ |
|
212 virtual void GetDSAHistogramPropertiesL(TUint aHistHandle, TPoint& aPosition, TSize& aSize, TRgb& aColor)=0; |
|
213 |
|
214 /** |
|
215 @deprecated use MCaptureImageObserver, MCaptureVideoObserver, MDirectViewFinderObserver, and MClientViewFinderObserver |
|
216 which have callback functions which notify the client about availability of histogram data. These are sent when |
|
217 CCameraV2Histogram::StartHistogram() is called after CCameraV2Histogram::PrepareClientHistogramL(). If |
|
218 CCameraV2Histogram::PrepareClientHistogramL() is not called first then the callback returns KErrBadHandle. |
|
219 |
|
220 Returns to the client the histogram data for all the histograms generated by the ECam implementation. |
|
221 |
|
222 @leave KErrNoMemory if the ECam implementation has not been able to create the histogram buffer; |
|
223 also any system wide error. |
|
224 |
|
225 @return A reference to a histogram buffer which will contain the returned histogram data. |
|
226 */ |
|
227 virtual MHistogramBuffer& HistogramDataL()=0; |
|
228 |
|
229 /** |
|
230 @deprecated use MCaptureImageObserver, MCaptureVideoObserver, MDirectViewFinderObserver, and MClientViewFinderObserver |
|
231 which have callback functions which notify the client about availability of histogram data. These are sent when |
|
232 CCameraV2Histogram::StartHistogram() is called after CCameraV2Histogram::PrepareClientHistogramL(). If |
|
233 CCameraV2Histogram::PrepareClientHistogramL() is not called first then the callback returns KErrBadHandle. |
|
234 |
|
235 Returns the data for a single histogram from the ECam implementation to the client. |
|
236 |
|
237 @param aHistHandle |
|
238 The handle on the ECam implementation of the histogram whose data is to be retrieved. |
|
239 |
|
240 @leave KErrNoMemory if the ECam implementation has not been able to create the histogram buffer; |
|
241 also any system wide error. |
|
242 |
|
243 @return A reference to a histogram buffer which will contain the returned histogram data. |
|
244 */ |
|
245 virtual MHistogramBuffer& HistogramDataL(TUint aHistHandle)=0; |
|
246 }; |
|
247 |
|
248 /** |
|
249 This is a mixin class to be implemented by providers of the extension API for the camera v2 histogram. |
|
250 |
|
251 Histograms can be sent to the client or directly displayed on the screen. |
|
252 |
|
253 @note This class is intended for sub classing by licensees only. |
|
254 |
|
255 @see CCamera::CCameraV2Histogram |
|
256 |
|
257 @publishedPartner |
|
258 @prototype |
|
259 */ |
|
260 class MCameraV2Histogram |
|
261 { |
|
262 |
|
263 public: |
|
264 |
|
265 /** |
|
266 Releases the interface. |
|
267 |
|
268 @param aHistogramHandle |
|
269 The pointer to the histogram class object which would be destroyed by the client. |
|
270 */ |
|
271 virtual void Release(CCamera::CCameraV2Histogram* aHistogramHandle)=0; |
|
272 |
|
273 /** |
|
274 The pointer to the V2 Histogram class used to pass back to the client via observer callbacks when direct histogram |
|
275 gets displayed. Implementation is not supposed to not destroy this object. |
|
276 |
|
277 @param aHistogramHandle |
|
278 The pointer to the histogram class object. |
|
279 |
|
280 @see MCaptureImageObserver |
|
281 @see MDirectViewFinderObserver |
|
282 @see MClientViewFinderObserver |
|
283 */ |
|
284 virtual void SetHistogramHandle(CCamera::CCameraV2Histogram* aHistogramHandle)=0; |
|
285 |
|
286 /** |
|
287 Retrieves a list of the supported types of histograms. |
|
288 |
|
289 @param aSupportedHistogramType |
|
290 A reference to bit field representing the supported types of histograms as given by CCamera:: |
|
291 CCameraV2Histogram::THistogramType |
|
292 |
|
293 @leave May leave with any error code. |
|
294 |
|
295 @see CCamera::CCameraV2Histogram::THistogramType |
|
296 */ |
|
297 virtual void GetSupportedHistogramsL(TUint& aSupportedHistogramType) const =0; |
|
298 |
|
299 /** |
|
300 Informs whether or not the direct histogram is supported. |
|
301 |
|
302 @param aIsDirectHistogramSupported |
|
303 ETrue implies that direct histogram is supported. |
|
304 EFalse implies that direct histogram is not supported. |
|
305 |
|
306 @leave May leave with any error code. |
|
307 */ |
|
308 virtual void GetDirectHistogramSupportInfoL(TBool& aIsDirectHistogramSupported) const=0; |
|
309 |
|
310 /** |
|
311 Request to prepare a client based histogram. |
|
312 |
|
313 @note A direct histogram is directly embedded into the viewfinder. |
|
314 If a non direct histogram is requested the histogram data will be passed to the camera client. |
|
315 |
|
316 @param aType |
|
317 The type of histogram to be prepared. This must be one of the supported histogram types given by |
|
318 GetSupportedHistogramsL. |
|
319 |
|
320 @leave May leave with any error code. |
|
321 |
|
322 @note Each histogram object will either prepare direct histogram or client histogram. Preparing multiple histograms |
|
323 per object is an invalid case. |
|
324 |
|
325 @see PrepareDSAHistogramL |
|
326 */ |
|
327 virtual void PrepareClientHistogramL(CCamera::CCameraV2Histogram::THistogramType aType)=0; |
|
328 |
|
329 /** |
|
330 Prepares the direct histogram. |
|
331 |
|
332 @param aDirectHistogramParameters |
|
333 The parameters required to prepare the direct histogram. |
|
334 |
|
335 @leave May leave with any error code. |
|
336 |
|
337 @note Each histogram object will either prepare direct histogram or client histogram. Preparing multiple histograms |
|
338 per object is an invalid case. |
|
339 |
|
340 @see PrepareClientHistogramL |
|
341 */ |
|
342 virtual void PrepareDirectHistogramL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)=0; |
|
343 |
|
344 /** |
|
345 Update the parameters for the direct histogram. |
|
346 |
|
347 @param aDirectHistogramParameters |
|
348 The desired parameters which have to be used to update the direct histogram. |
|
349 |
|
350 @leave May leave with any error code. |
|
351 */ |
|
352 virtual void UpdateDirectHistogramPropertiesL(const CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters)=0; |
|
353 |
|
354 /** |
|
355 Retrieves the currently used parameters for the direct histogram. |
|
356 |
|
357 @param aDirectHistogramParameters |
|
358 Retrieves the parameters currently being used for the direct histogram. |
|
359 |
|
360 @leave May leave with any error code. |
|
361 */ |
|
362 virtual void GetDirectHistogramPropertiesL(CCamera::CCameraV2Histogram::TDirectHistogramParameters& aDirectHistogramParameters) const=0; |
|
363 |
|
364 /** |
|
365 Request to start getting histogram notifications. |
|
366 |
|
367 @note Histogram should have been prepared before calling this method. |
|
368 |
|
369 @note Histogram notifications are sent to the client by using relevant callbacks for image capture, video capture |
|
370 and viewfinders. |
|
371 |
|
372 @see MCaptureImageObserver |
|
373 @see MCaptureVideoObserver |
|
374 @see MDirectViewFinderObserver |
|
375 @see MClientViewFinderObserver |
|
376 */ |
|
377 virtual void StartHistogram()=0; |
|
378 |
|
379 /** |
|
380 Request to stop generating histogram. |
|
381 */ |
|
382 virtual void StopHistogram()=0; |
|
383 |
|
384 /** |
|
385 Informs whether the histogram is currently active or not. |
|
386 A histogram is in an active state if StartHistogram() has been called on it and has not been yet stopped. |
|
387 |
|
388 @param aIsHistogramActive |
|
389 ETrue indicates that the histogram is active. |
|
390 EFalse indicates that the histogram is inactive. |
|
391 |
|
392 @leave May leave with any error code. |
|
393 */ |
|
394 virtual void GetHistogramStateL(TBool& aIsHistogramActive) const=0; |
|
395 }; |
|
396 |
|
397 #endif // MCAMERAHISTOGRAM_H |