13 #include <QFontMetrics> |
13 #include <QFontMetrics> |
14 #include <QSharedDataPointer> |
14 #include <QSharedDataPointer> |
15 #include <QRect> |
15 #include <QRect> |
16 #include <QImage> |
16 #include <QImage> |
17 #include "gfxutils.h" |
17 #include "gfxutils.h" |
|
18 #include "graphicscontextimpl.h" |
18 |
19 |
19 namespace Java { namespace GFX { |
20 namespace Java { namespace GFX { |
20 |
21 |
21 // |
22 // |
22 // CollisionDetection |
23 // CollisionDetection |
23 // |
24 // |
24 |
25 |
25 #define HANDLE_TO_POINTER(type, variable, handle) type variable = reinterpret_cast<type>( handle ) |
26 #define HANDLE_TO_POINTER(type, variable, handle) type variable = reinterpret_cast<type>( handle ) |
26 |
27 |
27 /*static*/ bool gfxUtils::detectCollision(int aImage1PixmapHandle, int aTransform1, int aP1x, int aP1y, int aR1x1, int aR1y1, int aR1x2, int aR1y2, |
28 bool gfxUtils::detectCollision(Image* aImage1, int aTransform1, int aP1x, int aP1y, int aR1x1, int aR1y1, int aR1x2, int aR1y2, |
28 int aImage2PixmapHandle, int aTransform2, int aP2x, int aP2y, int aR2x1, int aR2y1, int aR2x2, int aR2y2) |
29 Image* aImage2, int aTransform2, int aP2x, int aP2y, int aR2x1, int aR2y1, int aR2x2, int aR2y2) |
29 { |
30 { |
|
31 int transform1 = getCgTransformValue(aTransform1); |
|
32 int transform2 = getCgTransformValue(aTransform2); |
|
33 |
30 // Calculate the intersection of collisionRectangles: |
34 // Calculate the intersection of collisionRectangles: |
31 QRect rect1(aP1x, aP1y, aR1x2 - aR1x1, aR1y2 - aR1y1); |
35 QRect rect1(aP1x, aP1y, aR1x2 - aR1x1, aR1y2 - aR1y1); |
32 QRect rect2(aP2x, aP2y, aR2x2 - aR2x1, aR2y2 - aR2y1); |
36 QRect rect2(aP2x, aP2y, aR2x2 - aR2x1, aR2y2 - aR2y1); |
|
37 |
|
38 if (aTransform1 & EReflectDiag) |
|
39 { |
|
40 int tmp = rect1.width(); |
|
41 rect1.setWidth(rect1.height()); |
|
42 rect1.setHeight(tmp); |
|
43 } |
|
44 if (aTransform2 & EReflectDiag) |
|
45 { |
|
46 int tmp = rect2.width(); |
|
47 rect2.setWidth(rect2.height()); |
|
48 rect2.setHeight(tmp); |
|
49 } |
|
50 |
33 QRect rect3 = rect1.intersected(rect2); |
51 QRect rect3 = rect1.intersected(rect2); |
|
52 |
|
53 QImage qimage1; |
|
54 |
|
55 if(transform1 == ETransRot90) |
|
56 { |
|
57 GraphicsContextImpl gc; |
|
58 // create a copy of the image and transform it, i.e. don't modify the original |
|
59 qimage1 = gc.doTransform(aImage1->toImage(), transform1); |
|
60 } |
|
61 else |
|
62 { |
|
63 qimage1 = aImage1->toImage(); |
|
64 } |
|
65 int totalWidth1 = qimage1.width(); |
|
66 |
|
67 QImage qimage2; |
|
68 |
|
69 if(transform2 == ETransRot90) |
|
70 { |
|
71 GraphicsContextImpl gc; |
|
72 // create a copy of the image and transform it, i.e. don't modify the original |
|
73 qimage2 = gc.doTransform(aImage2->toImage(), transform2); |
|
74 } |
|
75 else |
|
76 { |
|
77 qimage2 = aImage2->toImage(); |
|
78 } |
|
79 int totalWidth2 = qimage2.width(); |
|
80 |
|
81 const unsigned char* data1 = qimage1.bits(); |
|
82 const unsigned char* data2 = qimage2.bits(); |
34 |
83 |
35 // Save intersection to collisionRectangles: |
84 // Save intersection to collisionRectangles: |
36 aR1x1 += rect3.x() - aP1x; |
85 aR1x1 += rect3.x() - aP1x; |
37 aR1y1 += rect3.y() - aP1y; |
86 aR1y1 += rect3.y() - aP1y; |
38 aR1x2 = aR1x1 + rect3.width(); |
87 aR1x2 = aR1x1 + rect3.width(); |
40 aR2x1 += rect3.x() - aP2x; |
89 aR2x1 += rect3.x() - aP2x; |
41 aR2y1 += rect3.y() - aP2y; |
90 aR2y1 += rect3.y() - aP2y; |
42 aR2x2 = aR2x1 + rect3.width(); |
91 aR2x2 = aR2x1 + rect3.width(); |
43 aR2y2 = aR2y1 + rect3.height(); |
92 aR2y2 = aR2y1 + rect3.height(); |
44 |
93 |
45 // Get image's pixel data: |
|
46 HANDLE_TO_POINTER(QPixmap*, image1, aImage1PixmapHandle); |
|
47 QImage qimage1 = image1->toImage(); |
|
48 const unsigned char* data1 = qimage1.bits(); |
|
49 int totalWidth1 = qimage1.width(); |
|
50 |
|
51 HANDLE_TO_POINTER(QPixmap*, image2, aImage2PixmapHandle); |
|
52 QImage qimage2 = image2->toImage(); |
|
53 const unsigned char* data2 = qimage2.bits(); |
|
54 int totalWidth2 = qimage2.width(); |
|
55 |
|
56 // These rectangles defines areas to be checked. |
94 // These rectangles defines areas to be checked. |
57 QRect image1Rect(aR1x1, aR1y1, aR1x2 - aR1x1, aR1y2 - aR1y1); |
95 QRect image1Rect(aR1x1, aR1y1, aR1x2 - aR1x1, aR1y2 - aR1y1); |
58 QRect image2Rect(aR2x1, aR2y1, aR2x2 - aR2x1, aR2y2 - aR2y1); |
96 QRect image2Rect(aR2x1, aR2y1, aR2x2 - aR2x1, aR2y2 - aR2y1); |
59 |
97 |
60 // Following variables define how much we need to increase or |
98 // Following variables define how much we need to increase or |
88 int rect1XEnd = 0; |
126 int rect1XEnd = 0; |
89 int rect1YEnd = 0; |
127 int rect1YEnd = 0; |
90 int rect2XEnd = 0; |
128 int rect2XEnd = 0; |
91 int rect2YEnd = 0; |
129 int rect2YEnd = 0; |
92 |
130 |
93 switch(aTransform1) { |
131 switch(transform1) |
94 case 0: // TRANS_NONE: |
132 { |
|
133 case ETransNone: |
95 rect1XInc = 1; |
134 rect1XInc = 1; |
96 rect1YInc = 0; |
135 rect1YInc = 0; |
97 rect1XLineInc = 0; |
136 rect1XLineInc = 0; |
98 rect1YLineInc = 1; |
137 rect1YLineInc = 1; |
99 rect1XStart = image1Rect.x(); |
138 rect1XStart = image1Rect.x(); |
100 rect1YStart = image1Rect.y(); |
139 rect1YStart = image1Rect.y(); |
101 rect1XEnd = image1Rect.x() + image1Rect.width() - 1; |
140 rect1XEnd = image1Rect.x() + image1Rect.width() - 1; |
102 rect1YEnd = image1Rect.y() + image1Rect.height() - 1; |
141 rect1YEnd = image1Rect.y() + image1Rect.height() - 1; |
103 break; |
142 break; |
104 case 5: // TRANS_ROT90: |
143 case ETransRot90: |
105 rect1XInc = 0; |
144 rect1XInc = 0; |
106 rect1YInc = 1; |
145 rect1YInc = 1; |
107 rect1XLineInc = -1; |
146 rect1XLineInc = -1; |
108 rect1YLineInc = 0; |
147 rect1YLineInc = 0; |
109 rect1XStart = image1Rect.x() + image1Rect.width() -1; |
148 rect1XStart = image1Rect.x() + image1Rect.width() -1; |
110 rect1YStart = image1Rect.y(); |
149 rect1YStart = image1Rect.y(); |
111 rect1XEnd = image1Rect.x(); |
150 rect1XEnd = image1Rect.x(); |
112 rect1YEnd = image1Rect.y() + image1Rect.width() - 1; |
151 rect1YEnd = image1Rect.y() + image1Rect.height() - 1; |
113 break; |
152 break; |
114 case 3: // TRANS_ROT180: |
153 case ETransRot180: |
115 rect1XInc = -1; |
154 rect1XInc = -1; |
116 rect1YInc = 0; |
155 rect1YInc = 0; |
117 rect1XLineInc = 0; |
156 rect1XLineInc = 0; |
118 rect1YLineInc = -1; |
157 rect1YLineInc = -1; |
119 rect1XStart = image1Rect.x() + image1Rect.width() -1; |
158 rect1XStart = image1Rect.x() + image1Rect.width() -1; |
120 rect1YStart = image1Rect.y() + image1Rect.height() - 1; |
159 rect1YStart = image1Rect.y() + image1Rect.height() - 1; |
121 rect1XEnd = image1Rect.x(); |
160 rect1XEnd = image1Rect.x(); |
122 rect1YEnd = image1Rect.y(); |
161 rect1YEnd = image1Rect.y(); |
123 break; |
162 break; |
124 case 6: // TRANS_ROT270: |
163 case ETransRot270: |
125 rect1XInc = 0; |
164 rect1XInc = 0; |
126 rect1YInc = -1; |
165 rect1YInc = -1; |
127 rect1XLineInc = 1; |
166 rect1XLineInc = 1; |
128 rect1YLineInc = 0; |
167 rect1YLineInc = 0; |
129 rect1XStart = image1Rect.x(); |
168 rect1XStart = image1Rect.x(); |
130 rect1YStart = image1Rect.y() + image1Rect.height() - 1; |
169 rect1YStart = image1Rect.y() + image1Rect.height() - 1; |
131 rect1XEnd = image1Rect.x() + image1Rect.height() - 1; |
170 rect1XEnd = image1Rect.x() + image1Rect.height() - 1; |
132 rect1YEnd = image1Rect.y(); |
171 rect1YEnd = image1Rect.y(); |
133 break; |
172 break; |
134 case 2: // TRANS_MIRROR: |
173 case ETransMirror: |
135 rect1XInc = -1; |
174 rect1XInc = -1; |
136 rect1YInc = 0; |
175 rect1YInc = 0; |
137 rect1XLineInc = 0; |
176 rect1XLineInc = 0; |
138 rect1YLineInc = 1; |
177 rect1YLineInc = 1; |
139 rect1XStart = image1Rect.x() + image1Rect.width() - 1; |
178 rect1XStart = image1Rect.x() + image1Rect.width() - 1; |
140 rect1YStart = image1Rect.y(); |
179 rect1YStart = image1Rect.y(); |
141 rect1XEnd = image1Rect.x(); |
180 rect1XEnd = image1Rect.x(); |
142 rect1YEnd = image1Rect.y() + image1Rect.height() - 1; |
181 rect1YEnd = image1Rect.y() + image1Rect.height() - 1; |
143 break; |
182 break; |
144 case 7: // TRANS_MIRROR_ROT90: |
183 case ETransMirrorRot90: |
145 rect1XInc = 0; |
184 rect1XInc = 0; |
146 rect1YInc = -1; |
185 rect1YInc = -1; |
147 rect1XLineInc = -1; |
186 rect1XLineInc = -1; |
148 rect1YLineInc = 0; |
187 rect1YLineInc = 0; |
149 rect1XStart = image1Rect.x() + image1Rect.width() -1; |
188 rect1XStart = image1Rect.x() + image1Rect.width() -1; |
150 rect1YStart = image1Rect.y() + image1Rect.height() - 1; |
189 rect1YStart = image1Rect.y() + image1Rect.height() - 1; |
151 rect1XEnd = image1Rect.x(); |
190 rect1XEnd = image1Rect.x(); |
152 rect1YEnd = image1Rect.y(); |
191 rect1YEnd = image1Rect.y(); |
153 break; |
192 break; |
154 case 1: // TRANS_MIRROR_ROT180: |
193 case ETransMirrorRot180: |
155 rect1XInc = 1; |
194 rect1XInc = 1; |
156 rect1YInc = 0; |
195 rect1YInc = 0; |
157 rect1XLineInc = 0; |
196 rect1XLineInc = 0; |
158 rect1YLineInc = -1; |
197 rect1YLineInc = -1; |
159 rect1XStart = image1Rect.x(); |
198 rect1XStart = image1Rect.x(); |
160 rect1YStart = image1Rect.y() + image1Rect.height() - 1; |
199 rect1YStart = image1Rect.y() + image1Rect.height() - 1; |
161 rect1XEnd = image1Rect.x() + image1Rect.width() - 1; |
200 rect1XEnd = image1Rect.x() + image1Rect.width() - 1; |
162 rect1YEnd = image1Rect.y(); |
201 rect1YEnd = image1Rect.y(); |
163 break; |
202 break; |
164 case 4: // TRANS_MIRROR_ROT270: |
203 case ETransMirrorRot270: |
165 rect1XInc = 0; |
204 rect1XInc = 0; |
166 rect1YInc = 1; |
205 rect1YInc = 1; |
167 rect1XLineInc = 1; |
206 rect1XLineInc = 1; |
168 rect1YLineInc = 0; |
207 rect1YLineInc = 0; |
169 rect1XStart = image1Rect.x(); |
208 rect1XStart = image1Rect.x(); |
173 break; |
212 break; |
174 default: |
213 default: |
175 break; |
214 break; |
176 } |
215 } |
177 |
216 |
178 switch(aTransform2) { |
217 switch(transform2) |
179 case 0: // TRANS_NONE: |
218 { |
|
219 case ETransNone: |
180 rect2XInc = 1; |
220 rect2XInc = 1; |
181 rect2YInc = 0; |
221 rect2YInc = 0; |
182 rect2XLineInc = 0; |
222 rect2XLineInc = 0; |
183 rect2YLineInc = 1; |
223 rect2YLineInc = 1; |
184 rect2XStart = image2Rect.x(); |
224 rect2XStart = image2Rect.x(); |
185 rect2YStart = image2Rect.y(); |
225 rect2YStart = image2Rect.y(); |
186 rect2XEnd = image2Rect.x() + image2Rect.width() - 1; |
226 rect2XEnd = image2Rect.x() + image2Rect.width() - 1; |
187 rect2YEnd = image2Rect.y() + image2Rect.height() - 1; |
227 rect2YEnd = image2Rect.y() + image2Rect.height() - 1; |
188 break; |
228 break; |
189 case 5: // TRANS_ROT90: |
229 case ETransRot90: |
190 rect2XInc = 0; |
230 rect2XInc = 0; |
191 rect2YInc = 1; |
231 rect2YInc = 1; |
192 rect2XLineInc = -1; |
232 rect2XLineInc = -1; |
193 rect2YLineInc = 0; |
233 rect2YLineInc = 0; |
194 rect2XStart = image2Rect.x() + image2Rect.width() -1; |
234 rect2XStart = image2Rect.x() + image2Rect.width() -1; |
195 rect2YStart = image2Rect.y(); |
235 rect2YStart = image2Rect.y(); |
196 rect2XEnd = image2Rect.x(); |
236 rect2XEnd = image2Rect.x(); |
197 rect2YEnd = image2Rect.y() + image2Rect.width() - 1; |
237 rect2YEnd = image2Rect.y() + image2Rect.height() - 1; |
198 break; |
238 break; |
199 case 3: // TRANS_ROT180: |
239 case ETransRot180: |
200 rect2XInc = -1; |
240 rect2XInc = -1; |
201 rect2YInc = 0; |
241 rect2YInc = 0; |
202 rect2XLineInc = 0; |
242 rect2XLineInc = 0; |
203 rect2YLineInc = -1; |
243 rect2YLineInc = -1; |
204 rect2XStart = image2Rect.x() + image2Rect.width() -1; |
244 rect2XStart = image2Rect.x() + image2Rect.width() -1; |
205 rect2YStart = image2Rect.y() + image2Rect.height() - 1; |
245 rect2YStart = image2Rect.y() + image2Rect.height() - 1; |
206 rect2XEnd = image2Rect.x(); |
246 rect2XEnd = image2Rect.x(); |
207 rect2YEnd = image2Rect.y(); |
247 rect2YEnd = image2Rect.y(); |
208 break; |
248 break; |
209 case 6: // TRANS_ROT270: |
249 case ETransRot270: |
210 rect2XInc = 0; |
250 rect2XInc = 0; |
211 rect2YInc = -1; |
251 rect2YInc = -1; |
212 rect2XLineInc = 1; |
252 rect2XLineInc = 1; |
213 rect2YLineInc = 0; |
253 rect2YLineInc = 0; |
214 rect2XStart = image2Rect.x(); |
254 rect2XStart = image2Rect.x(); |
215 rect2YStart = image2Rect.y() + image2Rect.height() - 1; |
255 rect2YStart = image2Rect.y() + image2Rect.height() - 1; |
216 rect2XEnd = image2Rect.x() + image2Rect.height() - 1; |
256 rect2XEnd = image2Rect.x() + image2Rect.height() - 1; |
217 rect2YEnd = image2Rect.y(); |
257 rect2YEnd = image2Rect.y(); |
218 break; |
258 break; |
219 case 2: // TRANS_MIRROR: |
259 case ETransMirror: |
220 rect2XInc = -1; |
260 rect2XInc = -1; |
221 rect2YInc = 0; |
261 rect2YInc = 0; |
222 rect2XLineInc = 0; |
262 rect2XLineInc = 0; |
223 rect2YLineInc = 1; |
263 rect2YLineInc = 1; |
224 rect2XStart = image2Rect.x() + image2Rect.width() - 1; |
264 rect2XStart = image2Rect.x() + image2Rect.width() - 1; |
225 rect2YStart = image2Rect.y(); |
265 rect2YStart = image2Rect.y(); |
226 rect2XEnd = image2Rect.x(); |
266 rect2XEnd = image2Rect.x(); |
227 rect2YEnd = image2Rect.y() + image2Rect.height() - 1; |
267 rect2YEnd = image2Rect.y() + image2Rect.height() - 1; |
228 break; |
268 break; |
229 case 7: // TRANS_MIRROR_ROT90: |
269 case ETransMirrorRot90: |
230 rect2XInc = 0; |
270 rect2XInc = 0; |
231 rect2YInc = -1; |
271 rect2YInc = -1; |
232 rect2XLineInc = -1; |
272 rect2XLineInc = -1; |
233 rect2YLineInc = 0; |
273 rect2YLineInc = 0; |
234 rect2XStart = image2Rect.x() + image2Rect.width() -1; |
274 rect2XStart = image2Rect.x() + image2Rect.width() -1; |
235 rect2YStart = image2Rect.y() + image2Rect.height() - 1; |
275 rect2YStart = image2Rect.y() + image2Rect.height() - 1; |
236 rect2XEnd = image2Rect.x(); |
276 rect2XEnd = image2Rect.x(); |
237 rect2YEnd = image2Rect.y(); |
277 rect2YEnd = image2Rect.y(); |
238 break; |
278 break; |
239 case 1: // TRANS_MIRROR_ROT180: |
279 case ETransMirrorRot180: |
240 rect2XInc = 1; |
280 rect2XInc = 1; |
241 rect2YInc = 0; |
281 rect2YInc = 0; |
242 rect2XLineInc = 0; |
282 rect2XLineInc = 0; |
243 rect2YLineInc = -1; |
283 rect2YLineInc = -1; |
244 rect2XStart = image2Rect.x(); |
284 rect2XStart = image2Rect.x(); |
245 rect2YStart = image2Rect.y() + image2Rect.height() - 1; |
285 rect2YStart = image2Rect.y() + image2Rect.height() - 1; |
246 rect2XEnd = image2Rect.x() + image2Rect.width() - 1; |
286 rect2XEnd = image2Rect.x() + image2Rect.width() - 1; |
247 rect2YEnd = image2Rect.y(); |
287 rect2YEnd = image2Rect.y(); |
248 break; |
288 break; |
249 case 4: // TRANS_MIRROR_ROT270: |
289 case ETransMirrorRot270: |
250 rect2XInc = 0; |
290 rect2XInc = 0; |
251 rect2YInc = 1; |
291 rect2YInc = 1; |
252 rect2XLineInc = 1; |
292 rect2XLineInc = 1; |
253 rect2YLineInc = 0; |
293 rect2YLineInc = 0; |
254 rect2XStart = image2Rect.x(); |
294 rect2XStart = image2Rect.x(); |
266 rect2X = rect2XStart; |
306 rect2X = rect2XStart; |
267 rect2Y = rect2YStart; |
307 rect2Y = rect2YStart; |
268 |
308 |
269 // Go through the intersection area pixel by pixel. |
309 // Go through the intersection area pixel by pixel. |
270 // Following code assumes that format is 32-bit RGBA or 32-bit RGB. |
310 // Following code assumes that format is 32-bit RGBA or 32-bit RGB. |
271 while(true) { |
311 while(true) |
|
312 { |
272 // Check is there hit: |
313 // Check is there hit: |
273 if(data1[rect1Y * totalWidth1 * 4 + rect1X * 4 + 3]) { |
314 if(data1[rect1Y * totalWidth1 * 4 + rect1X * 4 + 3]) |
274 if(data2[rect2Y * totalWidth2 * 4 + rect2X * 4 + 3]) { |
315 { |
|
316 if(data2[rect2Y * totalWidth2 * 4 + rect2X * 4 + 3]) |
|
317 { |
275 return true; |
318 return true; |
276 } |
319 } |
277 } |
320 } |
278 |
321 |
279 if((rect1X == rect1XEnd) && (rect1Y == rect1YEnd)) { |
322 if((rect1X == rect1XEnd) && (rect1Y == rect1YEnd)) |
|
323 { |
280 // Done, no hit: |
324 // Done, no hit: |
281 return false; |
325 return false; |
282 } |
326 } |
283 |
327 |
284 // Move to next line if in the end: |
328 // Move to next line if in the end: |
285 if(rect1XLineInc == 0) { |
329 if(rect1XLineInc == 0) |
286 if(rect1X == rect1XEnd) { |
330 { |
|
331 if(rect1X == rect1XEnd) |
|
332 { |
287 rect1X = rect1XStart - rect1XInc; |
333 rect1X = rect1XStart - rect1XInc; |
288 rect1Y += rect1YLineInc; |
334 rect1Y += rect1YLineInc; |
289 } |
335 } |
290 } |
336 } |
291 else { |
337 else |
292 if(rect1Y == rect1YEnd) { |
338 { |
|
339 if(rect1Y == rect1YEnd) |
|
340 { |
293 rect1Y = rect1YStart - rect1YInc; |
341 rect1Y = rect1YStart - rect1YInc; |
294 rect1X += rect1XLineInc; |
342 rect1X += rect1XLineInc; |
295 } |
343 } |
296 } |
344 } |
297 |
345 |
298 if(rect2XLineInc == 0) { |
346 if(rect2XLineInc == 0) |
299 if(rect2X == rect2XEnd) { |
347 { |
|
348 if(rect2X == rect2XEnd) |
|
349 { |
300 rect2X = rect2XStart - rect2XInc; |
350 rect2X = rect2XStart - rect2XInc; |
301 rect2Y += rect2YLineInc; |
351 rect2Y += rect2YLineInc; |
302 } |
352 } |
303 } |
353 } |
304 else { |
354 else |
305 if(rect2Y == rect2YEnd) { |
355 { |
|
356 if(rect2Y == rect2YEnd) |
|
357 { |
306 rect2Y = rect2YStart - rect2YInc; |
358 rect2Y = rect2YStart - rect2YInc; |
307 rect2X += rect2XLineInc; |
359 rect2X += rect2XLineInc; |
308 } |
360 } |
309 } |
361 } |
310 |
362 |
314 rect2X += rect2XInc; |
366 rect2X += rect2XInc; |
315 rect2Y += rect2YInc; |
367 rect2Y += rect2YInc; |
316 } |
368 } |
317 } |
369 } |
318 |
370 |
|
371 /** |
|
372 * Maps transform constants to Common Graphics. |
|
373 */ |
|
374 int gfxUtils::getCgTransformValue(int aTransform) |
|
375 { |
|
376 int retVal = ETransNone; |
|
377 switch(aTransform) |
|
378 { |
|
379 case ETransNoneType: |
|
380 retVal = ETransNone; |
|
381 break; |
|
382 case ETransRot90Type: |
|
383 retVal = ETransRot90; |
|
384 break; |
|
385 case ETransRot180Type: |
|
386 retVal = ETransRot180; |
|
387 break; |
|
388 case ETransRot270Type: |
|
389 retVal = ETransRot270; |
|
390 break; |
|
391 case ETransMirrorType: |
|
392 retVal = ETransMirror; |
|
393 break; |
|
394 case ETransMirrorRot90Type: |
|
395 retVal = ETransMirrorRot90; |
|
396 break; |
|
397 case ETransMirrorRot180Type: |
|
398 retVal = ETransMirrorRot180; |
|
399 break; |
|
400 case ETransMirrorRot270Type: |
|
401 retVal = ETransMirrorRot270; |
|
402 break; |
|
403 default: |
|
404 break; |
|
405 } |
|
406 return retVal; |
|
407 } |
319 } // namespace GFX |
408 } // namespace GFX |
320 } // namespace Java |
409 } // namespace Java |
321 |
410 |