|
1 /* |
|
2 * Copyright (c) 2004 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: Image Transforms subsystem. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CVTIMAGE_H |
|
22 #define CVTIMAGE_H |
|
23 |
|
24 // INCLUDE FILES |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <gdi.h> |
|
28 |
|
29 // CLASS DECLARATIONS |
|
30 |
|
31 /** |
|
32 * Abstract base class for VS images. |
|
33 * |
|
34 * @lib videosource.lib |
|
35 */ |
|
36 class CVtImage : public CBase |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * Enumeration for supported image types. |
|
41 */ |
|
42 enum TVtImageType |
|
43 { |
|
44 /** |
|
45 * CFbsBitmap image. |
|
46 */ |
|
47 EVtImageBitmap, |
|
48 |
|
49 /** |
|
50 * YUV 420 planar image where all Y samples are found first in memory as an |
|
51 * array of unsigned char (possibly with a larger stride for memory alignment), |
|
52 * followed immediately by all Cr (U) samples (with half the stride of the Y |
|
53 * lines, and half the number of lines), then followed immediately by all Cb |
|
54 * (V) samples in a similar fashion. |
|
55 */ |
|
56 EVtImageIYUV |
|
57 }; |
|
58 |
|
59 /** |
|
60 * Vt display modes. Used for identifying image's data format. |
|
61 */ |
|
62 enum TVtDisplayMode |
|
63 { |
|
64 /** |
|
65 * Unsupported display mode. |
|
66 */ |
|
67 EVtColorNone, |
|
68 |
|
69 /** |
|
70 * 4096 colour display mode (12 bpp). |
|
71 */ |
|
72 EVtColor4K, |
|
73 |
|
74 /** |
|
75 * 2^16 colour display mode (16 bpp). |
|
76 */ |
|
77 EVtColor64K, |
|
78 |
|
79 /** |
|
80 * True colour display mode (24 bpp). |
|
81 */ |
|
82 EVtColor16M, |
|
83 |
|
84 /** |
|
85 * True colour display mode (32 bpp). |
|
86 */ |
|
87 EVtColor16MU, |
|
88 |
|
89 /** |
|
90 * True colour display mode with alpha (32 bpp). |
|
91 */ |
|
92 EVtColor16MA, |
|
93 |
|
94 /** |
|
95 * YUV 420 planar display mode. |
|
96 */ |
|
97 EVtColorIYUV |
|
98 }; |
|
99 |
|
100 /** |
|
101 * Pure virtual function to check whether bitmap heap needs to be locked |
|
102 * for this image type. |
|
103 * @return Returns ETrue if bitmap heap lock is required, EFalse |
|
104 * otherwise. |
|
105 */ |
|
106 virtual TBool NeedHeapLock() const = 0; |
|
107 |
|
108 /** |
|
109 * Pure virtual function to get displaymode from image. |
|
110 * @return Returns image's displaymode. |
|
111 */ |
|
112 virtual TVtDisplayMode DisplayMode() const = 0; |
|
113 |
|
114 /** |
|
115 * Pure virtual function to get size of the image in pixels |
|
116 * @return Returns size of the image in pixels. |
|
117 */ |
|
118 virtual TSize Size() const = 0; |
|
119 |
|
120 /** |
|
121 * Pure virtual function to get how many bytes this image has per |
|
122 * scaline. |
|
123 * @return Returns number of bytes per scanline. |
|
124 */ |
|
125 virtual TInt BytesPerRow() const = 0; |
|
126 |
|
127 /** |
|
128 * Pure virtual function to get pointer to image data. |
|
129 * @return Returns pointer to image data. |
|
130 */ |
|
131 virtual TUint32* DataAddress() const = 0; |
|
132 |
|
133 /** |
|
134 * Pure virtual function to get pointer to image data at defined line. |
|
135 * If aLine is lower than zero then line zero is returned, also if aLine |
|
136 * is greater than height of the image minus 1 ( height - 1 ) then line |
|
137 * number ( height - 1 ) is returned. |
|
138 * @param "aLine" Number of vertical line for which pointer is wanted. |
|
139 * @return Returns pointer to the beginning of the requested scanline. |
|
140 */ |
|
141 virtual TUint32* LineAddress( TInt aLine ) const = 0; |
|
142 |
|
143 /** |
|
144 * Method for getting image type. |
|
145 * @return Returns type of the image. |
|
146 */ |
|
147 IMPORT_C TVtImageType Type() const; |
|
148 |
|
149 public: // static methods |
|
150 |
|
151 /** |
|
152 * Converts given TDisplayMode to corresponding TVtDisplayMode. |
|
153 * @param "aMode" Display mode as TDisplayMode. |
|
154 * @return Returns mode as TVtDisplayMode. |
|
155 */ |
|
156 static TVtDisplayMode DisplayModeToVtDisplayMode( TDisplayMode aMode ); |
|
157 |
|
158 protected: |
|
159 |
|
160 /** |
|
161 * C++ constructor. |
|
162 */ |
|
163 CVtImage( TVtImageType aType ); |
|
164 |
|
165 private: |
|
166 |
|
167 // Type of the image. |
|
168 TVtImageType iType; |
|
169 }; |
|
170 |
|
171 #endif // CVTIMAGE_H |
|
172 |
|
173 // End of File |
|
174 |
|
175 |