|
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 // testsnapshot.h |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef TESTSNAPSHOT_H |
|
19 #define TESTSNAPSHOT_H |
|
20 |
|
21 #include "TestCamera.h" |
|
22 #include <ecam/mcamerasnapshot.h> |
|
23 |
|
24 const TInt KNumOfSnapshotExtensions = 1; |
|
25 |
|
26 // Implementations of the MCameraSnapshot class |
|
27 class CTestCamSnapshot : public CBase, |
|
28 public MCameraSnapshot |
|
29 { |
|
30 friend class CTestCamera; |
|
31 public: |
|
32 static CTestCamSnapshot* NewL(CTestCamera& aOwner); |
|
33 ~CTestCamSnapshot(); |
|
34 |
|
35 private: |
|
36 void Release(); |
|
37 |
|
38 //from MCameraSnapshot |
|
39 TUint32 SupportedFormats(); |
|
40 |
|
41 void PrepareSnapshotL(CCamera::TFormat aFormat, const TPoint& aPosition, const TSize& aSize, const TRgb& aBgColor, TBool aMaintainAspectRatio); |
|
42 |
|
43 void PrepareSnapshotL(CCamera::TFormat aFormat, const TSize& aSize, TBool aMaintainAspectRatio); |
|
44 |
|
45 void SetBgColorL(const TRgb& aBgColor); |
|
46 |
|
47 void SetPositionL(const TPoint& aPosition); |
|
48 |
|
49 TBool IsSnapshotActive() const; |
|
50 |
|
51 void StartSnapshot(); |
|
52 |
|
53 void StopSnapshot(); |
|
54 |
|
55 MCameraBuffer& SnapshotDataL(RArray<TInt>& aFrameIndexOrder); |
|
56 |
|
57 // New functions |
|
58 void ServiceSnapshot(const CFbsBitGc& aSourceBitmapGc); |
|
59 void ServiceBurstImageSnapshot(const CFbsBitGc& aSourceBitmapGc); |
|
60 |
|
61 private: |
|
62 CTestCamSnapshot(CTestCamera& aOwner); |
|
63 void Init(); |
|
64 void ConstructL(); |
|
65 void DoStartSnapshotL(); |
|
66 |
|
67 private: |
|
68 CTestCamera& iOwner; |
|
69 |
|
70 TInt iRefCount; |
|
71 |
|
72 CFbsBitmap* iSnapshot; |
|
73 CFbsBitmapDevice* iSnapshotDev; |
|
74 CFbsBitGc* iSnapshotGc; |
|
75 |
|
76 CFbsBitmap* iSnapshotImage; |
|
77 CFbsBitmapDevice* iSnapshotImageDev; |
|
78 CFbsBitGc* iSnapshotImageGc; |
|
79 |
|
80 TRect iSnapshotImageRect; |
|
81 CCamera::TFormat iSnapshotFormat; |
|
82 TRgb iBgColor; |
|
83 |
|
84 TUint32 iImageFormatsSupported; |
|
85 |
|
86 RArray<TRect> iSupportedSnapshotRect; |
|
87 |
|
88 RTestCameraFrameBuffer iSnapshotBuffer; |
|
89 |
|
90 volatile TBool iSnapshotPrepared; |
|
91 volatile TBool iSnapshotActive; |
|
92 |
|
93 }; |
|
94 |
|
95 #endif // TESTSNAPSHOT_H |