|
1 /* |
|
2 * Copyright (c) 2003 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 burst class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CAESTILLBURST_H |
|
21 #define CAESTILLBURST_H |
|
22 |
|
23 |
|
24 // FORWARD DECLARATIONS |
|
25 class HBufC8; |
|
26 class CFbsBitmap; |
|
27 class CCaeImageItem; |
|
28 template <class T> class RPointerArray; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 /** |
|
33 * Camera application engine still image burst capturing class. |
|
34 * |
|
35 */ |
|
36 |
|
37 NONSHARABLE_CLASS( CCaeStillBurst ) : public CBase |
|
38 { |
|
39 |
|
40 public: // Construction and destruction |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 */ |
|
45 static CCaeStillBurst* NewL(); |
|
46 |
|
47 /** |
|
48 * Destructor. |
|
49 */ |
|
50 virtual ~CCaeStillBurst(); |
|
51 |
|
52 public: // Settings |
|
53 |
|
54 /** |
|
55 * Sets the desired length of the burst. That many captures should be done in the burst. |
|
56 * Note that the final burst length really captured may be different if |
|
57 * there has been memory allocation problems or if the burst has been stopped. |
|
58 * @since 2.1 |
|
59 * @param aLength The desired length of the burst |
|
60 * @return void |
|
61 */ |
|
62 void SetLengthL( |
|
63 TInt aLength ); |
|
64 |
|
65 /** |
|
66 * Gets the length of the burst. That many captures will be done in the burst. |
|
67 * Note that the final burst length really captured may be different if |
|
68 * there has been memory allocation problems or if the burst has been stopped. |
|
69 * @since 2.1 |
|
70 * @return The desired length of the burst |
|
71 */ |
|
72 TInt Length() const; |
|
73 |
|
74 public: // Burst handling |
|
75 |
|
76 /** |
|
77 * Appends an image item into the image queue. |
|
78 * @since 2.1 |
|
79 * @param aBitmap Symbian OS bitmap image. |
|
80 * @param aImageData Other than Symbian OS bitmap image. |
|
81 * @param aError Error code related to the image. |
|
82 * @return Error code KErrNone, if the insertion is successful, |
|
83 * otherwise one of the system wide error codes. |
|
84 */ |
|
85 TInt AppendImage( |
|
86 CFbsBitmap* aBitmap, |
|
87 HBufC8* aImageData, |
|
88 TInt aError ); |
|
89 |
|
90 /** |
|
91 * Gets the count of image captures. |
|
92 * @since 2.1 |
|
93 * @return The count of image captures |
|
94 */ |
|
95 TInt CaptureCount() const; |
|
96 |
|
97 /** |
|
98 * Gets the count of image items in the image queue. |
|
99 * @since 2.1 |
|
100 * @return The count of image items in the image queue |
|
101 */ |
|
102 TInt ImageCount() const; |
|
103 |
|
104 /** |
|
105 * Gets the next image from image queue. |
|
106 * @since 2.1 |
|
107 * @param aBitmap Symbian OS bitmap image. |
|
108 * @param aImageData Other than Symbian OS bitmap image. |
|
109 * @param aError Error code related to the image. |
|
110 * @return Error code KErrNone, if the operation is successful, |
|
111 * otherwise KErrUnderflow (= no images in the queue). |
|
112 */ |
|
113 TInt GetNextImage( |
|
114 CFbsBitmap*& aBitmap, |
|
115 HBufC8*& aImageData, |
|
116 TInt& aError ); |
|
117 |
|
118 /** |
|
119 * Returns Boolean indicating if the burst is fully captured or not. |
|
120 * @since 2.1 |
|
121 * @return Boolean indicating if the burst is fully captured or not |
|
122 */ |
|
123 TBool IsBurstCaptured() const; |
|
124 |
|
125 /** |
|
126 * Resets and destroys image items from the image queue. |
|
127 * @since 2.1 |
|
128 * @return void |
|
129 */ |
|
130 void ResetAndDestroyImages(); |
|
131 |
|
132 private: // Private member methods |
|
133 |
|
134 /** |
|
135 * C++ constructor. |
|
136 */ |
|
137 CCaeStillBurst(); |
|
138 |
|
139 /** |
|
140 * Symbian OS 2nd phase constructor that can leave. |
|
141 */ |
|
142 void ConstructL(); |
|
143 |
|
144 private: // Data |
|
145 |
|
146 // Image queue for the images captured in burst. |
|
147 RPointerArray<CCaeImageItem>* iImageQueue; |
|
148 |
|
149 // Heap for image data in iImageQueue |
|
150 RHeap* iImageHeap; |
|
151 |
|
152 // Desired burst length (number of images). |
|
153 TInt iDesiredLength; |
|
154 |
|
155 // That many (successfull) captures have been made. |
|
156 TInt iCountOfBurstAppends; |
|
157 |
|
158 // Additional delay between separate captures. |
|
159 TTimeIntervalMicroSeconds iCaptureInterval; |
|
160 }; |
|
161 |
|
162 |
|
163 #endif // CAESTILLBURST_H |