qtransform.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qtransform.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7__attribute__((noinline))-
8static void nanWarning(const char *func)-
9{-
10 QMessageLogger(__FILE__, 60, __PRETTY_FUNCTION__).warning("QTransform::%s with NaN called", func);-
11}
never executed: end of block
0
12QTransform::QTransform()-
13 : affine(true)-
14 , m_13(0), m_23(0), m_33(1)-
15 , m_type(TxNone)-
16 , m_dirty(TxNone)-
17 , d(nullptr)-
18{-
19}
never executed: end of block
0
20QTransform::QTransform(qreal h11, qreal h12, qreal h13,-
21 qreal h21, qreal h22, qreal h23,-
22 qreal h31, qreal h32, qreal h33)-
23 : affine(h11, h12, h21, h22, h31, h32, true)-
24 , m_13(h13), m_23(h23), m_33(h33)-
25 , m_type(TxNone)-
26 , m_dirty(TxProject)-
27 , d(nullptr)-
28{-
29}
never executed: end of block
0
30QTransform::QTransform(qreal h11, qreal h12, qreal h21,-
31 qreal h22, qreal dx, qreal dy)-
32 : affine(h11, h12, h21, h22, dx, dy, true)-
33 , m_13(0), m_23(0), m_33(1)-
34 , m_type(TxNone)-
35 , m_dirty(TxShear)-
36 , d(nullptr)-
37{-
38}
never executed: end of block
0
39QTransform::QTransform(const QMatrix &mtx)-
40 : affine(mtx._m11, mtx._m12, mtx._m21, mtx._m22, mtx._dx, mtx._dy, true),-
41 m_13(0), m_23(0), m_33(1)-
42 , m_type(TxNone)-
43 , m_dirty(TxShear)-
44 , d(nullptr)-
45{-
46}
never executed: end of block
0
47-
48-
49-
50-
51QTransform QTransform::adjoint() const-
52{-
53 qreal h11, h12, h13,-
54 h21, h22, h23,-
55 h31, h32, h33;-
56 h11 = affine._m22*m_33 - m_23*affine._dy;-
57 h21 = m_23*affine._dx - affine._m21*m_33;-
58 h31 = affine._m21*affine._dy - affine._m22*affine._dx;-
59 h12 = m_13*affine._dy - affine._m12*m_33;-
60 h22 = affine._m11*m_33 - m_13*affine._dx;-
61 h32 = affine._m12*affine._dx - affine._m11*affine._dy;-
62 h13 = affine._m12*m_23 - m_13*affine._m22;-
63 h23 = m_13*affine._m21 - affine._m11*m_23;-
64 h33 = affine._m11*affine._m22 - affine._m12*affine._m21;-
65-
66 return
never executed: return QTransform(h11, h12, h13, h21, h22, h23, h31, h32, h33, true);
QTransform(h11, h12, h13,
never executed: return QTransform(h11, h12, h13, h21, h22, h23, h31, h32, h33, true);
0
67 h21, h22, h23,
never executed: return QTransform(h11, h12, h13, h21, h22, h23, h31, h32, h33, true);
0
68 h31, h32, h33, true);
never executed: return QTransform(h11, h12, h13, h21, h22, h23, h31, h32, h33, true);
0
69}-
70-
71-
72-
73-
74QTransform QTransform::transposed() const-
75{-
76 QTransform t(affine._m11, affine._m21, affine._dx,-
77 affine._m12, affine._m22, affine._dy,-
78 m_13, m_23, m_33, true);-
79 t.m_type = m_type;-
80 t.m_dirty = m_dirty;-
81 return
never executed: return t;
t;
never executed: return t;
0
82}-
83QTransform QTransform::inverted(bool *invertible) const-
84{-
85 QTransform invert(true);-
86 bool inv = true;-
87-
88 switch(inline_type()) {-
89 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
0
90 break;
never executed: break;
0
91 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
0
92 invert.affine._dx = -affine._dx;-
93 invert.affine._dy = -affine._dy;-
94 break;
never executed: break;
0
95 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
0
96 inv = !qFuzzyIsNull(affine._m11);-
97 inv &= !qFuzzyIsNull(affine._m22);-
98 if (inv
invDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
99 invert.affine._m11 = 1. / affine._m11;-
100 invert.affine._m22 = 1. / affine._m22;-
101 invert.affine._dx = -affine._dx * invert.affine._m11;-
102 invert.affine._dy = -affine._dy * invert.affine._m22;-
103 }
never executed: end of block
0
104 break;
never executed: break;
0
105 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
0
106 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
0
107 invert.affine = affine.inverted(&inv);-
108 break;
never executed: break;
0
109 default
never executed: default:
:
never executed: default:
0
110-
111 qreal det = determinant();-
112 inv = !qFuzzyIsNull(det);-
113 if (inv
invDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
114 invert = adjoint() / det;
never executed: invert = adjoint() / det;
0
115 break;
never executed: break;
0
116 }-
117-
118 if (invertible
invertibleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
119 *
never executed: *invertible = inv;
invertible = inv;
never executed: *invertible = inv;
0
120-
121 if (inv
invDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
122-
123 invert.m_type = m_type;-
124 invert.m_dirty = m_dirty;-
125 }
never executed: end of block
0
126-
127 return
never executed: return invert;
invert;
never executed: return invert;
0
128}-
129-
130-
131-
132-
133-
134-
135-
136QTransform &QTransform::translate(qreal dx, qreal dy)-
137{-
138 if (dx == 0
dx == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& dy == 0
dy == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
139 return
never executed: return *this;
*this;
never executed: return *this;
0
140-
141 if (qIsNaN(dx) | qIsNaN(dy)
qIsNaN(dx) | qIsNaN(dy)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
142 nanWarning("translate");-
143 return
never executed: return *this;
*this;
never executed: return *this;
0
144 }-
145-
146-
147 switch(inline_type()) {-
148 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
0
149 affine._dx = dx;-
150 affine._dy = dy;-
151 break;
never executed: break;
0
152 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
0
153 affine._dx += dx;-
154 affine._dy += dy;-
155 break;
never executed: break;
0
156 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
0
157 affine._dx += dx*affine._m11;-
158 affine._dy += dy*affine._m22;-
159 break;
never executed: break;
0
160 case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
0
161 m_33 += dx*m_13 + dy*m_23;-
162-
163 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
code before this statement never executed: case TxShear:
0
164 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
0
165 affine._dx += dx*affine._m11 + dy*affine._m21;-
166 affine._dy += dy*affine._m22 + dx*affine._m12;-
167 break;
never executed: break;
0
168 }-
169 if (m_dirty < TxTranslate
m_dirty < TxTranslateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
170 m_dirty = TxTranslate;
never executed: m_dirty = TxTranslate;
0
171 return
never executed: return *this;
*this;
never executed: return *this;
0
172}-
173QTransform QTransform::fromTranslate(qreal dx, qreal dy)-
174{-
175-
176 if (qIsNaN(dx) | qIsNaN(dy)
qIsNaN(dx) | qIsNaN(dy)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
177 nanWarning("fromTranslate");-
178 return
never executed: return QTransform();
QTransform();
never executed: return QTransform();
0
179}-
180-
181 QTransform transform(1, 0, 0, 0, 1, 0, dx, dy, 1, true);-
182 if (dx == 0
dx == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& dy == 0
dy == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
183 transform.m_type = TxNone;
never executed: transform.m_type = TxNone;
0
184 else-
185 transform.m_type = TxTranslate;
never executed: transform.m_type = TxTranslate;
0
186 transform.m_dirty = TxNone;-
187 return
never executed: return transform;
transform;
never executed: return transform;
0
188}-
189-
190-
191-
192-
193-
194-
195-
196QTransform & QTransform::scale(qreal sx, qreal sy)-
197{-
198 if (sx == 1
sx == 1Description
TRUEnever evaluated
FALSEnever evaluated
&& sy == 1
sy == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
199 return
never executed: return *this;
*this;
never executed: return *this;
0
200-
201 if (qIsNaN(sx) | qIsNaN(sy)
qIsNaN(sx) | qIsNaN(sy)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
202 nanWarning("scale");-
203 return
never executed: return *this;
*this;
never executed: return *this;
0
204 }-
205-
206-
207 switch(inline_type()) {-
208 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
0
209 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
0
210 affine._m11 = sx;-
211 affine._m22 = sy;-
212 break;
never executed: break;
0
213 case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
0
214 m_13 *= sx;-
215 m_23 *= sy;-
216-
217 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
code before this statement never executed: case TxRotate:
0
218 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
0
219 affine._m12 *= sx;-
220 affine._m21 *= sy;-
221-
222 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
code before this statement never executed: case TxScale:
0
223 affine._m11 *= sx;-
224 affine._m22 *= sy;-
225 break;
never executed: break;
0
226 }-
227 if (m_dirty < TxScale
m_dirty < TxScaleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
228 m_dirty = TxScale;
never executed: m_dirty = TxScale;
0
229 return
never executed: return *this;
*this;
never executed: return *this;
0
230}-
231QTransform QTransform::fromScale(qreal sx, qreal sy)-
232{-
233-
234 if (qIsNaN(sx) | qIsNaN(sy)
qIsNaN(sx) | qIsNaN(sy)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
235 nanWarning("fromScale");-
236 return
never executed: return QTransform();
QTransform();
never executed: return QTransform();
0
237}-
238-
239 QTransform transform(sx, 0, 0, 0, sy, 0, 0, 0, 1, true);-
240 if (sx == 1.
sx == 1.Description
TRUEnever evaluated
FALSEnever evaluated
&& sy == 1.
sy == 1.Description
TRUEnever evaluated
FALSEnever evaluated
)
0
241 transform.m_type = TxNone;
never executed: transform.m_type = TxNone;
0
242 else-
243 transform.m_type = TxScale;
never executed: transform.m_type = TxScale;
0
244 transform.m_dirty = TxNone;-
245 return
never executed: return transform;
transform;
never executed: return transform;
0
246}-
247-
248-
249-
250-
251-
252-
253-
254QTransform & QTransform::shear(qreal sh, qreal sv)-
255{-
256 if (sh == 0
sh == 0Description
TRUEnever evaluated
FALSEnever evaluated
&& sv == 0
sv == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
257 return
never executed: return *this;
*this;
never executed: return *this;
0
258-
259 if (qIsNaN(sh) | qIsNaN(sv)
qIsNaN(sh) | qIsNaN(sv)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
260 nanWarning("shear");-
261 return
never executed: return *this;
*this;
never executed: return *this;
0
262 }-
263-
264-
265 switch(inline_type()) {-
266 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
0
267 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
0
268 affine._m12 = sv;-
269 affine._m21 = sh;-
270 break;
never executed: break;
0
271 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
0
272 affine._m12 = sv*affine._m22;-
273 affine._m21 = sh*affine._m11;-
274 break;
never executed: break;
0
275 case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
{
0
276 qreal tm13 = sv*m_23;-
277 qreal tm23 = sh*m_13;-
278 m_13 += tm13;-
279 m_23 += tm23;-
280 }-
281-
282 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
code before this statement never executed: case TxRotate:
0
283 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
{
0
284 qreal tm11 = sv*affine._m21;-
285 qreal tm22 = sh*affine._m12;-
286 qreal tm12 = sv*affine._m22;-
287 qreal tm21 = sh*affine._m11;-
288 affine._m11 += tm11; affine._m12 += tm12;-
289 affine._m21 += tm21; affine._m22 += tm22;-
290 break;
never executed: break;
0
291 }-
292 }-
293 if (m_dirty < TxShear
m_dirty < TxShearDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
294 m_dirty = TxShear;
never executed: m_dirty = TxShear;
0
295 return
never executed: return *this;
*this;
never executed: return *this;
0
296}-
297-
298const qreal deg2rad = qreal(0.017453292519943295769);-
299const qreal inv_dist_to_plane = 1. / 1024.;-
300QTransform & QTransform::rotate(qreal a, Qt::Axis axis)-
301{-
302 if (a == 0
a == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
303 return
never executed: return *this;
*this;
never executed: return *this;
0
304-
305 if (qIsNaN(a)
qIsNaN(a)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
306 nanWarning("rotate");-
307 return
never executed: return *this;
*this;
never executed: return *this;
0
308 }-
309-
310-
311 qreal sina = 0;-
312 qreal cosa = 0;-
313 if (a == 90.
a == 90.Description
TRUEnever evaluated
FALSEnever evaluated
|| a == -270.
a == -270.Description
TRUEnever evaluated
FALSEnever evaluated
)
0
314 sina = 1.;
never executed: sina = 1.;
0
315 else if (a == 270.
a == 270.Description
TRUEnever evaluated
FALSEnever evaluated
|| a == -90.
a == -90.Description
TRUEnever evaluated
FALSEnever evaluated
)
0
316 sina = -1.;
never executed: sina = -1.;
0
317 else if (a == 180.
a == 180.Description
TRUEnever evaluated
FALSEnever evaluated
)
0
318 cosa = -1.;
never executed: cosa = -1.;
0
319 else{-
320 qreal b = deg2rad*a;-
321 sina = qSin(b);-
322 cosa = qCos(b);-
323 }
never executed: end of block
0
324-
325 if (axis == Qt::ZAxis
axis == Qt::ZAxisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
326 switch(inline_type()) {-
327 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
0
328 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
0
329 affine._m11 = cosa;-
330 affine._m12 = sina;-
331 affine._m21 = -sina;-
332 affine._m22 = cosa;-
333 break;
never executed: break;
0
334 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
{
0
335 qreal tm11 = cosa*affine._m11;-
336 qreal tm12 = sina*affine._m22;-
337 qreal tm21 = -sina*affine._m11;-
338 qreal tm22 = cosa*affine._m22;-
339 affine._m11 = tm11; affine._m12 = tm12;-
340 affine._m21 = tm21; affine._m22 = tm22;-
341 break;
never executed: break;
0
342 }-
343 case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
{
0
344 qreal tm13 = cosa*m_13 + sina*m_23;-
345 qreal tm23 = -sina*m_13 + cosa*m_23;-
346 m_13 = tm13;-
347 m_23 = tm23;-
348-
349 }-
350 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
code before this statement never executed: case TxRotate:
0
351 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
{
0
352 qreal tm11 = cosa*affine._m11 + sina*affine._m21;-
353 qreal tm12 = cosa*affine._m12 + sina*affine._m22;-
354 qreal tm21 = -sina*affine._m11 + cosa*affine._m21;-
355 qreal tm22 = -sina*affine._m12 + cosa*affine._m22;-
356 affine._m11 = tm11; affine._m12 = tm12;-
357 affine._m21 = tm21; affine._m22 = tm22;-
358 break;
never executed: break;
0
359 }-
360 }-
361 if (m_dirty < TxRotate
m_dirty < TxRotateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
362 m_dirty = TxRotate;
never executed: m_dirty = TxRotate;
0
363 }
never executed: end of block
else {
0
364 QTransform result;-
365 if (axis == Qt::YAxis
axis == Qt::YAxisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
366 result.affine._m11 = cosa;-
367 result.m_13 = -sina * inv_dist_to_plane;-
368 }
never executed: end of block
else {
0
369 result.affine._m22 = cosa;-
370 result.m_23 = -sina * inv_dist_to_plane;-
371 }
never executed: end of block
0
372 result.m_type = TxProject;-
373 *this = result * *this;-
374 }
never executed: end of block
0
375-
376 return
never executed: return *this;
*this;
never executed: return *this;
0
377}-
378QTransform & QTransform::rotateRadians(qreal a, Qt::Axis axis)-
379{-
380-
381 if (qIsNaN(a)
qIsNaN(a)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
382 nanWarning("rotateRadians");-
383 return
never executed: return *this;
*this;
never executed: return *this;
0
384 }-
385-
386 qreal sina = qSin(a);-
387 qreal cosa = qCos(a);-
388-
389 if (axis == Qt::ZAxis
axis == Qt::ZAxisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
390 switch(inline_type()) {-
391 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
0
392 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
0
393 affine._m11 = cosa;-
394 affine._m12 = sina;-
395 affine._m21 = -sina;-
396 affine._m22 = cosa;-
397 break;
never executed: break;
0
398 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
{
0
399 qreal tm11 = cosa*affine._m11;-
400 qreal tm12 = sina*affine._m22;-
401 qreal tm21 = -sina*affine._m11;-
402 qreal tm22 = cosa*affine._m22;-
403 affine._m11 = tm11; affine._m12 = tm12;-
404 affine._m21 = tm21; affine._m22 = tm22;-
405 break;
never executed: break;
0
406 }-
407 case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
{
0
408 qreal tm13 = cosa*m_13 + sina*m_23;-
409 qreal tm23 = -sina*m_13 + cosa*m_23;-
410 m_13 = tm13;-
411 m_23 = tm23;-
412-
413 }-
414 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
code before this statement never executed: case TxRotate:
0
415 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
{
0
416 qreal tm11 = cosa*affine._m11 + sina*affine._m21;-
417 qreal tm12 = cosa*affine._m12 + sina*affine._m22;-
418 qreal tm21 = -sina*affine._m11 + cosa*affine._m21;-
419 qreal tm22 = -sina*affine._m12 + cosa*affine._m22;-
420 affine._m11 = tm11; affine._m12 = tm12;-
421 affine._m21 = tm21; affine._m22 = tm22;-
422 break;
never executed: break;
0
423 }-
424 }-
425 if (m_dirty < TxRotate
m_dirty < TxRotateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
426 m_dirty = TxRotate;
never executed: m_dirty = TxRotate;
0
427 }
never executed: end of block
else {
0
428 QTransform result;-
429 if (axis == Qt::YAxis
axis == Qt::YAxisDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
430 result.affine._m11 = cosa;-
431 result.m_13 = -sina * inv_dist_to_plane;-
432 }
never executed: end of block
else {
0
433 result.affine._m22 = cosa;-
434 result.m_23 = -sina * inv_dist_to_plane;-
435 }
never executed: end of block
0
436 result.m_type = TxProject;-
437 *this = result * *this;-
438 }
never executed: end of block
0
439 return
never executed: return *this;
*this;
never executed: return *this;
0
440}-
441-
442-
443-
444-
445-
446-
447bool QTransform::operator==(const QTransform &o) const-
448{-
449 return
never executed: return affine._m11 == o.affine._m11 && affine._m12 == o.affine._m12 && affine._m21 == o.affine._m21 && affine._m22 == o.affine._m22 && affine._dx == o.affine._dx && affine._dy == o.affine._dy && m_13 == o.m_13 && m_23 == o.m_23 && m_33 == o.m_33;
affine._m11 == o.affine._m11 &&
never executed: return affine._m11 == o.affine._m11 && affine._m12 == o.affine._m12 && affine._m21 == o.affine._m21 && affine._m22 == o.affine._m22 && affine._dx == o.affine._dx && affine._dy == o.affine._dy && m_13 == o.m_13 && m_23 == o.m_23 && m_33 == o.m_33;
0
450 affine._m12 == o.affine._m12 &&
never executed: return affine._m11 == o.affine._m11 && affine._m12 == o.affine._m12 && affine._m21 == o.affine._m21 && affine._m22 == o.affine._m22 && affine._dx == o.affine._dx && affine._dy == o.affine._dy && m_13 == o.m_13 && m_23 == o.m_23 && m_33 == o.m_33;
0
451 affine._m21 == o.affine._m21 &&
never executed: return affine._m11 == o.affine._m11 && affine._m12 == o.affine._m12 && affine._m21 == o.affine._m21 && affine._m22 == o.affine._m22 && affine._dx == o.affine._dx && affine._dy == o.affine._dy && m_13 == o.m_13 && m_23 == o.m_23 && m_33 == o.m_33;
0
452 affine._m22 == o.affine._m22 &&
never executed: return affine._m11 == o.affine._m11 && affine._m12 == o.affine._m12 && affine._m21 == o.affine._m21 && affine._m22 == o.affine._m22 && affine._dx == o.affine._dx && affine._dy == o.affine._dy && m_13 == o.m_13 && m_23 == o.m_23 && m_33 == o.m_33;
0
453 affine._dx == o.affine._dx &&
never executed: return affine._m11 == o.affine._m11 && affine._m12 == o.affine._m12 && affine._m21 == o.affine._m21 && affine._m22 == o.affine._m22 && affine._dx == o.affine._dx && affine._dy == o.affine._dy && m_13 == o.m_13 && m_23 == o.m_23 && m_33 == o.m_33;
0
454 affine._dy == o.affine._dy &&
never executed: return affine._m11 == o.affine._m11 && affine._m12 == o.affine._m12 && affine._m21 == o.affine._m21 && affine._m22 == o.affine._m22 && affine._dx == o.affine._dx && affine._dy == o.affine._dy && m_13 == o.m_13 && m_23 == o.m_23 && m_33 == o.m_33;
0
455 m_13 == o.m_13 &&
never executed: return affine._m11 == o.affine._m11 && affine._m12 == o.affine._m12 && affine._m21 == o.affine._m21 && affine._m22 == o.affine._m22 && affine._dx == o.affine._dx && affine._dy == o.affine._dy && m_13 == o.m_13 && m_23 == o.m_23 && m_33 == o.m_33;
0
456 m_23 == o.m_23 &&
never executed: return affine._m11 == o.affine._m11 && affine._m12 == o.affine._m12 && affine._m21 == o.affine._m21 && affine._m22 == o.affine._m22 && affine._dx == o.affine._dx && affine._dy == o.affine._dy && m_13 == o.m_13 && m_23 == o.m_23 && m_33 == o.m_33;
0
457 m_33 == o.m_33;
never executed: return affine._m11 == o.affine._m11 && affine._m12 == o.affine._m12 && affine._m21 == o.affine._m21 && affine._m22 == o.affine._m22 && affine._dx == o.affine._dx && affine._dy == o.affine._dy && m_13 == o.m_13 && m_23 == o.m_23 && m_33 == o.m_33;
0
458}-
459uint qHash(const QTransform &key, uint seed) noexcept-
460{-
461 QtPrivate::QHashCombine hash;-
462 seed = hash(key.m11(), seed);-
463 seed = hash(key.m12(), seed);-
464 seed = hash(key.m21(), seed);-
465 seed = hash(key.m22(), seed);-
466 seed = hash(key.dx(), seed);-
467 seed = hash(key.dy(), seed);-
468 seed = hash(key.m13(), seed);-
469 seed = hash(key.m23(), seed);-
470 seed = hash(key.m33(), seed);-
471 return
never executed: return seed;
seed;
never executed: return seed;
0
472}-
473-
474-
475-
476-
477-
478-
479-
480bool QTransform::operator!=(const QTransform &o) const-
481{-
482 return
never executed: return !operator==(o);
!operator==(o);
never executed: return !operator==(o);
0
483}-
484QTransform & QTransform::operator*=(const QTransform &o)-
485{-
486 const TransformationType otherType = o.inline_type();-
487 if (otherType == TxNone
otherType == TxNoneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
488 return
never executed: return *this;
*this;
never executed: return *this;
0
489-
490 const TransformationType thisType = inline_type();-
491 if (thisType == TxNone
thisType == TxNoneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
492 return
never executed: return operator=(o);
operator=(o);
never executed: return operator=(o);
0
493-
494 TransformationType t = qMax(thisType, otherType);-
495 switch(t) {-
496 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
0
497 break;
never executed: break;
0
498 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
0
499 affine._dx += o.affine._dx;-
500 affine._dy += o.affine._dy;-
501 break;
never executed: break;
0
502 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
0
503 {-
504 qreal m11 = affine._m11*o.affine._m11;-
505 qreal m22 = affine._m22*o.affine._m22;-
506-
507 qreal m31 = affine._dx*o.affine._m11 + o.affine._dx;-
508 qreal m32 = affine._dy*o.affine._m22 + o.affine._dy;-
509-
510 affine._m11 = m11;-
511 affine._m22 = m22;-
512 affine._dx = m31; affine._dy = m32;-
513 break;
never executed: break;
0
514 }-
515 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
0
516 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
0
517 {-
518 qreal m11 = affine._m11*o.affine._m11 + affine._m12*o.affine._m21;-
519 qreal m12 = affine._m11*o.affine._m12 + affine._m12*o.affine._m22;-
520-
521 qreal m21 = affine._m21*o.affine._m11 + affine._m22*o.affine._m21;-
522 qreal m22 = affine._m21*o.affine._m12 + affine._m22*o.affine._m22;-
523-
524 qreal m31 = affine._dx*o.affine._m11 + affine._dy*o.affine._m21 + o.affine._dx;-
525 qreal m32 = affine._dx*o.affine._m12 + affine._dy*o.affine._m22 + o.affine._dy;-
526-
527 affine._m11 = m11; affine._m12 = m12;-
528 affine._m21 = m21; affine._m22 = m22;-
529 affine._dx = m31; affine._dy = m32;-
530 break;
never executed: break;
0
531 }-
532 case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
0
533 {-
534 qreal m11 = affine._m11*o.affine._m11 + affine._m12*o.affine._m21 + m_13*o.affine._dx;-
535 qreal m12 = affine._m11*o.affine._m12 + affine._m12*o.affine._m22 + m_13*o.affine._dy;-
536 qreal m13 = affine._m11*o.m_13 + affine._m12*o.m_23 + m_13*o.m_33;-
537-
538 qreal m21 = affine._m21*o.affine._m11 + affine._m22*o.affine._m21 + m_23*o.affine._dx;-
539 qreal m22 = affine._m21*o.affine._m12 + affine._m22*o.affine._m22 + m_23*o.affine._dy;-
540 qreal m23 = affine._m21*o.m_13 + affine._m22*o.m_23 + m_23*o.m_33;-
541-
542 qreal m31 = affine._dx*o.affine._m11 + affine._dy*o.affine._m21 + m_33*o.affine._dx;-
543 qreal m32 = affine._dx*o.affine._m12 + affine._dy*o.affine._m22 + m_33*o.affine._dy;-
544 qreal m33 = affine._dx*o.m_13 + affine._dy*o.m_23 + m_33*o.m_33;-
545-
546 affine._m11 = m11; affine._m12 = m12; m_13 = m13;-
547 affine._m21 = m21; affine._m22 = m22; m_23 = m23;-
548 affine._dx = m31; affine._dy = m32; m_33 = m33;-
549 }-
550 }
never executed: end of block
0
551-
552 m_dirty = t;-
553 m_type = t;-
554-
555 return
never executed: return *this;
*this;
never executed: return *this;
0
556}-
557QTransform QTransform::operator*(const QTransform &m) const-
558{-
559 const TransformationType otherType = m.inline_type();-
560 if (otherType == TxNone
otherType == TxNoneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
561 return
never executed: return *this;
*this;
never executed: return *this;
0
562-
563 const TransformationType thisType = inline_type();-
564 if (thisType == TxNone
thisType == TxNoneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
565 return
never executed: return m;
m;
never executed: return m;
0
566-
567 QTransform t(true);-
568 TransformationType type = qMax(thisType, otherType);-
569 switch(type) {-
570 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
0
571 break;
never executed: break;
0
572 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
0
573 t.affine._dx = affine._dx + m.affine._dx;-
574 t.affine._dy += affine._dy + m.affine._dy;-
575 break;
never executed: break;
0
576 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
0
577 {-
578 qreal m11 = affine._m11*m.affine._m11;-
579 qreal m22 = affine._m22*m.affine._m22;-
580-
581 qreal m31 = affine._dx*m.affine._m11 + m.affine._dx;-
582 qreal m32 = affine._dy*m.affine._m22 + m.affine._dy;-
583-
584 t.affine._m11 = m11;-
585 t.affine._m22 = m22;-
586 t.affine._dx = m31; t.affine._dy = m32;-
587 break;
never executed: break;
0
588 }-
589 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
0
590 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
0
591 {-
592 qreal m11 = affine._m11*m.affine._m11 + affine._m12*m.affine._m21;-
593 qreal m12 = affine._m11*m.affine._m12 + affine._m12*m.affine._m22;-
594-
595 qreal m21 = affine._m21*m.affine._m11 + affine._m22*m.affine._m21;-
596 qreal m22 = affine._m21*m.affine._m12 + affine._m22*m.affine._m22;-
597-
598 qreal m31 = affine._dx*m.affine._m11 + affine._dy*m.affine._m21 + m.affine._dx;-
599 qreal m32 = affine._dx*m.affine._m12 + affine._dy*m.affine._m22 + m.affine._dy;-
600-
601 t.affine._m11 = m11; t.affine._m12 = m12;-
602 t.affine._m21 = m21; t.affine._m22 = m22;-
603 t.affine._dx = m31; t.affine._dy = m32;-
604 break;
never executed: break;
0
605 }-
606 case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
0
607 {-
608 qreal m11 = affine._m11*m.affine._m11 + affine._m12*m.affine._m21 + m_13*m.affine._dx;-
609 qreal m12 = affine._m11*m.affine._m12 + affine._m12*m.affine._m22 + m_13*m.affine._dy;-
610 qreal m13 = affine._m11*m.m_13 + affine._m12*m.m_23 + m_13*m.m_33;-
611-
612 qreal m21 = affine._m21*m.affine._m11 + affine._m22*m.affine._m21 + m_23*m.affine._dx;-
613 qreal m22 = affine._m21*m.affine._m12 + affine._m22*m.affine._m22 + m_23*m.affine._dy;-
614 qreal m23 = affine._m21*m.m_13 + affine._m22*m.m_23 + m_23*m.m_33;-
615-
616 qreal m31 = affine._dx*m.affine._m11 + affine._dy*m.affine._m21 + m_33*m.affine._dx;-
617 qreal m32 = affine._dx*m.affine._m12 + affine._dy*m.affine._m22 + m_33*m.affine._dy;-
618 qreal m33 = affine._dx*m.m_13 + affine._dy*m.m_23 + m_33*m.m_33;-
619-
620 t.affine._m11 = m11; t.affine._m12 = m12; t.m_13 = m13;-
621 t.affine._m21 = m21; t.affine._m22 = m22; t.m_23 = m23;-
622 t.affine._dx = m31; t.affine._dy = m32; t.m_33 = m33;-
623 }-
624 }
never executed: end of block
0
625-
626 t.m_dirty = type;-
627 t.m_type = type;-
628-
629 return
never executed: return t;
t;
never executed: return t;
0
630}-
631QTransform & QTransform::operator=(const QTransform &matrix) noexcept-
632{-
633 affine._m11 = matrix.affine._m11;-
634 affine._m12 = matrix.affine._m12;-
635 affine._m21 = matrix.affine._m21;-
636 affine._m22 = matrix.affine._m22;-
637 affine._dx = matrix.affine._dx;-
638 affine._dy = matrix.affine._dy;-
639 m_13 = matrix.m_13;-
640 m_23 = matrix.m_23;-
641 m_33 = matrix.m_33;-
642 m_type = matrix.m_type;-
643 m_dirty = matrix.m_dirty;-
644-
645 return
never executed: return *this;
*this;
never executed: return *this;
0
646}-
647void QTransform::reset()-
648{-
649 affine._m11 = affine._m22 = m_33 = 1.0;-
650 affine._m12 = m_13 = affine._m21 = m_23 = affine._dx = affine._dy = 0;-
651 m_type = TxNone;-
652 m_dirty = TxNone;-
653}
never executed: end of block
0
654QDataStream & operator<<(QDataStream &s, const QTransform &m)-
655{-
656 s << double(m.m11())-
657 << double(m.m12())-
658 << double(m.m13())-
659 << double(m.m21())-
660 << double(m.m22())-
661 << double(m.m23())-
662 << double(m.m31())-
663 << double(m.m32())-
664 << double(m.m33());-
665 return
never executed: return s;
s;
never executed: return s;
0
666}-
667QDataStream & operator>>(QDataStream &s, QTransform &t)-
668{-
669 double m11, m12, m13,-
670 m21, m22, m23,-
671 m31, m32, m33;-
672-
673 s >> m11;-
674 s >> m12;-
675 s >> m13;-
676 s >> m21;-
677 s >> m22;-
678 s >> m23;-
679 s >> m31;-
680 s >> m32;-
681 s >> m33;-
682 t.setMatrix(m11, m12, m13,-
683 m21, m22, m23,-
684 m31, m32, m33);-
685 return
never executed: return s;
s;
never executed: return s;
0
686}-
687-
688-
689-
690-
691QDebug operator<<(QDebug dbg, const QTransform &m)-
692{-
693 static const char *const typeStr[] =-
694 {-
695 "TxNone",-
696 "TxTranslate",-
697 "TxScale",-
698 0,-
699 "TxRotate",-
700 0, 0, 0,-
701 "TxShear",-
702 0, 0, 0, 0, 0, 0, 0,-
703 "TxProject"-
704 };-
705-
706 QDebugStateSaver saver(dbg);-
707 dbg.nospace() << "QTransform(type=" << typeStr[m.type()] << ','-
708 << " 11=" << m.m11()-
709 << " 12=" << m.m12()-
710 << " 13=" << m.m13()-
711 << " 21=" << m.m21()-
712 << " 22=" << m.m22()-
713 << " 23=" << m.m23()-
714 << " 31=" << m.m31()-
715 << " 32=" << m.m32()-
716 << " 33=" << m.m33()-
717 << ')';-
718-
719 return
never executed: return dbg;
dbg;
never executed: return dbg;
0
720}-
721QPoint QTransform::map(const QPoint &p) const-
722{-
723 qreal fx = p.x();-
724 qreal fy = p.y();-
725-
726 qreal x = 0, y = 0;-
727-
728 TransformationType t = inline_type();-
729 switch(t) {-
730 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
0
731 x = fx;-
732 y = fy;-
733 break;
never executed: break;
0
734 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
0
735 x = fx + affine._dx;-
736 y = fy + affine._dy;-
737 break;
never executed: break;
0
738 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
0
739 x = affine._m11 * fx + affine._dx;-
740 y = affine._m22 * fy + affine._dy;-
741 break;
never executed: break;
0
742 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
0
743 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
0
744 case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
0
745 x = affine._m11 * fx + affine._m21 * fy + affine._dx;-
746 y = affine._m12 * fx + affine._m22 * fy + affine._dy;-
747 if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
748 qreal w = 1./(m_13 * fx + m_23 * fy + m_33);-
749 x *= w;-
750 y *= w;-
751 }
never executed: end of block
0
752 }
never executed: end of block
0
753 return
never executed: return QPoint(qRound(x), qRound(y));
QPoint(qRound(x), qRound(y));
never executed: return QPoint(qRound(x), qRound(y));
0
754}-
755QPointF QTransform::map(const QPointF &p) const-
756{-
757 qreal fx = p.x();-
758 qreal fy = p.y();-
759-
760 qreal x = 0, y = 0;-
761-
762 TransformationType t = inline_type();-
763 switch(t) {-
764 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
0
765 x = fx;-
766 y = fy;-
767 break;
never executed: break;
0
768 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
0
769 x = fx + affine._dx;-
770 y = fy + affine._dy;-
771 break;
never executed: break;
0
772 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
0
773 x = affine._m11 * fx + affine._dx;-
774 y = affine._m22 * fy + affine._dy;-
775 break;
never executed: break;
0
776 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
0
777 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
0
778 case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
0
779 x = affine._m11 * fx + affine._m21 * fy + affine._dx;-
780 y = affine._m12 * fx + affine._m22 * fy + affine._dy;-
781 if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
782 qreal w = 1./(m_13 * fx + m_23 * fy + m_33);-
783 x *= w;-
784 y *= w;-
785 }
never executed: end of block
0
786 }
never executed: end of block
0
787 return
never executed: return QPointF(x, y);
QPointF(x, y);
never executed: return QPointF(x, y);
0
788}-
789QLine QTransform::map(const QLine &l) const-
790{-
791 qreal fx1 = l.x1();-
792 qreal fy1 = l.y1();-
793 qreal fx2 = l.x2();-
794 qreal fy2 = l.y2();-
795-
796 qreal x1 = 0, y1 = 0, x2 = 0, y2 = 0;-
797-
798 TransformationType t = inline_type();-
799 switch(t) {-
800 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
0
801 x1 = fx1;-
802 y1 = fy1;-
803 x2 = fx2;-
804 y2 = fy2;-
805 break;
never executed: break;
0
806 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
0
807 x1 = fx1 + affine._dx;-
808 y1 = fy1 + affine._dy;-
809 x2 = fx2 + affine._dx;-
810 y2 = fy2 + affine._dy;-
811 break;
never executed: break;
0
812 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
0
813 x1 = affine._m11 * fx1 + affine._dx;-
814 y1 = affine._m22 * fy1 + affine._dy;-
815 x2 = affine._m11 * fx2 + affine._dx;-
816 y2 = affine._m22 * fy2 + affine._dy;-
817 break;
never executed: break;
0
818 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
0
819 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
0
820 case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
0
821 x1 = affine._m11 * fx1 + affine._m21 * fy1 + affine._dx;-
822 y1 = affine._m12 * fx1 + affine._m22 * fy1 + affine._dy;-
823 x2 = affine._m11 * fx2 + affine._m21 * fy2 + affine._dx;-
824 y2 = affine._m12 * fx2 + affine._m22 * fy2 + affine._dy;-
825 if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
826 qreal w = 1./(m_13 * fx1 + m_23 * fy1 + m_33);-
827 x1 *= w;-
828 y1 *= w;-
829 w = 1./(m_13 * fx2 + m_23 * fy2 + m_33);-
830 x2 *= w;-
831 y2 *= w;-
832 }
never executed: end of block
0
833 }
never executed: end of block
0
834 return
never executed: return QLine(qRound(x1), qRound(y1), qRound(x2), qRound(y2));
QLine(qRound(x1), qRound(y1), qRound(x2), qRound(y2));
never executed: return QLine(qRound(x1), qRound(y1), qRound(x2), qRound(y2));
0
835}-
836QLineF QTransform::map(const QLineF &l) const-
837{-
838 qreal fx1 = l.x1();-
839 qreal fy1 = l.y1();-
840 qreal fx2 = l.x2();-
841 qreal fy2 = l.y2();-
842-
843 qreal x1 = 0, y1 = 0, x2 = 0, y2 = 0;-
844-
845 TransformationType t = inline_type();-
846 switch(t) {-
847 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
0
848 x1 = fx1;-
849 y1 = fy1;-
850 x2 = fx2;-
851 y2 = fy2;-
852 break;
never executed: break;
0
853 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
0
854 x1 = fx1 + affine._dx;-
855 y1 = fy1 + affine._dy;-
856 x2 = fx2 + affine._dx;-
857 y2 = fy2 + affine._dy;-
858 break;
never executed: break;
0
859 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
0
860 x1 = affine._m11 * fx1 + affine._dx;-
861 y1 = affine._m22 * fy1 + affine._dy;-
862 x2 = affine._m11 * fx2 + affine._dx;-
863 y2 = affine._m22 * fy2 + affine._dy;-
864 break;
never executed: break;
0
865 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
0
866 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
0
867 case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
0
868 x1 = affine._m11 * fx1 + affine._m21 * fy1 + affine._dx;-
869 y1 = affine._m12 * fx1 + affine._m22 * fy1 + affine._dy;-
870 x2 = affine._m11 * fx2 + affine._m21 * fy2 + affine._dx;-
871 y2 = affine._m12 * fx2 + affine._m22 * fy2 + affine._dy;-
872 if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
873 qreal w = 1./(m_13 * fx1 + m_23 * fy1 + m_33);-
874 x1 *= w;-
875 y1 *= w;-
876 w = 1./(m_13 * fx2 + m_23 * fy2 + m_33);-
877 x2 *= w;-
878 y2 *= w;-
879 }
never executed: end of block
0
880 }
never executed: end of block
0
881 return
never executed: return QLineF(x1, y1, x2, y2);
QLineF(x1, y1, x2, y2);
never executed: return QLineF(x1, y1, x2, y2);
0
882}-
883-
884static QPolygonF mapProjective(const QTransform &transform, const QPolygonF &poly)-
885{-
886 if (poly.size() == 0
poly.size() == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
887 return
never executed: return poly;
poly;
never executed: return poly;
0
888-
889 if (poly.size() == 1
poly.size() == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
890 return
never executed: return QPolygonF() << transform.map(poly.at(0));
QPolygonF() << transform.map(poly.at(0));
never executed: return QPolygonF() << transform.map(poly.at(0));
0
891-
892 QPainterPath path;-
893 path.addPolygon(poly);-
894-
895 path = transform.map(path);-
896-
897 QPolygonF result;-
898 const int elementCount = path.elementCount();-
899 result.reserve(elementCount);-
900 for (int i = 0; i < elementCount
i < elementCountDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
901 result << path.elementAt(i);
never executed: result << path.elementAt(i);
0
902 return
never executed: return result;
result;
never executed: return result;
0
903}-
904QPolygonF QTransform::map(const QPolygonF &a) const-
905{-
906 TransformationType t = inline_type();-
907 if (t <= TxTranslate
t <= TxTranslateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
908 return
never executed: return a.translated(affine._dx, affine._dy);
a.translated(affine._dx, affine._dy);
never executed: return a.translated(affine._dx, affine._dy);
0
909-
910 if (t >= QTransform::TxProject
t >= QTransform::TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
911 return
never executed: return mapProjective(*this, a);
mapProjective(*this, a);
never executed: return mapProjective(*this, a);
0
912-
913 int size = a.size();-
914 int i;-
915 QPolygonF p(size);-
916 const QPointF *da = a.constData();-
917 QPointF *dp = p.data();-
918-
919 for(i = 0; i < size
i < sizeDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
920 do { qreal FX_ = da[i].xp; qreal FY_ = da[i].yp; switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
dp[i].xp = FX_; dp[i].yp = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
dp[i].xp = FX_ + affine._dx; dp[i].yp = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
dp[i].xp = affine._m11 * FX_ + affine._dx; dp[i].yp = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
dp[i].xp = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; dp[i].yp = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; dp[i].xp *= w; dp[i].yp *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
921 }
never executed: end of block
0
922 return
never executed: return p;
p;
never executed: return p;
0
923}-
924QPolygon QTransform::map(const QPolygon &a) const-
925{-
926 TransformationType t = inline_type();-
927 if (t <= TxTranslate
t <= TxTranslateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
928 return
never executed: return a.translated(qRound(affine._dx), qRound(affine._dy));
a.translated(qRound(affine._dx), qRound(affine._dy));
never executed: return a.translated(qRound(affine._dx), qRound(affine._dy));
0
929-
930 if (t >= QTransform::TxProject
t >= QTransform::TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
931 return
never executed: return mapProjective(*this, QPolygonF(a)).toPolygon();
mapProjective(*this, QPolygonF(a)).toPolygon();
never executed: return mapProjective(*this, QPolygonF(a)).toPolygon();
0
932-
933 int size = a.size();-
934 int i;-
935 QPolygon p(size);-
936 const QPoint *da = a.constData();-
937 QPoint *dp = p.data();-
938-
939 for(i = 0; i < size
i < sizeDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
940 qreal nx = 0, ny = 0;-
941 do { qreal FX_ = da[i].xp; qreal FY_ = da[i].yp; switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
nx = FX_; ny = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
nx = FX_ + affine._dx; ny = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
nx = affine._m11 * FX_ + affine._dx; ny = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
nx = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; ny = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; nx *= w; ny *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
942 dp[i].xp = qRound(nx);-
943 dp[i].yp = qRound(ny);-
944 }
never executed: end of block
0
945 return
never executed: return p;
p;
never executed: return p;
0
946}-
947extern QPainterPath qt_regionToPath(const QRegion &region);-
948QRegion QTransform::map(const QRegion &r) const-
949{-
950 TransformationType t = inline_type();-
951 if (t == TxNone
t == TxNoneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
952 return
never executed: return r;
r;
never executed: return r;
0
953-
954 if (t == TxTranslate
t == TxTranslateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
955 QRegion copy(r);-
956 copy.translate(qRound(affine._dx), qRound(affine._dy));-
957 return
never executed: return copy;
copy;
never executed: return copy;
0
958 }-
959-
960 if (t == TxScale
t == TxScaleDescription
TRUEnever evaluated
FALSEnever evaluated
&& r.rectCount() == 1
r.rectCount() == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
961 return
never executed: return QRegion(mapRect(r.boundingRect()));
QRegion(mapRect(r.boundingRect()));
never executed: return QRegion(mapRect(r.boundingRect()));
0
962-
963 QPainterPath p = map(qt_regionToPath(r));-
964 return
never executed: return p.toFillPolygon(QTransform()).toPolygon();
p.toFillPolygon(QTransform()).toPolygon();
never executed: return p.toFillPolygon(QTransform()).toPolygon();
0
965}-
966-
967struct QHomogeneousCoordinate-
968{-
969 qreal x;-
970 qreal y;-
971 qreal w;-
972-
973 QHomogeneousCoordinate() {}-
974 QHomogeneousCoordinate(qreal x_, qreal y_, qreal w_) : x(x_), y(y_), w(w_) {}
never executed: end of block
0
975-
976 const QPointF toPoint() const {-
977 qreal iw = 1. / w;-
978 return
never executed: return QPointF(x * iw, y * iw);
QPointF(x * iw, y * iw);
never executed: return QPointF(x * iw, y * iw);
0
979 }-
980};-
981-
982static inline QHomogeneousCoordinate mapHomogeneous(const QTransform &transform, const QPointF &p)-
983{-
984 QHomogeneousCoordinate c;-
985 c.x = transform.m11() * p.x() + transform.m21() * p.y() + transform.m31();-
986 c.y = transform.m12() * p.x() + transform.m22() * p.y() + transform.m32();-
987 c.w = transform.m13() * p.x() + transform.m23() * p.y() + transform.m33();-
988 return
never executed: return c;
c;
never executed: return c;
0
989}-
990-
991static inline bool lineTo_clipped(QPainterPath &path, const QTransform &transform, const QPointF &a, const QPointF &b,-
992 bool needsMoveTo, bool needsLineTo = true)-
993{-
994 QHomogeneousCoordinate ha = mapHomogeneous(transform, a);-
995 QHomogeneousCoordinate hb = mapHomogeneous(transform, b);-
996-
997 if (ha.w < (sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001)
ha.w < (sizeof...0001 : 0.0001)Description
TRUEnever evaluated
FALSEnever evaluated
&& hb.w < (sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001)
hb.w < (sizeof...0001 : 0.0001)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
998 return
never executed: return false;
false;
never executed: return false;
0
999-
1000 if (hb.w < (sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001)
hb.w < (sizeof...0001 : 0.0001)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1001 const qreal t = ((sizeof(qreal) == sizeof(double)
sizeof(qreal) ...sizeof(double)Description
TRUEnever evaluated
FALSEnever evaluated
? 0.000001 : 0.0001) - hb.w) / (ha.w - hb.w);
0
1002-
1003 hb.x += (ha.x - hb.x) * t;-
1004 hb.y += (ha.y - hb.y) * t;-
1005 hb.w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));-
1006 }
never executed: end of block
else if (ha.w < (sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001)
ha.w < (sizeof...0001 : 0.0001)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1007 const qreal t = ((sizeof(qreal) == sizeof(double)
sizeof(qreal) ...sizeof(double)Description
TRUEnever evaluated
FALSEnever evaluated
? 0.000001 : 0.0001) - ha.w) / (hb.w - ha.w);
0
1008-
1009 ha.x += (hb.x - ha.x) * t;-
1010 ha.y += (hb.y - ha.y) * t;-
1011 ha.w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));-
1012-
1013 const QPointF p = ha.toPoint();-
1014 if (needsMoveTo
needsMoveToDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1015 path.moveTo(p);-
1016 needsMoveTo = false;-
1017 }
never executed: end of block
else {
0
1018 path.lineTo(p);-
1019 }
never executed: end of block
0
1020 }-
1021-
1022 if (needsMoveTo
needsMoveToDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1023 path.moveTo(ha.toPoint());
never executed: path.moveTo(ha.toPoint());
0
1024-
1025 if (needsLineTo
needsLineToDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1026 path.lineTo(hb.toPoint());
never executed: path.lineTo(hb.toPoint());
0
1027-
1028 return
never executed: return true;
true;
never executed: return true;
0
1029}-
1030__attribute__((visibility("default"))) bool qt_scaleForTransform(const QTransform &transform, qreal *scale);-
1031-
1032static inline bool cubicTo_clipped(QPainterPath &path, const QTransform &transform, const QPointF &a, const QPointF &b, const QPointF &c, const QPointF &d, bool needsMoveTo)-
1033{-
1034-
1035-
1036-
1037 qreal scale;-
1038 qt_scaleForTransform(transform, &scale);-
1039-
1040 qreal curveThreshold = scale == 0
scale == 0Description
TRUEnever evaluated
FALSEnever evaluated
? qreal(0.25) : (qreal(0.25) / scale);
0
1041-
1042 QPolygonF segment = QBezier::fromPoints(a, b, c, d).toPolygon(curveThreshold);-
1043-
1044 for (int i = 0; i < segment.size() - 1
i < segment.size() - 1Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
1045 if (lineTo_clipped(path, transform, segment.at(i), segment.at(i+1), needsMoveTo)
lineTo_clipped..., needsMoveTo)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1046 needsMoveTo = false;
never executed: needsMoveTo = false;
0
1047-
1048 return
never executed: return !needsMoveTo;
!needsMoveTo;
never executed: return !needsMoveTo;
0
1049}-
1050-
1051static QPainterPath mapProjective(const QTransform &transform, const QPainterPath &path)-
1052{-
1053 QPainterPath result;-
1054-
1055 QPointF last;-
1056 QPointF lastMoveTo;-
1057 bool needsMoveTo = true;-
1058 for (int i = 0; i < path.elementCount()
i < path.elementCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1059 switch (path.elementAt(i).type) {-
1060 case
never executed: case QPainterPath::MoveToElement:
QPainterPath::MoveToElement:
never executed: case QPainterPath::MoveToElement:
0
1061 if (i > 0
i > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& lastMoveTo != last
lastMoveTo != lastDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1062 lineTo_clipped(result, transform, last, lastMoveTo, needsMoveTo);
never executed: lineTo_clipped(result, transform, last, lastMoveTo, needsMoveTo);
0
1063-
1064 lastMoveTo = path.elementAt(i);-
1065 last = path.elementAt(i);-
1066 needsMoveTo = true;-
1067 break;
never executed: break;
0
1068 case
never executed: case QPainterPath::LineToElement:
QPainterPath::LineToElement:
never executed: case QPainterPath::LineToElement:
0
1069 if (lineTo_clipped(result, transform, last, path.elementAt(i), needsMoveTo)
lineTo_clipped..., needsMoveTo)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1070 needsMoveTo = false;
never executed: needsMoveTo = false;
0
1071 last = path.elementAt(i);-
1072 break;
never executed: break;
0
1073 case
never executed: case QPainterPath::CurveToElement:
QPainterPath::CurveToElement:
never executed: case QPainterPath::CurveToElement:
0
1074 if (cubicTo_clipped(result, transform, last, path.elementAt(i), path.elementAt(i+1), path.elementAt(i+2), needsMoveTo)
cubicTo_clippe..., needsMoveTo)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1075 needsMoveTo = false;
never executed: needsMoveTo = false;
0
1076 i += 2;-
1077 last = path.elementAt(i);-
1078 break;
never executed: break;
0
1079 default
never executed: default:
:
never executed: default:
0
1080 ((!(false)) ? qt_assert("false",__FILE__,1642) : qt_noop());-
1081 }
never executed: end of block
0
1082 }-
1083-
1084 if (path.elementCount() > 0
path.elementCount() > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& lastMoveTo != last
lastMoveTo != lastDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1085 lineTo_clipped(result, transform, last, lastMoveTo, needsMoveTo, false);
never executed: lineTo_clipped(result, transform, last, lastMoveTo, needsMoveTo, false);
0
1086-
1087 result.setFillRule(path.fillRule());-
1088 return
never executed: return result;
result;
never executed: return result;
0
1089}-
1090QPainterPath QTransform::map(const QPainterPath &path) const-
1091{-
1092 TransformationType t = inline_type();-
1093 if (t == TxNone
t == TxNoneDescription
TRUEnever evaluated
FALSEnever evaluated
|| path.elementCount() == 0
path.elementCount() == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1094 return
never executed: return path;
path;
never executed: return path;
0
1095-
1096 if (t >= TxProject
t >= TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1097 return
never executed: return mapProjective(*this, path);
mapProjective(*this, path);
never executed: return mapProjective(*this, path);
0
1098-
1099 QPainterPath copy = path;-
1100-
1101 if (t == TxTranslate
t == TxTranslateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1102 copy.translate(affine._dx, affine._dy);-
1103 }
never executed: end of block
else {
0
1104 copy.detach();-
1105-
1106 for (int i=0; i<path.elementCount()
i<path.elementCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
1107 QPainterPath::Element &e = copy.d_ptr->elements[i];-
1108 do { qreal FX_ = e.x; qreal FY_ = e.y; switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
e.x = FX_; e.y = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
e.x = FX_ + affine._dx; e.y = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
e.x = affine._m11 * FX_ + affine._dx; e.y = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
e.x = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; e.y = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; e.x *= w; e.y *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1109 }
never executed: end of block
0
1110 }
never executed: end of block
0
1111-
1112 return
never executed: return copy;
copy;
never executed: return copy;
0
1113}-
1114QPolygon QTransform::mapToPolygon(const QRect &rect) const-
1115{-
1116 TransformationType t = inline_type();-
1117-
1118 QPolygon a(4);-
1119 qreal x[4] = { 0, 0, 0, 0 }, y[4] = { 0, 0, 0, 0 };-
1120 if (t <= TxScale
t <= TxScaleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1121 x[0] = affine._m11*rect.x() + affine._dx;-
1122 y[0] = affine._m22*rect.y() + affine._dy;-
1123 qreal w = affine._m11*rect.width();-
1124 qreal h = affine._m22*rect.height();-
1125 if (w < 0
w < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1126 w = -w;-
1127 x[0] -= w;-
1128 }
never executed: end of block
0
1129 if (h < 0
h < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1130 h = -h;-
1131 y[0] -= h;-
1132 }
never executed: end of block
0
1133 x[1] = x[0]+w;-
1134 x[2] = x[1];-
1135 x[3] = x[0];-
1136 y[1] = y[0];-
1137 y[2] = y[0]+h;-
1138 y[3] = y[2];-
1139 }
never executed: end of block
else {
0
1140 qreal right = rect.x() + rect.width();-
1141 qreal bottom = rect.y() + rect.height();-
1142 do { qreal FX_ = rect.x(); qreal FY_ = rect.y(); switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
x[0] = FX_; y[0] = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
x[0] = FX_ + affine._dx; y[0] = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
x[0] = affine._m11 * FX_ + affine._dx; y[0] = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
x[0] = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; y[0] = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; x[0] *= w; y[0] *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1143 do { qreal FX_ = right; qreal FY_ = rect.y(); switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
x[1] = FX_; y[1] = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
x[1] = FX_ + affine._dx; y[1] = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
x[1] = affine._m11 * FX_ + affine._dx; y[1] = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
x[1] = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; y[1] = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; x[1] *= w; y[1] *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1144 do { qreal FX_ = right; qreal FY_ = bottom; switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
x[2] = FX_; y[2] = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
x[2] = FX_ + affine._dx; y[2] = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
x[2] = affine._m11 * FX_ + affine._dx; y[2] = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
x[2] = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; y[2] = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; x[2] *= w; y[2] *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1145 do { qreal FX_ = rect.x(); qreal FY_ = bottom; switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
x[3] = FX_; y[3] = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
x[3] = FX_ + affine._dx; y[3] = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
x[3] = affine._m11 * FX_ + affine._dx; y[3] = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
x[3] = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; y[3] = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; x[3] *= w; y[3] *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1146 }
never executed: end of block
0
1147-
1148-
1149-
1150 a.setPoints(4, qRound(x[0]), qRound(y[0]),-
1151 qRound(x[1]), qRound(y[1]),-
1152 qRound(x[2]), qRound(y[2]),-
1153 qRound(x[3]), qRound(y[3]));-
1154 return
never executed: return a;
a;
never executed: return a;
0
1155}-
1156bool QTransform::squareToQuad(const QPolygonF &quad, QTransform &trans)-
1157{-
1158 if (quad.count() != 4
quad.count() != 4Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1159 return
never executed: return false;
false;
never executed: return false;
0
1160-
1161 qreal dx0 = quad[0].x();-
1162 qreal dx1 = quad[1].x();-
1163 qreal dx2 = quad[2].x();-
1164 qreal dx3 = quad[3].x();-
1165-
1166 qreal dy0 = quad[0].y();-
1167 qreal dy1 = quad[1].y();-
1168 qreal dy2 = quad[2].y();-
1169 qreal dy3 = quad[3].y();-
1170-
1171 double ax = dx0 - dx1 + dx2 - dx3;-
1172 double ay = dy0 - dy1 + dy2 - dy3;-
1173-
1174 if (!ax
!axDescription
TRUEnever evaluated
FALSEnever evaluated
&& !ay
!ayDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1175 trans.setMatrix(dx1 - dx0, dy1 - dy0, 0,-
1176 dx2 - dx1, dy2 - dy1, 0,-
1177 dx0, dy0, 1);-
1178 }
never executed: end of block
else {
0
1179 double ax1 = dx1 - dx2;-
1180 double ax2 = dx3 - dx2;-
1181 double ay1 = dy1 - dy2;-
1182 double ay2 = dy3 - dy2;-
1183-
1184-
1185 double gtop = ax * ay2 - ax2 * ay;-
1186 double htop = ax1 * ay - ax * ay1;-
1187 double bottom = ax1 * ay2 - ax2 * ay1;-
1188-
1189 double a, b, c, d, e, f, g, h;-
1190-
1191 if (!bottom
!bottomDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1192 return
never executed: return false;
false;
never executed: return false;
0
1193-
1194 g = gtop/bottom;-
1195 h = htop/bottom;-
1196-
1197 a = dx1 - dx0 + g * dx1;-
1198 b = dx3 - dx0 + h * dx3;-
1199 c = dx0;-
1200 d = dy1 - dy0 + g * dy1;-
1201 e = dy3 - dy0 + h * dy3;-
1202 f = dy0;-
1203-
1204 trans.setMatrix(a, d, g,-
1205 b, e, h,-
1206 c, f, 1.0);-
1207 }
never executed: end of block
0
1208-
1209 return
never executed: return true;
true;
never executed: return true;
0
1210}-
1211bool QTransform::quadToSquare(const QPolygonF &quad, QTransform &trans)-
1212{-
1213 if (!squareToQuad(quad, trans)
!squareToQuad(quad, trans)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1214 return
never executed: return false;
false;
never executed: return false;
0
1215-
1216 bool invertible = false;-
1217 trans = trans.inverted(&invertible);-
1218-
1219 return
never executed: return invertible;
invertible;
never executed: return invertible;
0
1220}-
1221bool QTransform::quadToQuad(const QPolygonF &one,-
1222 const QPolygonF &two,-
1223 QTransform &trans)-
1224{-
1225 QTransform stq;-
1226 if (!quadToSquare(one, trans)
!quadToSquare(one, trans)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1227 return
never executed: return false;
false;
never executed: return false;
0
1228 if (!squareToQuad(two, stq)
!squareToQuad(two, stq)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1229 return
never executed: return false;
false;
never executed: return false;
0
1230 trans *= stq;-
1231-
1232 return
never executed: return true;
true;
never executed: return true;
0
1233}-
1234void QTransform::setMatrix(qreal m11, qreal m12, qreal m13,-
1235 qreal m21, qreal m22, qreal m23,-
1236 qreal m31, qreal m32, qreal m33)-
1237{-
1238 affine._m11 = m11; affine._m12 = m12; m_13 = m13;-
1239 affine._m21 = m21; affine._m22 = m22; m_23 = m23;-
1240 affine._dx = m31; affine._dy = m32; m_33 = m33;-
1241 m_type = TxNone;-
1242 m_dirty = TxProject;-
1243}
never executed: end of block
0
1244-
1245static inline bool needsPerspectiveClipping(const QRectF &rect, const QTransform &transform)-
1246{-
1247 const qreal wx = qMin(transform.m13() * rect.left(), transform.m13() * rect.right());-
1248 const qreal wy = qMin(transform.m23() * rect.top(), transform.m23() * rect.bottom());-
1249-
1250 return
never executed: return wx + wy + transform.m33() < (sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001);
wx + wy + transform.m33() < (sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001);
never executed: return wx + wy + transform.m33() < (sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001);
0
1251}-
1252-
1253QRect QTransform::mapRect(const QRect &rect) const-
1254{-
1255 TransformationType t = inline_type();-
1256 if (t <= TxTranslate
t <= TxTranslateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1257 return
never executed: return rect.translated(qRound(affine._dx), qRound(affine._dy));
rect.translated(qRound(affine._dx), qRound(affine._dy));
never executed: return rect.translated(qRound(affine._dx), qRound(affine._dy));
0
1258-
1259 if (t <= TxScale
t <= TxScaleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1260 int x = qRound(affine._m11*rect.x() + affine._dx);-
1261 int y = qRound(affine._m22*rect.y() + affine._dy);-
1262 int w = qRound(affine._m11*rect.width());-
1263 int h = qRound(affine._m22*rect.height());-
1264 if (w < 0
w < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1265 w = -w;-
1266 x -= w;-
1267 }
never executed: end of block
0
1268 if (h < 0
h < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1269 h = -h;-
1270 y -= h;-
1271 }
never executed: end of block
0
1272 return
never executed: return QRect(x, y, w, h);
QRect(x, y, w, h);
never executed: return QRect(x, y, w, h);
0
1273 } else if (t < TxProject
t < TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
|| !needsPerspectiveClipping(rect, *this)
!needsPerspect...g(rect, *this)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1274-
1275 qreal x = 0, y = 0;-
1276 do { qreal FX_ = rect.left(); qreal FY_ = rect.top(); switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
x = FX_; y = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
x = FX_ + affine._dx; y = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
x = affine._m11 * FX_ + affine._dx; y = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
x = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; y = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; x *= w; y *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1277 qreal xmin = x;-
1278 qreal ymin = y;-
1279 qreal xmax = x;-
1280 qreal ymax = y;-
1281 do { qreal FX_ = rect.right() + 1; qreal FY_ = rect.top(); switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
x = FX_; y = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
x = FX_ + affine._dx; y = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
x = affine._m11 * FX_ + affine._dx; y = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
x = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; y = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; x *= w; y *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1282 xmin = qMin(xmin, x);-
1283 ymin = qMin(ymin, y);-
1284 xmax = qMax(xmax, x);-
1285 ymax = qMax(ymax, y);-
1286 do { qreal FX_ = rect.right() + 1; qreal FY_ = rect.bottom() + 1; switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
x = FX_; y = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
x = FX_ + affine._dx; y = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
x = affine._m11 * FX_ + affine._dx; y = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
x = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; y = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; x *= w; y *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1287 xmin = qMin(xmin, x);-
1288 ymin = qMin(ymin, y);-
1289 xmax = qMax(xmax, x);-
1290 ymax = qMax(ymax, y);-
1291 do { qreal FX_ = rect.left(); qreal FY_ = rect.bottom() + 1; switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
x = FX_; y = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
x = FX_ + affine._dx; y = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
x = affine._m11 * FX_ + affine._dx; y = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
x = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; y = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; x *= w; y *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1292 xmin = qMin(xmin, x);-
1293 ymin = qMin(ymin, y);-
1294 xmax = qMax(xmax, x);-
1295 ymax = qMax(ymax, y);-
1296 return
never executed: return QRect(qRound(xmin), qRound(ymin), qRound(xmax)-qRound(xmin), qRound(ymax)-qRound(ymin));
QRect(qRound(xmin), qRound(ymin), qRound(xmax)-qRound(xmin), qRound(ymax)-qRound(ymin));
never executed: return QRect(qRound(xmin), qRound(ymin), qRound(xmax)-qRound(xmin), qRound(ymax)-qRound(ymin));
0
1297 } else {-
1298 QPainterPath path;-
1299 path.addRect(rect);-
1300 return
never executed: return map(path).boundingRect().toRect();
map(path).boundingRect().toRect();
never executed: return map(path).boundingRect().toRect();
0
1301 }-
1302}-
1303QRectF QTransform::mapRect(const QRectF &rect) const-
1304{-
1305 TransformationType t = inline_type();-
1306 if (t <= TxTranslate
t <= TxTranslateDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1307 return
never executed: return rect.translated(affine._dx, affine._dy);
rect.translated(affine._dx, affine._dy);
never executed: return rect.translated(affine._dx, affine._dy);
0
1308-
1309 if (t <= TxScale
t <= TxScaleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1310 qreal x = affine._m11*rect.x() + affine._dx;-
1311 qreal y = affine._m22*rect.y() + affine._dy;-
1312 qreal w = affine._m11*rect.width();-
1313 qreal h = affine._m22*rect.height();-
1314 if (w < 0
w < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1315 w = -w;-
1316 x -= w;-
1317 }
never executed: end of block
0
1318 if (h < 0
h < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1319 h = -h;-
1320 y -= h;-
1321 }
never executed: end of block
0
1322 return
never executed: return QRectF(x, y, w, h);
QRectF(x, y, w, h);
never executed: return QRectF(x, y, w, h);
0
1323 } else if (t < TxProject
t < TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
|| !needsPerspectiveClipping(rect, *this)
!needsPerspect...g(rect, *this)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1324 qreal x = 0, y = 0;-
1325 do { qreal FX_ = rect.x(); qreal FY_ = rect.y(); switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
x = FX_; y = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
x = FX_ + affine._dx; y = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
x = affine._m11 * FX_ + affine._dx; y = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
x = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; y = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; x *= w; y *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1326 qreal xmin = x;-
1327 qreal ymin = y;-
1328 qreal xmax = x;-
1329 qreal ymax = y;-
1330 do { qreal FX_ = rect.x() + rect.width(); qreal FY_ = rect.y(); switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
x = FX_; y = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
x = FX_ + affine._dx; y = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
x = affine._m11 * FX_ + affine._dx; y = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
x = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; y = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; x *= w; y *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1331 xmin = qMin(xmin, x);-
1332 ymin = qMin(ymin, y);-
1333 xmax = qMax(xmax, x);-
1334 ymax = qMax(ymax, y);-
1335 do { qreal FX_ = rect.x() + rect.width(); qreal FY_ = rect.y() + rect.height(); switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
x = FX_; y = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
x = FX_ + affine._dx; y = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
x = affine._m11 * FX_ + affine._dx; y = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
x = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; y = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; x *= w; y *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1336 xmin = qMin(xmin, x);-
1337 ymin = qMin(ymin, y);-
1338 xmax = qMax(xmax, x);-
1339 ymax = qMax(ymax, y);-
1340 do { qreal FX_ = rect.x(); qreal FY_ = rect.y() + rect.height(); switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
x = FX_; y = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
x = FX_ + affine._dx; y = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
x = affine._m11 * FX_ + affine._dx; y = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
x = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; y = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; x *= w; y *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1341 xmin = qMin(xmin, x);-
1342 ymin = qMin(ymin, y);-
1343 xmax = qMax(xmax, x);-
1344 ymax = qMax(ymax, y);-
1345 return
never executed: return QRectF(xmin, ymin, xmax-xmin, ymax - ymin);
QRectF(xmin, ymin, xmax-xmin, ymax - ymin);
never executed: return QRectF(xmin, ymin, xmax-xmin, ymax - ymin);
0
1346 } else {-
1347 QPainterPath path;-
1348 path.addRect(rect);-
1349 return
never executed: return map(path).boundingRect();
map(path).boundingRect();
never executed: return map(path).boundingRect();
0
1350 }-
1351}-
1352void QTransform::map(qreal x, qreal y, qreal *tx, qreal *ty) const-
1353{-
1354 TransformationType t = inline_type();-
1355 do { qreal FX_ = x; qreal FY_ = y; switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
*tx = FX_; *ty = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
*tx = FX_ + affine._dx; *ty = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
*tx = affine._m11 * FX_ + affine._dx; *ty = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
*tx = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; *ty = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; *tx *= w; *ty *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1356}
never executed: end of block
0
1357void QTransform::map(int x, int y, int *tx, int *ty) const-
1358{-
1359 TransformationType t = inline_type();-
1360 qreal fx = 0, fy = 0;-
1361 do { qreal FX_ = x; qreal FY_ = y; switch(t) { case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
fx = FX_; fy = FY_; break;
never executed: break;
case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
fx = FX_ + affine._dx; fy = FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
fx = affine._m11 * FX_ + affine._dx; fy = affine._m22 * FY_ + affine._dy; break;
never executed: break;
case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
fx = affine._m11 * FX_ + affine._m21 * FY_ + affine._dx; fy = affine._m12 * FX_ + affine._m22 * FY_ + affine._dy; if (t == TxProject
t == TxProjectDescription
TRUEnever evaluated
FALSEnever evaluated
) { qreal w = (m_13 * FX_ + m_23 * FY_ + m_33); if (w < qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001))
w < qreal((siz...001 : 0.0001))Description
TRUEnever evaluated
FALSEnever evaluated
) w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
never executed: w = qreal((sizeof(qreal) == sizeof(double) ? 0.000001 : 0.0001));
w = 1./w; fx *= w; fy *= w; }
never executed: end of block
}
never executed: end of block
} while (0);
0
1362 *tx = qRound(fx);-
1363 *ty = qRound(fy);-
1364}
never executed: end of block
0
1365-
1366-
1367-
1368-
1369-
1370-
1371-
1372const QMatrix &QTransform::toAffine() const-
1373{-
1374 return
never executed: return affine;
affine;
never executed: return affine;
0
1375}-
1376QTransform::TransformationType QTransform::type() const-
1377{-
1378 if(m_dirty == TxNone
m_dirty == TxNoneDescription
TRUEnever evaluated
FALSEnever evaluated
|| m_dirty < m_type
m_dirty < m_typeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1379 return
never executed: return static_cast<TransformationType>(m_type);
static_cast<TransformationType>(m_type);
never executed: return static_cast<TransformationType>(m_type);
0
1380-
1381 switch (static_cast<TransformationType>(m_dirty)) {-
1382 case
never executed: case TxProject:
TxProject:
never executed: case TxProject:
0
1383 if (!qFuzzyIsNull(m_13)
!qFuzzyIsNull(m_13)Description
TRUEnever evaluated
FALSEnever evaluated
|| !qFuzzyIsNull(m_23)
!qFuzzyIsNull(m_23)Description
TRUEnever evaluated
FALSEnever evaluated
|| !qFuzzyIsNull(m_33 - 1)
!qFuzzyIsNull(m_33 - 1)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1384 m_type = TxProject;-
1385 break;
never executed: break;
0
1386 }-
1387 case
never executed: case TxShear:
TxShear:
never executed: case TxShear:
code before this statement never executed: case TxShear:
0
1388 case
never executed: case TxRotate:
TxRotate:
never executed: case TxRotate:
0
1389 if (!qFuzzyIsNull(affine._m12)
!qFuzzyIsNull(affine._m12)Description
TRUEnever evaluated
FALSEnever evaluated
|| !qFuzzyIsNull(affine._m21)
!qFuzzyIsNull(affine._m21)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1390 const qreal dot = affine._m11 * affine._m12 + affine._m21 * affine._m22;-
1391 if (qFuzzyIsNull(dot)
qFuzzyIsNull(dot)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1392 m_type = TxRotate;
never executed: m_type = TxRotate;
0
1393 else-
1394 m_type = TxShear;
never executed: m_type = TxShear;
0
1395 break;
never executed: break;
0
1396 }-
1397 case
never executed: case TxScale:
TxScale:
never executed: case TxScale:
code before this statement never executed: case TxScale:
0
1398 if (!qFuzzyIsNull(affine._m11 - 1)
!qFuzzyIsNull(affine._m11 - 1)Description
TRUEnever evaluated
FALSEnever evaluated
|| !qFuzzyIsNull(affine._m22 - 1)
!qFuzzyIsNull(affine._m22 - 1)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1399 m_type = TxScale;-
1400 break;
never executed: break;
0
1401 }-
1402 case
never executed: case TxTranslate:
TxTranslate:
never executed: case TxTranslate:
code before this statement never executed: case TxTranslate:
0
1403 if (!qFuzzyIsNull(affine._dx)
!qFuzzyIsNull(affine._dx)Description
TRUEnever evaluated
FALSEnever evaluated
|| !qFuzzyIsNull(affine._dy)
!qFuzzyIsNull(affine._dy)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1404 m_type = TxTranslate;-
1405 break;
never executed: break;
0
1406 }-
1407 case
never executed: case TxNone:
TxNone:
never executed: case TxNone:
code before this statement never executed: case TxNone:
0
1408 m_type = TxNone;-
1409 break;
never executed: break;
0
1410 }-
1411-
1412 m_dirty = TxNone;-
1413 return
never executed: return static_cast<TransformationType>(m_type);
static_cast<TransformationType>(m_type);
never executed: return static_cast<TransformationType>(m_type);
0
1414}-
1415-
1416-
1417-
1418-
1419-
1420QTransform::operator QVariant() const-
1421{-
1422 return
never executed: return QVariant(QVariant::Transform, this);
QVariant(QVariant::Transform, this);
never executed: return QVariant(QVariant::Transform, this);
0
1423}-
1424__attribute__((visibility("default")))-
1425bool qt_scaleForTransform(const QTransform &transform, qreal *scale)-
1426{-
1427 const QTransform::TransformationType type = transform.type();-
1428 if (type <= QTransform::TxTranslate
type <= QTrans...m::TxTranslateDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1429 if (scale
scaleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1430 *
never executed: *scale = 1;
scale = 1;
never executed: *scale = 1;
0
1431 return
never executed: return true;
true;
never executed: return true;
0
1432 } else if (type == QTransform::TxScale
type == QTransform::TxScaleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
1433 const qreal xScale = qAbs(transform.m11());-
1434 const qreal yScale = qAbs(transform.m22());-
1435 if (scale
scaleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1436 *
never executed: *scale = qMax(xScale, yScale);
scale = qMax(xScale, yScale);
never executed: *scale = qMax(xScale, yScale);
0
1437 return
never executed: return qFuzzyCompare(xScale, yScale);
qFuzzyCompare(xScale, yScale);
never executed: return qFuzzyCompare(xScale, yScale);
0
1438 }-
1439-
1440-
1441 const qreal xScale1 = transform.m11() * transform.m11()-
1442 + transform.m21() * transform.m21();-
1443 const qreal yScale1 = transform.m12() * transform.m12()-
1444 + transform.m22() * transform.m22();-
1445-
1446-
1447 const qreal xScale2 = transform.m11() * transform.m11()-
1448 + transform.m12() * transform.m12();-
1449 const qreal yScale2 = transform.m21() * transform.m21()-
1450 + transform.m22() * transform.m22();-
1451-
1452-
1453 if (qAbs(xScale1 - yScale1) > qAbs(xScale2 - yScale2)
qAbs(xScale1 -...le2 - yScale2)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
1454 if (scale
scaleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1455 *
never executed: *scale = qSqrt(qMax(xScale1, yScale1));
scale = qSqrt(qMax(xScale1, yScale1));
never executed: *scale = qSqrt(qMax(xScale1, yScale1));
0
1456-
1457 return
never executed: return type == QTransform::TxRotate && qFuzzyCompare(xScale1, yScale1);
type == QTransform::TxRotate && qFuzzyCompare(xScale1, yScale1);
never executed: return type == QTransform::TxRotate && qFuzzyCompare(xScale1, yScale1);
0
1458 } else {-
1459 if (scale
scaleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
1460 *
never executed: *scale = qSqrt(qMax(xScale2, yScale2));
scale = qSqrt(qMax(xScale2, yScale2));
never executed: *scale = qSqrt(qMax(xScale2, yScale2));
0
1461-
1462 return
never executed: return type == QTransform::TxRotate && qFuzzyCompare(xScale2, yScale2);
type == QTransform::TxRotate && qFuzzyCompare(xScale2, yScale2);
never executed: return type == QTransform::TxRotate && qFuzzyCompare(xScale2, yScale2);
0
1463 }-
1464}-
1465-
1466-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9