|
1 // Copyright (c) 2007-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 #ifndef ECAMVIEWFINDER_H |
|
22 #define ECAMVIEWFINDER_H |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <gdi.h> |
|
26 #include <ecamadvsettings.h> |
|
27 |
|
28 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
29 #include <ecamviewfinderdef.h> |
|
30 #else |
|
31 #include <ecamadvsettingsuidsconst.hrh> |
|
32 #include <ecamconst.h> |
|
33 #endif |
|
34 |
|
35 class MCameraViewFinder; |
|
36 class MCameraV2DirectViewFinder; |
|
37 class MCameraClientViewFinder; |
|
38 |
|
39 class MCameraDirectSnapshot; |
|
40 |
|
41 class MHistogramV2Buffer; |
|
42 |
|
43 /** |
|
44 Specific handle used to refer to viewfinder which is started using CCamera methods. |
|
45 */ |
|
46 static const TInt KECamDefaultViewFinderHandle = 0; |
|
47 |
|
48 /** |
|
49 The current Version of the TDirectSnapshotParameters class. |
|
50 */ |
|
51 static const TUint KECamDirectSnapshotParametersCurrentVersion = 1; |
|
52 |
|
53 /** |
|
54 UID used to identify the CCameraV2DirectViewFinder API. |
|
55 |
|
56 @see CCamera::CCameraV2DirectViewFinder |
|
57 */ |
|
58 static const TUid KECamV2DirectViewFinderUid = {KECamV2DirectViewFinderUidValue}; |
|
59 |
|
60 /** |
|
61 UID used to identify the CCameraClientViewFinder API. |
|
62 |
|
63 @see CCamera::CCameraClientViewFinder |
|
64 */ |
|
65 static const TUid KECamClientViewFinderUid = {KECamClientViewFinderUidValue}; |
|
66 |
|
67 /** |
|
68 UID used to identify the CCamera::CCameraDirectSnapshot API. |
|
69 This is the UID which is used to obtain the CCameraDirectSnapshot interface, |
|
70 via a call to CCamera::CustomInterface(). |
|
71 |
|
72 @see KECamDirectSnapshotUidValue |
|
73 @see CCamera::CCameraDirectSnapshot |
|
74 |
|
75 @publishedPartner |
|
76 @prototype |
|
77 */ |
|
78 static const TUid KECamDirectSnapshotUid = {KECamDirectSnapshotUidValue}; |
|
79 |
|
80 /** |
|
81 A mixin class to be implemented by the client in order to use the V2 direct view finder API CCameraV2DirectViewFinder. The |
|
82 derived class methods are called by the implementation when the direct view finder operations are ready to be notified |
|
83 accordingly. Implementation shall keep track of CCameraV2DirectViewFinder object deletion. It has to ensure that a callback |
|
84 is not send should the client destroy the particular CCameraV2DirectViewFinder class object when the callback is queued to |
|
85 be send across. Ownership of CCameraV2DirectViewFinder is retained by the client. |
|
86 |
|
87 @see CCamera::CCameraV2DirectViewFinder |
|
88 */ |
|
89 class MDirectViewFinderObserver |
|
90 { |
|
91 public: |
|
92 /** |
|
93 Implementation sends this callback in order to notify the client when the first direct viewfinder frame gets displayed |
|
94 after starting/resuming a particular direct viewfinder. |
|
95 |
|
96 @param aDirectViewFinderHandle |
|
97 Reference to CCameraV2DirectViewFinder class object which refers a particular direct viewfinder. |
|
98 |
|
99 @param aErrorCode |
|
100 Appropriate error code. |
|
101 */ |
|
102 virtual void DirectViewFinderFirstFrameDisplayed(CCamera::CCameraV2DirectViewFinder& aDirectViewFinderHandle, TInt aErrorCode)=0; |
|
103 |
|
104 /** |
|
105 Implementation sends this callback in order to notify the client when the direct histogram data gets displayed on the |
|
106 screen for the first time after starting/resuming a particular direct viewfinder. If a call to CCameraV2Histogram:: |
|
107 StartHistogram() is made without a previous successful call to CCameraV2Histogram::PrepareDirectHistogramL() then the |
|
108 callback returns KErrBadHandle. |
|
109 |
|
110 @param aDirectViewFinderHandle |
|
111 Reference to CCameraV2DirectViewFinder class object which refers a particular direct viewfinder for which the |
|
112 direct histogram data has been displayed. |
|
113 |
|
114 @param aDirectHistogramDisplayed |
|
115 Reference to CCameraV2Histogram class object which refers a particular type of histogram being displayed. |
|
116 |
|
117 @param aErrorCode |
|
118 Appropriate error code. |
|
119 */ |
|
120 virtual void DirectHistogramDisplayed(CCamera::CCameraV2DirectViewFinder& aDirectViewFinderHandle, CCamera::CCameraV2Histogram& aDirectHistogramDisplayed, TInt aErrorCode)=0; |
|
121 |
|
122 /** |
|
123 Implementation sends this callback in order to notify the client about availability of the histogram data. If a call |
|
124 to CCameraV2Histogram::StartHistogram() is made without a previous successful call to CCameraV2Histogram:: |
|
125 PrepareClientHistogramL() then the callback returns KErrBadHandle. |
|
126 |
|
127 @param aDirectViewFinderHandle |
|
128 Reference to CCameraV2DirectViewFinder class object which refers a particular direct viewfinder for which the |
|
129 client histogram data have been generated. |
|
130 |
|
131 @param aClientHistogramBuffer |
|
132 Pointer to MHistogramV2Buffer which retrieves a single histogram alongwith relevant information about it. The |
|
133 ownership will be retained by the implementation. Client needs to call Release in order to indicate the |
|
134 implementation that the buffer can be re-used. Client shall never try to delete the pointer. NULL, if error. |
|
135 |
|
136 @param aErrorCode |
|
137 Appropriate error code. |
|
138 |
|
139 @note Client shall use the currently available histogram for the direct viewfinder frames until a new histogram is |
|
140 available. |
|
141 */ |
|
142 virtual void ClientHistogramReady(CCamera::CCameraV2DirectViewFinder& aDirectViewFinderHandle, MHistogramV2Buffer* aClientHistogramBuffer, TInt aErrorCode)=0; |
|
143 |
|
144 /** |
|
145 Implementation sends this callback as a notification of the display of direct snapshot for still images on the display |
|
146 screen. |
|
147 |
|
148 @param aDirectViewFinderHandle |
|
149 Reference to CCameraV2DirectViewFinder class object which refers a particular direct viewfinder on which the |
|
150 direct snapshot data for still images have been displayed. |
|
151 |
|
152 @param aCaptureImageHandle |
|
153 Reference to CCameraImageCapture class object which was used to issue the capture image operation. |
|
154 |
|
155 @param aPostCaptureControlId |
|
156 Id used to identify a particular CCameraPostImageCaptureControl object associated with the given |
|
157 CCameraImageCapture class object. This is needed to identify the image which is represented by this snapshot. |
|
158 |
|
159 @param aErrorCode |
|
160 Appropriate error code. |
|
161 */ |
|
162 virtual void DirectSnapshotForImageDisplayed(CCamera::CCameraV2DirectViewFinder& aDirectViewFinderHandle, CCamera::CCameraImageCapture& aCaptureImageHandle, TPostCaptureControlId aPostCaptureControlId, TInt aErrorCode)=0; |
|
163 |
|
164 /** |
|
165 Implementation sends this callback in order to notify the client about failure with the direct viewfinder. |
|
166 |
|
167 @param aDirectViewFinderHandle |
|
168 Reference to CCameraV2DirectViewFinder class object which refers a particular direct viewfinder. |
|
169 |
|
170 @param aErrorCode |
|
171 The reason of failure of the direct viewfinder. |
|
172 */ |
|
173 virtual void DirectViewFinderFailed(CCamera::CCameraV2DirectViewFinder& aDirectViewFinderHandle, TInt aErrorCode)=0; |
|
174 |
|
175 /** |
|
176 Gets a custom interface for future callbacks. This method will be called by the implementation to get a new interface |
|
177 which would support future callbacks. |
|
178 |
|
179 @param aInterface |
|
180 The Uid of the particular interface function required for callbacks. |
|
181 |
|
182 @param aPtrInterface |
|
183 The implementation has to type-cast the retrieved custom interface pointer to the appropriate type. |
|
184 |
|
185 @return The error code. |
|
186 */ |
|
187 virtual TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface)=0; |
|
188 }; |
|
189 |
|
190 /** |
|
191 A mixin class to be implemented by the client in order to use the client view finder API CCameraClientViewFinder. The |
|
192 derived class methods are called by the implementation when the client view finder operations are ready to be notified |
|
193 accordingly. Implementation shall keep track of CCameraClientViewFinder object deletion. It has to ensure that a callback |
|
194 is not send should the client destroy the particular CCameraClientViewFinder class object when the callback is queued to |
|
195 be send across. Ownership of CCameraClientViewFinder is retained by the client. |
|
196 |
|
197 @see CCamera::CCameraClientViewFinder |
|
198 */ |
|
199 class MClientViewFinderObserver |
|
200 { |
|
201 public: |
|
202 /** |
|
203 Implementation sends this callback in order to notify the client about the availability of viewfinder frames. |
|
204 Viewfinder frames can be retrieved by the client using the CCameraClientViewFinder::GetViewFinderBufferL |
|
205 (MCameraBuffer2& aClientViewFinderBuffer). |
|
206 |
|
207 @param CCameraClientViewFinder |
|
208 Reference to CCameraClientViewFinder class object which refers a particular client viewfinder. |
|
209 |
|
210 @param aErrorCode |
|
211 Appropriate error code. |
|
212 */ |
|
213 virtual void ViewFinderBufferReady(CCamera::CCameraClientViewFinder& aClientViewFinderHandle, TInt aErrorCode)=0; |
|
214 |
|
215 /** |
|
216 Implementation sends this callback in order to notify the client when the direct histogram data gets displayed on the |
|
217 screen for the first time after starting a particular client viewfinder. If a call to CCameraV2Histogram:: |
|
218 StartHistogram() is made without a previous successful call to CCameraV2Histogram::PrepareDirectHistogramL() then the |
|
219 callback returns KErrBadHandle. |
|
220 |
|
221 @param aClientViewFinderHandle |
|
222 Reference to CCameraClientViewFinder class object which refers a particular client viewfinder. |
|
223 |
|
224 @param aDirectHistogramDisplayed |
|
225 Reference to CCameraV2Histogram class object which refers a particular type of histogram being displayed. |
|
226 |
|
227 @param aErrorCode |
|
228 Appropriate error code. |
|
229 */ |
|
230 virtual void DirectHistogramDisplayed(CCamera::CCameraClientViewFinder& aClientViewFinderHandle, CCamera::CCameraV2Histogram& aDirectHistogramDisplayed, TInt aErrorCode)=0; |
|
231 |
|
232 /** |
|
233 Implementation sends this callback in order to notify the client about availability of the histogram data. If a call |
|
234 to CCameraV2Histogram::StartHistogram() is made without a previous successful call to CCameraV2Histogram:: |
|
235 PrepareClientHistogramL() then the callback returns KErrBadHandle. |
|
236 |
|
237 @param aClientViewFinderHandle |
|
238 Reference to CCameraClientViewFinder class object which refers a particular client viewfinder for which the |
|
239 client histogram data have been generated. |
|
240 |
|
241 @param aClientHistogramBuffer |
|
242 Pointer to MHistogramV2Buffer which retrieves a single histogram alongwith relevant information about it. The |
|
243 ownership will be retained by the implementation. Client needs to call Release in order to indicate the |
|
244 implementation that the buffer can be re-used. Client shall never try to delete the pointer. NULL, if error. |
|
245 |
|
246 @param aErrorCode |
|
247 Appropriate error code. |
|
248 |
|
249 @note Client shall use the currently available histogram for the viewfinder frames until a new histogram is |
|
250 available. |
|
251 */ |
|
252 virtual void ClientHistogramReady(CCamera::CCameraClientViewFinder& aClientViewFinderHandle, MHistogramV2Buffer* aClientHistogramBuffer, TInt aErrorCode)=0; |
|
253 |
|
254 /** |
|
255 Implementation sends this callback in order to notify the client about failure of image processing for the client |
|
256 viewfinder frames. |
|
257 |
|
258 @param aClientViewFinderHandle |
|
259 Reference to CCameraClientViewFinder class object which refers a particular client viewfinder. |
|
260 |
|
261 @param aErrorCode |
|
262 The reason of failure of the image processing. |
|
263 */ |
|
264 virtual void ImageProcessingFailed(CCamera::CCameraClientViewFinder& aClientViewFinderHandle, TInt aErrorCode)=0; |
|
265 |
|
266 /** |
|
267 Gets a custom interface for future callbacks. This method will be called by the implementation to get a new interface |
|
268 which would support future callbacks. |
|
269 |
|
270 @param aInterface |
|
271 The Uid of the particular interface function required for callbacks. |
|
272 |
|
273 @param aPtrInterface |
|
274 The implementation has to type-cast the retrieved custom interface pointer to the appropriate type. |
|
275 |
|
276 @return The error code. |
|
277 */ |
|
278 virtual TInt CustomInterface(TUid aInterface, TAny*& aPtrInterface)=0; |
|
279 }; |
|
280 |
|
281 /** |
|
282 CCamera view finder base class is used to provide features common to both client view finders and direct view finders. |
|
283 |
|
284 @note This class is not intended for stand alone use. One of the derived class shall be used instead. |
|
285 Features of this class will automatically be used when either direct view finder or client based view finder are |
|
286 created by clients. |
|
287 |
|
288 @note If the class methods leave, the output type parameter value is not guaranteed to be valid. |
|
289 |
|
290 @publishedPartner |
|
291 @prototype |
|
292 */ |
|
293 class CCameraViewFinder : public CBase |
|
294 { |
|
295 /* so can use internal factory functions etc. */ |
|
296 friend class CCamera; |
|
297 |
|
298 public: |
|
299 /** |
|
300 Different types of available viewfinder fading. |
|
301 The enumeration list may be extended in future. |
|
302 |
|
303 @internalTechnology |
|
304 */ |
|
305 enum TViewFinderFadingType |
|
306 { |
|
307 /** Fading not supported. */ |
|
308 EVFFadingTypeNone =0x00, |
|
309 /** Fading from a single frame of color given by the client. */ |
|
310 EVFFadingTypeStaticColorFading =0x01, |
|
311 /** Fading from a single frame given by the client. */ |
|
312 EVFFadingTypeStaticFrameFading =0x02, |
|
313 /** Fading from a number of previous VF frames. */ |
|
314 EVFFadingTypeCross =0x04 |
|
315 }; |
|
316 |
|
317 /** |
|
318 Different ways to control the viewfinder fading. |
|
319 The enumeration list may be extended in future. |
|
320 |
|
321 @internalTechnology |
|
322 */ |
|
323 enum TViewFinderFadingControl |
|
324 { |
|
325 /** Fading not supported. */ |
|
326 EVFFadingControlNone = 0x00, |
|
327 /** Switch on (enable) the fading. */ |
|
328 EVFFadingControlSwitchedOn = 0x01, |
|
329 /** Switch off (disable) the fading. */ |
|
330 EVFFadingControlSwitchedOff = 0x02, |
|
331 /** Automatic fading. */ |
|
332 EVFFadingControlSwitchAuto = 0x04 |
|
333 }; |
|
334 |
|
335 /** |
|
336 Different directions in which the fading may appear. |
|
337 The enumeration list may be extended in future. |
|
338 |
|
339 @internalTechnology |
|
340 */ |
|
341 enum TViewFinderFadingDirection |
|
342 { |
|
343 /** Fading not supported. */ |
|
344 EVFFadingDirectionNone = 0x00, |
|
345 /** Automatic direction or may be even custom direction decided by implementation. */ |
|
346 EVFFadingDirectionAuto = 0x01, |
|
347 /** Uniform fading. */ |
|
348 EVFFadingDirectionUniform = 0x02, |
|
349 /** Start to fade from up to down. */ |
|
350 EVFFadingDirectionUpDown = 0x04, |
|
351 /** Start to fade from down to up. */ |
|
352 EVFFadingDirectionDownUp = 0x08, |
|
353 /** Start to fade from left to right. */ |
|
354 EVFFadingDirectionLeftRight = 0x10, |
|
355 /** Start to fade from right to left. */ |
|
356 EVFFadingDirectionRightLeft = 0x20 |
|
357 }; |
|
358 |
|
359 /** |
|
360 Image enhancement options to be applied for a particular display. |
|
361 The enumeration list may be extended in future. |
|
362 |
|
363 @internalTechnology |
|
364 */ |
|
365 enum TImageEnhancement |
|
366 { |
|
367 /** Not Supported. */ |
|
368 EImageEnhancementNone = 0x00, |
|
369 /** Image Enhancement switches off. */ |
|
370 EImageEnhancementSwitchOFF = 0x01, |
|
371 /** Image Enhancement switches to auto mode. */ |
|
372 EImageEnhancementAuto = 0x02, |
|
373 /** Image Enhancement switches on. */ |
|
374 EImageEnhancementSwitchOn = 0x04 |
|
375 }; |
|
376 |
|
377 /** |
|
378 Retrieves the capabilites of viewfinder fading. |
|
379 |
|
380 @internalTechnology |
|
381 */ |
|
382 class TViewFinderFadingCapabilities |
|
383 { |
|
384 public: |
|
385 IMPORT_C TViewFinderFadingCapabilities(); |
|
386 |
|
387 IMPORT_C TUint Size() const; |
|
388 IMPORT_C TUint Version() const; |
|
389 |
|
390 private: |
|
391 //for future expansion |
|
392 TUint iSize:24; |
|
393 TUint iVersion:8; |
|
394 |
|
395 // reserved for future expansion |
|
396 TInt iReserved1; |
|
397 TInt iReserved2; |
|
398 |
|
399 public: |
|
400 /** Bit-field retrieving the supported fading type TViewFinderFadingType. */ |
|
401 TUint iSupportedFadingType; |
|
402 /** Bit-field retrieving the supported fading control TViewFinderFadingControl. */ |
|
403 TUint iSupportedFadingControl; |
|
404 /** Bit-field retrieving the supported fading direction TViewFinderFadingDirection. */ |
|
405 TUint iSupportedFadingDirection; |
|
406 }; |
|
407 |
|
408 /** |
|
409 Viewfinder fading effects characterizing a particular viewfinder fading. |
|
410 |
|
411 @internalTechnology |
|
412 */ |
|
413 class TViewFinderFadingEffect |
|
414 { |
|
415 public: |
|
416 IMPORT_C TViewFinderFadingEffect(); |
|
417 |
|
418 IMPORT_C TUint Size() const; |
|
419 IMPORT_C TUint Version() const; |
|
420 |
|
421 private: |
|
422 //for future expansion |
|
423 TUint iSize:24; |
|
424 TUint iVersion:8; |
|
425 |
|
426 // reserved for future expansion |
|
427 TInt iReserved1; |
|
428 TInt iReserved2; |
|
429 TInt iReserved3[6]; |
|
430 |
|
431 public: |
|
432 /** The type of viewfinder fading to be used. */ |
|
433 TViewFinderFadingType iViewFinderFadingType; |
|
434 /** The control for the viewfinder fading, that is, on/off/auto. */ |
|
435 TViewFinderFadingControl iViewFinderFadingControl; |
|
436 /** The direction of viewfinder fading. */ |
|
437 TViewFinderFadingDirection iViewFinderFadingDirection; |
|
438 /** The color used to fade from/to in case of static color fading. This is ignored if iViewFinderFadingType is |
|
439 not EVFFadingTypeStaticColorFading. */ |
|
440 TRgb iStaticFadingColor; |
|
441 /** The handle of CFbsBitmap used to obtain the frame used to fade from/to in case of static frame fading. |
|
442 This is KECamStaticFrameFadingTypeNotUsed if iViewFinderFadingType is not EVFFadingTypeStaticFrameFading. |
|
443 This is KECamSpecialStaticFrameFormatHandle if CFBsBitmap handle is not to be used. */ |
|
444 TInt iStaticFadingFrameBitmapHandle; |
|
445 /** The number of previous frames to be saved for cross fading. |
|
446 This is KECamCrossFadingFramesNotUsed if iViewFinderFadingType is not EVFFadingTypeCross. */ |
|
447 TUint iCrossFadingFrames; |
|
448 /** The fading time. This may be used both for auto and manual fading as per implementation. */ |
|
449 TTimeIntervalMicroSeconds32 iFadingTime; |
|
450 }; |
|
451 |
|
452 public: |
|
453 |
|
454 IMPORT_C void GetViewFinderFadingCapabilitiesL(TViewFinderFadingCapabilities& aVFFadingCapabilities) const; |
|
455 IMPORT_C void GetViewFinderFadingEffectL(TViewFinderFadingEffect& aCurrentVFFadingEffect) const; |
|
456 IMPORT_C void SetViewFinderFadingEffectL(const TViewFinderFadingEffect& aVFFadingEffect); |
|
457 |
|
458 IMPORT_C void GetViewFinderHandleL(TInt& aVFHandle) const; |
|
459 |
|
460 ~CCameraViewFinder(); |
|
461 |
|
462 protected: |
|
463 CCameraViewFinder(CCamera& aOwner); |
|
464 |
|
465 protected: |
|
466 void GetSpotsPositionL(TUint aSpotCombination, RArray<TRect>& aSpotsPosition) const; |
|
467 |
|
468 void GetSupportedImageEnhancementL(TUint& aSupportedImageEnhancement) const; |
|
469 void GetImageEnhancementL(TImageEnhancement& aImageEnhancement) const; |
|
470 void SetImageEnhancementL(TImageEnhancement aImageEnhancement); |
|
471 |
|
472 void GetSupportedVFMagnificationL(RArray<TUint>& aSupportedVFMagnification) const; |
|
473 void GetViewfinderMagnificationL(TUint& aVFMagnification) const; |
|
474 void SetViewfinderMagnificationL(TUint aVFMagnification); |
|
475 |
|
476 protected: |
|
477 CCamera& iOwner; |
|
478 MCameraViewFinder* iImplBase; // not owned |
|
479 }; |
|
480 |
|
481 /** |
|
482 CCamera direct view finder v2 class is used to provide support for multiple Direct View Finder. |
|
483 A new instance of this class will be created for every new direct viewfinder. |
|
484 |
|
485 @note This class is not intended for sub-classing and used to standardise existing varieties of implementations. |
|
486 |
|
487 @note If the class methods leave, the output type parameter value is not guaranteed to be valid. |
|
488 |
|
489 @note Clients must implement an MDirectViewFinderObserver in order to use this CCameraV2DirectViewFinder API. |
|
490 |
|
491 @publishedPartner |
|
492 @prototype |
|
493 */ |
|
494 class CCamera::CCameraV2DirectViewFinder : public CCameraViewFinder |
|
495 { |
|
496 /* so can use internal factory functions etc. */ |
|
497 friend class CCamera; |
|
498 friend class CCamera::CCameraDirectSnapshot; |
|
499 |
|
500 public: |
|
501 |
|
502 /** Specifies direct viewfinder state. */ |
|
503 enum TViewFinderState |
|
504 { |
|
505 /** View Finder is activated */ |
|
506 EViewFinderActive, |
|
507 /** View Finder has been paused */ |
|
508 EViewFinderPause, |
|
509 /** View Finder has been stopped or hasn't yet started. Default state. */ |
|
510 EViewFinderInActive |
|
511 }; |
|
512 |
|
513 public: |
|
514 |
|
515 IMPORT_C static CCameraV2DirectViewFinder* NewL(CCamera& aOwner, MDirectViewFinderObserver& aDirectViewFinderObserver); |
|
516 |
|
517 IMPORT_C CCamera::CCameraV2Histogram* CreateHistogramHandleL() const; |
|
518 IMPORT_C CCamera::CCameraImageProcessing* GetTransformationHandleL() const; |
|
519 |
|
520 IMPORT_C CCamera::CCameraDirectSnapshot* GetDirectSnapshotHandleL() const; |
|
521 |
|
522 IMPORT_C void StartViewFinderDirectL(RWsSession& aWs, CWsScreenDevice& aScreenDevice, RWindowBase& aWindow, TRect& aScreenRect); |
|
523 |
|
524 IMPORT_C void StartViewFinderDirectL(RWsSession& aWs, CWsScreenDevice& aScreenDevice, RWindowBase& aWindow, |
|
525 TRect& aScreenRect, TRect& aClipRect); |
|
526 |
|
527 IMPORT_C void GetDirectViewFinderPropertiesL(TInt& aScreenNumber, TRect& aScreenRect, TRect& aClipRect) const; |
|
528 |
|
529 IMPORT_C void PauseViewFinderDirect(); |
|
530 IMPORT_C void ResumeViewFinderDirect(); |
|
531 IMPORT_C void GetViewFinderStateL(TViewFinderState& aViewFinderState) const; |
|
532 |
|
533 IMPORT_C void StopDirectViewFinder(); |
|
534 |
|
535 IMPORT_C ~CCameraV2DirectViewFinder(); |
|
536 |
|
537 private: |
|
538 CCameraV2DirectViewFinder(CCamera& aOwner); |
|
539 void ConstructL(MDirectViewFinderObserver& aDirectViewFinderObserver); |
|
540 |
|
541 void SetImplHandle(); |
|
542 |
|
543 void SetImplBaseHandle(); |
|
544 |
|
545 MCameraV2DirectViewFinder* Impl(); |
|
546 |
|
547 private: |
|
548 MCameraV2DirectViewFinder* iImpl; // not owned |
|
549 }; |
|
550 |
|
551 /** |
|
552 CCamera client view finder class is used to provide support for multiple client View Finder. |
|
553 A new instance of this class will be created for every new client viewfinder. |
|
554 |
|
555 @note This class is not intended for sub-classing and used to standardise existing |
|
556 varieties of implementations. |
|
557 |
|
558 @note If the class methods leave, the output type parameter value is not guaranteed to be valid. |
|
559 |
|
560 @note Clients must implement an MClientViewFinderObserver in order to use this CCameraClientViewFinder API. |
|
561 MCameraObserver2::ViewFinderReady will not be used with this class. |
|
562 |
|
563 @publishedPartner |
|
564 @prototype |
|
565 */ |
|
566 class CCamera::CCameraClientViewFinder : public CCameraViewFinder |
|
567 { |
|
568 /* so can use internal factory functions etc. */ |
|
569 friend class CCamera; |
|
570 |
|
571 public: |
|
572 |
|
573 IMPORT_C static CCameraClientViewFinder* NewL(CCamera& aOwner, MClientViewFinderObserver& aClientViewFinderObserver); |
|
574 |
|
575 IMPORT_C CCamera::CCameraV2Histogram* CreateHistogramHandleL() const; |
|
576 IMPORT_C CCamera::CCameraImageProcessing* GetTransformationHandleL() const; |
|
577 |
|
578 IMPORT_C void StartClientViewFinderL(TInt aScreenNumber, CCamera::TFormat aImageFormat, TSize& aSize); |
|
579 IMPORT_C void StartClientViewFinderL(TInt aScreenNumber, CCamera::TFormat aImageFormat, TSize& aSize, TRect& aClipRect); |
|
580 |
|
581 IMPORT_C void GetClientViewFinderStateL(TBool& aIsActive) const; |
|
582 IMPORT_C void GetClientViewFinderPropertiesL(TInt& aScreenNumber, CCamera::TFormat& aImageFormat, TSize& aSize, TRect& aClipRect) const; |
|
583 |
|
584 IMPORT_C void StopClientViewFinder(); |
|
585 |
|
586 IMPORT_C void GetViewFinderBufferL(MCameraBuffer2& aClientViewFinderBuffer) const; |
|
587 |
|
588 IMPORT_C ~CCameraClientViewFinder(); |
|
589 |
|
590 private: |
|
591 CCameraClientViewFinder(CCamera& aOwner); |
|
592 void ConstructL(MClientViewFinderObserver& aClientViewFinderObserver); |
|
593 |
|
594 void SetImplHandle(); |
|
595 |
|
596 void SetImplBaseHandle(); |
|
597 |
|
598 private: |
|
599 MCameraClientViewFinder* iImpl; // not owned |
|
600 }; |
|
601 |
|
602 /** |
|
603 This class allows the client to enable direct snapshot feature for still images only. The direct snapshot API can not be |
|
604 used for video. |
|
605 |
|
606 The direct snapshot can be created out of CCameraV2DirectViewFinder object only. Its lifetime is dependent on the parent |
|
607 direct viewfinder object. So, the client is supposed to destroy the direct snapshot object before deleting the parent |
|
608 direct viewfinder object. The MDirectViewFinderObserver observer class provides callback to notify the client whenever |
|
609 direct snapshot data gets displayed on the given direct viewfinder screen. The callback also provides information regarding |
|
610 the CCameraImageCapture object used to issue the image capture calls. It also provides the Id for the individual images |
|
611 which get represented by the snapshot displayed. |
|
612 |
|
613 @note This class provides a standardised client interface for the direct snapshot. Classes cannot be derived from it. |
|
614 |
|
615 @note If the class methods leave, the output type parameter value is not guaranteed to be valid. |
|
616 |
|
617 @publishedPartner |
|
618 @prototype |
|
619 */ |
|
620 class CCamera::CCameraDirectSnapshot : public CBase |
|
621 { |
|
622 friend class CCamera::CCameraV2DirectViewFinder; |
|
623 |
|
624 public: |
|
625 /** |
|
626 Describes the state of direct snapshot. |
|
627 The enumeration list may be extended in future. |
|
628 */ |
|
629 enum TDirectSnapshotState |
|
630 { |
|
631 /** The direct snapshot has been enabled. */ |
|
632 EDirectSnapshotEnabled, |
|
633 /** The direct snapshot has been disabled. */ |
|
634 EDirectSnapshotDisabled |
|
635 }; |
|
636 |
|
637 /** |
|
638 Specifes the parameters necessary for direct snapshots. The screen co-ordinates used for direct snapshot will be the |
|
639 same as used for the parent direct viewfinder screen co-ordinates. This screen co-ordinate for direct snapshot may be |
|
640 changed by the implementation in certain cases for alignment. |
|
641 */ |
|
642 class TDirectSnapshotParameters |
|
643 { |
|
644 public: |
|
645 IMPORT_C TDirectSnapshotParameters(); |
|
646 |
|
647 IMPORT_C TUint Size() const; |
|
648 IMPORT_C TUint Version() const; |
|
649 |
|
650 IMPORT_C TBool IsAspectRatioMaintained() const; |
|
651 IMPORT_C void SetAspectRatioState(TBool aIsAspectRatioMaintained); |
|
652 |
|
653 private: |
|
654 //for future expansion |
|
655 TUint iSize:24; |
|
656 TUint iVersion:8; |
|
657 |
|
658 // reserved for future expansion |
|
659 TInt iReserved1; |
|
660 TInt iReserved2; |
|
661 TInt iReserved3; |
|
662 |
|
663 TUint iReserved4:31; |
|
664 |
|
665 /** Set to ETrue if the aspect ratio of the direct snapshot image must be maintained when scaling down */ |
|
666 TUint iIsAspectRatioMaintained:1; |
|
667 |
|
668 public: |
|
669 /** The bit field representing the drive modes for which the direct snapshot will be displayed if enabled. |
|
670 Refer CCamera::CCameraAdvancedSettings::TDriveMode. */ |
|
671 TUint iDriveModes; |
|
672 |
|
673 /** The background colour to be used if the snapshot has been scaled (maintaining its aspect ratio) |
|
674 and does not fully fill the dimension as per the direct view finder screen size. The TRect supposed to be used |
|
675 for direct snapshot may be modified by the implementation in certain cases for alignment. */ |
|
676 TRgb iBgColor; |
|
677 |
|
678 /** The time duration during which the snapshot data should appear on the screen. The implementation may |
|
679 internally change this display time if the client sets iDisplayTime to TTimeIntervalMicroSeconds32 |
|
680 (KECamSnapshotDefaultDisplayTime). This may happen when the client doesn't want to specify a specific duration |
|
681 and would rather let the implementation decide. */ |
|
682 TTimeIntervalMicroSeconds32 iDisplayTime; |
|
683 }; |
|
684 |
|
685 public: |
|
686 |
|
687 IMPORT_C void GetDirectViewFinderL(CCamera::CCameraV2DirectViewFinder*& aDirectViewFinder) const; |
|
688 |
|
689 IMPORT_C void EnableDirectSnapshotL(TDirectSnapshotParameters& aDirectSnapshotParameters); |
|
690 |
|
691 IMPORT_C void DisableDirectSnapshot(); |
|
692 |
|
693 IMPORT_C void GetDirectSnapshotStateL(TDirectSnapshotState& aDirectSnapshotParameters) const; |
|
694 |
|
695 IMPORT_C void GetDirectSnapshotParametersL(TDirectSnapshotParameters& aDirectSnapshotParameters) const; |
|
696 |
|
697 IMPORT_C void SetDirectSnapshotParametersL(const TDirectSnapshotParameters& aDirectSnapshotParameters); |
|
698 |
|
699 IMPORT_C ~CCameraDirectSnapshot(); |
|
700 |
|
701 private: |
|
702 IMPORT_C static CCameraDirectSnapshot* CreateL(CCamera::CCameraV2DirectViewFinder& aDirectViewFinder); |
|
703 |
|
704 CCameraDirectSnapshot(); |
|
705 void ConstructL(CCamera::CCameraV2DirectViewFinder& aDirectViewFinder); |
|
706 |
|
707 MCameraV2DirectViewFinder* DirectViewFinderImpl(CCamera::CCameraV2DirectViewFinder& aDirectViewFinder); |
|
708 |
|
709 private: |
|
710 MCameraDirectSnapshot* iImpl; // not owned |
|
711 }; |
|
712 |
|
713 #endif // ECAMVIEWFINDER_H |