|
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 CVTIMAGESCALERIMPLNEAREST_H |
|
22 #define CVTIMAGESCALERIMPLNEAREST_H |
|
23 |
|
24 // INCLUDE FILES |
|
25 |
|
26 #include "CVtImageScalerImpl.h" |
|
27 |
|
28 // CLASS DECLARATIONS |
|
29 |
|
30 /** |
|
31 * Nearest neigbour image scaling implementation. |
|
32 * |
|
33 * @lib videosource.lib |
|
34 */ |
|
35 class CVtImageScalerImplNearest : public CVtImageScalerImpl |
|
36 { |
|
37 private: // from CVtImageScalerImpl |
|
38 |
|
39 /** |
|
40 * From CVtImageScalerImpl. Check CVtImageScalerImpl for description. |
|
41 */ |
|
42 TInt Scale( TBool& aContinue ); |
|
43 |
|
44 private: |
|
45 |
|
46 /** |
|
47 * Validate given parameters. |
|
48 */ |
|
49 void ValidateSourceTargetL( |
|
50 const CVtImage& aSource, |
|
51 CVtImage& aTarget ); |
|
52 |
|
53 /** |
|
54 * Initializes internal variables for scaling. |
|
55 */ |
|
56 void Initialize(); |
|
57 |
|
58 /** |
|
59 * Scales images in displaymode EColor4K. |
|
60 */ |
|
61 void Scale4K( |
|
62 const TUint16* aSrcPtr, |
|
63 TUint32 aSrcPitch, |
|
64 TUint16* aTrgPtr, |
|
65 TUint32 aTrgWidth, |
|
66 TUint32 aTrgHeight, |
|
67 TUint32 aDx, |
|
68 TUint32 aDy ); |
|
69 |
|
70 /** |
|
71 * Scales images in displaymode EColor64K. |
|
72 */ |
|
73 void Scale64K( |
|
74 const TUint16* aSrcPtr, |
|
75 TUint32 aSrcPitch, |
|
76 TUint16* aTrgPtr, |
|
77 TUint32 aTrgWidth, |
|
78 TUint32 aTrgHeight, |
|
79 TUint32 aDx, |
|
80 TUint32 aDy ); |
|
81 |
|
82 /** |
|
83 * Scales images in displaymode EColor16M. |
|
84 */ |
|
85 void Scale16M( |
|
86 const TUint8* aSrcPtr, |
|
87 TUint32 aSrcPitch, |
|
88 TUint8* aTrgPtr, |
|
89 TUint32 aTrgWidth, |
|
90 TUint32 aTrgHeight, |
|
91 TUint32 aTrgPitch, |
|
92 TUint32 aDx, |
|
93 TUint32 aDy ); |
|
94 |
|
95 /** |
|
96 * Scales images in displaymodes EColor16MU and EColor16MA. |
|
97 */ |
|
98 void Scale16MU16MA( |
|
99 const TUint32* aSrcPtr, |
|
100 TUint32 aSrcPitch, |
|
101 TUint32* aTrgPtr, |
|
102 TUint32 aTrgWidth, |
|
103 TUint32 aTrgHeight, |
|
104 TUint32 aDx, |
|
105 TUint32 aDy ); |
|
106 |
|
107 /** |
|
108 * Fast scaling when target is double the source size for |
|
109 * 4K and 64K display modes. |
|
110 */ |
|
111 void Scale2x4K64K(); |
|
112 |
|
113 /** |
|
114 * Fast scaling when target is double the source size for 16M |
|
115 * display mode. |
|
116 */ |
|
117 void Scale2x16M(); |
|
118 |
|
119 /** |
|
120 * Fast scaling when target is double the source size for 16MU and 16MA |
|
121 * display modes. |
|
122 */ |
|
123 void Scale2x16MU16MA(); |
|
124 |
|
125 private: |
|
126 |
|
127 // Target width ratio to source width |
|
128 TUint32 iU; |
|
129 |
|
130 // Target height ratio to source height |
|
131 TUint32 iV; |
|
132 }; |
|
133 |
|
134 #endif // CVTIMAGESCALERIMPLNEAREST_H |
|
135 |
|
136 // End of File |
|
137 |
|
138 |