qmatrix.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qmatrix.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QMatrix::QMatrix()-
6 : _m11(1.)-
7 , _m12(0.)-
8 , _m21(0.)-
9 , _m22(1.)-
10 , _dx(0.)-
11 , _dy(0.)-
12{-
13}
never executed: end of block
0
14QMatrix::QMatrix(qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy)-
15 : _m11(m11)-
16 , _m12(m12)-
17 , _m21(m21)-
18 , _m22(m22)-
19 , _dx(dx)-
20 , _dy(dy)-
21{-
22}
never executed: end of block
0
23-
24-
25-
26-
27-
28QMatrix::QMatrix(const QMatrix &matrix) noexcept-
29 : _m11(matrix._m11)-
30 , _m12(matrix._m12)-
31 , _m21(matrix._m21)-
32 , _m22(matrix._m22)-
33 , _dx(matrix._dx)-
34 , _dy(matrix._dy)-
35{-
36}
never executed: end of block
0
37void QMatrix::setMatrix(qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy)-
38{-
39 _m11 = m11;-
40 _m12 = m12;-
41 _m21 = m21;-
42 _m22 = m22;-
43 _dx = dx;-
44 _dy = dy;-
45}
never executed: end of block
0
46void QMatrix::map(qreal x, qreal y, qreal *tx, qreal *ty) const-
47{-
48 { qreal fx = x; qreal fy = y; *tx = _m11*fx + _m21*fy + _dx; *ty = _m12*fx + _m22*fy + _dy; };-
49}
never executed: end of block
0
50void QMatrix::map(int x, int y, int *tx, int *ty) const-
51{-
52 { qreal fx = x; qreal fy = y; *tx = qRound(_m11*fx + _m21*fy + _dx); *ty = qRound(_m12*fx + _m22*fy + _dy); };-
53}
never executed: end of block
0
54-
55QRect QMatrix::mapRect(const QRect &rect) const-
56{-
57 QRect result;-
58 if (_m12 == 0.0F
_m12 == 0.0FDescription
TRUEnever evaluated
FALSEnever evaluated
&& _m21 == 0.0F
_m21 == 0.0FDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
59 int x = qRound(_m11*rect.x() + _dx);-
60 int y = qRound(_m22*rect.y() + _dy);-
61 int w = qRound(_m11*rect.width());-
62 int h = qRound(_m22*rect.height());-
63 if (w < 0
w < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
64 w = -w;-
65 x -= w;-
66 }
never executed: end of block
0
67 if (h < 0
h < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
68 h = -h;-
69 y -= h;-
70 }
never executed: end of block
0
71 result = QRect(x, y, w, h);-
72 }
never executed: end of block
else {
0
73-
74 qreal x0, y0;-
75 qreal x, y;-
76 { qreal fx = rect.left(); qreal fy = rect.top(); x0 = _m11*fx + _m21*fy + _dx; y0 = _m12*fx + _m22*fy + _dy; };-
77 qreal xmin = x0;-
78 qreal ymin = y0;-
79 qreal xmax = x0;-
80 qreal ymax = y0;-
81 { qreal fx = rect.right() + 1; qreal fy = rect.top(); x = _m11*fx + _m21*fy + _dx; y = _m12*fx + _m22*fy + _dy; };-
82 xmin = qMin(xmin, x);-
83 ymin = qMin(ymin, y);-
84 xmax = qMax(xmax, x);-
85 ymax = qMax(ymax, y);-
86 { qreal fx = rect.right() + 1; qreal fy = rect.bottom() + 1; x = _m11*fx + _m21*fy + _dx; y = _m12*fx + _m22*fy + _dy; };-
87 xmin = qMin(xmin, x);-
88 ymin = qMin(ymin, y);-
89 xmax = qMax(xmax, x);-
90 ymax = qMax(ymax, y);-
91 { qreal fx = rect.left(); qreal fy = rect.bottom() + 1; x = _m11*fx + _m21*fy + _dx; y = _m12*fx + _m22*fy + _dy; };-
92 xmin = qMin(xmin, x);-
93 ymin = qMin(ymin, y);-
94 xmax = qMax(xmax, x);-
95 ymax = qMax(ymax, y);-
96 result = QRect(qRound(xmin), qRound(ymin), qRound(xmax)-qRound(xmin), qRound(ymax)-qRound(ymin));-
97 }
never executed: end of block
0
98 return
never executed: return result;
result;
never executed: return result;
0
99}-
100QRectF QMatrix::mapRect(const QRectF &rect) const-
101{-
102 QRectF result;-
103 if (_m12 == 0.0F
_m12 == 0.0FDescription
TRUEnever evaluated
FALSEnever evaluated
&& _m21 == 0.0F
_m21 == 0.0FDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
104 qreal x = _m11*rect.x() + _dx;-
105 qreal y = _m22*rect.y() + _dy;-
106 qreal w = _m11*rect.width();-
107 qreal h = _m22*rect.height();-
108 if (w < 0
w < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
109 w = -w;-
110 x -= w;-
111 }
never executed: end of block
0
112 if (h < 0
h < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
113 h = -h;-
114 y -= h;-
115 }
never executed: end of block
0
116 result = QRectF(x, y, w, h);-
117 }
never executed: end of block
else {
0
118 qreal x0, y0;-
119 qreal x, y;-
120 { qreal fx = rect.x(); qreal fy = rect.y(); x0 = _m11*fx + _m21*fy + _dx; y0 = _m12*fx + _m22*fy + _dy; };-
121 qreal xmin = x0;-
122 qreal ymin = y0;-
123 qreal xmax = x0;-
124 qreal ymax = y0;-
125 { qreal fx = rect.x() + rect.width(); qreal fy = rect.y(); x = _m11*fx + _m21*fy + _dx; y = _m12*fx + _m22*fy + _dy; };-
126 xmin = qMin(xmin, x);-
127 ymin = qMin(ymin, y);-
128 xmax = qMax(xmax, x);-
129 ymax = qMax(ymax, y);-
130 { qreal fx = rect.x() + rect.width(); qreal fy = rect.y() + rect.height(); x = _m11*fx + _m21*fy + _dx; y = _m12*fx + _m22*fy + _dy; };-
131 xmin = qMin(xmin, x);-
132 ymin = qMin(ymin, y);-
133 xmax = qMax(xmax, x);-
134 ymax = qMax(ymax, y);-
135 { qreal fx = rect.x(); qreal fy = rect.y() + rect.height(); x = _m11*fx + _m21*fy + _dx; y = _m12*fx + _m22*fy + _dy; };-
136 xmin = qMin(xmin, x);-
137 ymin = qMin(ymin, y);-
138 xmax = qMax(xmax, x);-
139 ymax = qMax(ymax, y);-
140 result = QRectF(xmin, ymin, xmax-xmin, ymax - ymin);-
141 }
never executed: end of block
0
142 return
never executed: return result;
result;
never executed: return result;
0
143}-
144QPoint QMatrix::map(const QPoint &p) const-
145{-
146 qreal fx = p.x();-
147 qreal fy = p.y();-
148 return
never executed: return QPoint(qRound(_m11*fx + _m21*fy + _dx), qRound(_m12*fx + _m22*fy + _dy));
QPoint(qRound(_m11*fx + _m21*fy + _dx),
never executed: return QPoint(qRound(_m11*fx + _m21*fy + _dx), qRound(_m12*fx + _m22*fy + _dy));
0
149 qRound(_m12*fx + _m22*fy + _dy));
never executed: return QPoint(qRound(_m11*fx + _m21*fy + _dx), qRound(_m12*fx + _m22*fy + _dy));
0
150}-
151QPointF QMatrix::map(const QPointF &point) const-
152{-
153 qreal fx = point.x();-
154 qreal fy = point.y();-
155 return
never executed: return QPointF(_m11*fx + _m21*fy + _dx, _m12*fx + _m22*fy + _dy);
QPointF(_m11*fx + _m21*fy + _dx, _m12*fx + _m22*fy + _dy);
never executed: return QPointF(_m11*fx + _m21*fy + _dx, _m12*fx + _m22*fy + _dy);
0
156}-
157QLineF QMatrix::map(const QLineF &line) const-
158{-
159 return
never executed: return QLineF(map(line.p1()), map(line.p2()));
QLineF(map(line.p1()), map(line.p2()));
never executed: return QLineF(map(line.p1()), map(line.p2()));
0
160}-
161QLine QMatrix::map(const QLine &line) const-
162{-
163 return
never executed: return QLine(map(line.p1()), map(line.p2()));
QLine(map(line.p1()), map(line.p2()));
never executed: return QLine(map(line.p1()), map(line.p2()));
0
164}-
165QPolygon QMatrix::map(const QPolygon &a) const-
166{-
167 int size = a.size();-
168 int i;-
169 QPolygon p(size);-
170 const QPoint *da = a.constData();-
171 QPoint *dp = p.data();-
172 for(i = 0; i < size
i < sizeDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
173 { qreal fx = da[i].x(); qreal fy = da[i].y(); dp[i].rx() = qRound(_m11*fx + _m21*fy + _dx); dp[i].ry() = qRound(_m12*fx + _m22*fy + _dy); };-
174 }
never executed: end of block
0
175 return
never executed: return p;
p;
never executed: return p;
0
176}-
177QPolygonF QMatrix::map(const QPolygonF &a) const-
178{-
179 int size = a.size();-
180 int i;-
181 QPolygonF p(size);-
182 const QPointF *da = a.constData();-
183 QPointF *dp = p.data();-
184 for(i = 0; i < size
i < sizeDescription
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
185 { qreal fx = da[i].xp; qreal fy = da[i].yp; dp[i].xp = _m11*fx + _m21*fy + _dx; dp[i].yp = _m12*fx + _m22*fy + _dy; };-
186 }
never executed: end of block
0
187 return
never executed: return p;
p;
never executed: return p;
0
188}-
189extern QPainterPath qt_regionToPath(const QRegion &region);-
190QRegion QMatrix::map(const QRegion &r) const-
191{-
192 if (_m11 == 1.0
_m11 == 1.0Description
TRUEnever evaluated
FALSEnever evaluated
&& _m22 == 1.0
_m22 == 1.0Description
TRUEnever evaluated
FALSEnever evaluated
&& _m12 == 0.0
_m12 == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
&& _m21 == 0.0
_m21 == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
193 if (_dx == 0.0
_dx == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
&& _dy == 0.0
_dy == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
194 return
never executed: return r;
r;
never executed: return r;
0
195 QRegion copy(r);-
196 copy.translate(qRound(_dx), qRound(_dy));-
197 return
never executed: return copy;
copy;
never executed: return copy;
0
198 }-
199-
200 QPainterPath p = map(qt_regionToPath(r));-
201 return
never executed: return p.toFillPolygon().toPolygon();
p.toFillPolygon().toPolygon();
never executed: return p.toFillPolygon().toPolygon();
0
202}-
203QPainterPath QMatrix::map(const QPainterPath &path) const-
204{-
205 if (path.isEmpty()
path.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
206 return
never executed: return QPainterPath();
QPainterPath();
never executed: return QPainterPath();
0
207-
208 QPainterPath copy = path;-
209-
210-
211 if (_m11 == 1.0
_m11 == 1.0Description
TRUEnever evaluated
FALSEnever evaluated
&& _m22 == 1.0
_m22 == 1.0Description
TRUEnever evaluated
FALSEnever evaluated
&& _m12 == 0.0
_m12 == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
&& _m21 == 0.0
_m21 == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
212-
213-
214 if (_dx != 0.0
_dx != 0.0Description
TRUEnever evaluated
FALSEnever evaluated
|| _dy != 0.0
_dy != 0.0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
215 copy.detach();-
216 for (int i=0; i<path.elementCount()
i<path.elementCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
217 QPainterPath::Element &e = copy.d_ptr->elements[i];-
218 e.x += _dx;-
219 e.y += _dy;-
220 }
never executed: end of block
0
221 }
never executed: end of block
0
222-
223-
224 }
never executed: end of block
else {
0
225 copy.detach();-
226 for (int i=0; i<path.elementCount()
i<path.elementCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
227 QPainterPath::Element &e = copy.d_ptr->elements[i];-
228 qreal fx = e.x, fy = e.y;-
229 e.x = _m11*fx + _m21*fy + _dx;-
230 e.y = _m12*fx + _m22*fy + _dy;-
231 }
never executed: end of block
0
232 }
never executed: end of block
0
233-
234 return
never executed: return copy;
copy;
never executed: return copy;
0
235}-
236QPolygon QMatrix::mapToPolygon(const QRect &rect) const-
237{-
238 QPolygon a(4);-
239 qreal x[4], y[4];-
240 if (_m12 == 0.0F
_m12 == 0.0FDescription
TRUEnever evaluated
FALSEnever evaluated
&& _m21 == 0.0F
_m21 == 0.0FDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
241 x[0] = _m11*rect.x() + _dx;-
242 y[0] = _m22*rect.y() + _dy;-
243 qreal w = _m11*rect.width();-
244 qreal h = _m22*rect.height();-
245 if (w < 0
w < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
246 w = -w;-
247 x[0] -= w;-
248 }
never executed: end of block
0
249 if (h < 0
h < 0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
250 h = -h;-
251 y[0] -= h;-
252 }
never executed: end of block
0
253 x[1] = x[0]+w;-
254 x[2] = x[1];-
255 x[3] = x[0];-
256 y[1] = y[0];-
257 y[2] = y[0]+h;-
258 y[3] = y[2];-
259 }
never executed: end of block
else {
0
260 qreal right = rect.x() + rect.width();-
261 qreal bottom = rect.y() + rect.height();-
262 { qreal fx = rect.x(); qreal fy = rect.y(); x[0] = _m11*fx + _m21*fy + _dx; y[0] = _m12*fx + _m22*fy + _dy; };-
263 { qreal fx = right; qreal fy = rect.y(); x[1] = _m11*fx + _m21*fy + _dx; y[1] = _m12*fx + _m22*fy + _dy; };-
264 { qreal fx = right; qreal fy = bottom; x[2] = _m11*fx + _m21*fy + _dx; y[2] = _m12*fx + _m22*fy + _dy; };-
265 { qreal fx = rect.x(); qreal fy = bottom; x[3] = _m11*fx + _m21*fy + _dx; y[3] = _m12*fx + _m22*fy + _dy; };-
266 }
never executed: end of block
0
267 a.setPoints(4, qRound(x[0]), qRound(y[0]),-
268 qRound(x[1]), qRound(y[1]),-
269 qRound(x[2]), qRound(y[2]),-
270 qRound(x[3]), qRound(y[3]));-
271 return
never executed: return a;
a;
never executed: return a;
0
272}-
273void QMatrix::reset()-
274{-
275 _m11 = _m22 = 1.0;-
276 _m12 = _m21 = _dx = _dy = 0.0;-
277}
never executed: end of block
0
278QMatrix &QMatrix::translate(qreal dx, qreal dy)-
279{-
280 _dx += dx*_m11 + dy*_m21;-
281 _dy += dy*_m22 + dx*_m12;-
282 return
never executed: return *this;
*this;
never executed: return *this;
0
283}-
284QMatrix &QMatrix::scale(qreal sx, qreal sy)-
285{-
286 _m11 *= sx;-
287 _m12 *= sx;-
288 _m21 *= sy;-
289 _m22 *= sy;-
290 return
never executed: return *this;
*this;
never executed: return *this;
0
291}-
292QMatrix &QMatrix::shear(qreal sh, qreal sv)-
293{-
294 qreal tm11 = sv*_m21;-
295 qreal tm12 = sv*_m22;-
296 qreal tm21 = sh*_m11;-
297 qreal tm22 = sh*_m12;-
298 _m11 += tm11;-
299 _m12 += tm12;-
300 _m21 += tm21;-
301 _m22 += tm22;-
302 return
never executed: return *this;
*this;
never executed: return *this;
0
303}-
304-
305const qreal deg2rad = qreal(0.017453292519943295769);-
306QMatrix &QMatrix::rotate(qreal a)-
307{-
308 qreal sina = 0;-
309 qreal cosa = 0;-
310 if (a == 90.
a == 90.Description
TRUEnever evaluated
FALSEnever evaluated
|| a == -270.
a == -270.Description
TRUEnever evaluated
FALSEnever evaluated
)
0
311 sina = 1.;
never executed: sina = 1.;
0
312 else if (a == 270.
a == 270.Description
TRUEnever evaluated
FALSEnever evaluated
|| a == -90.
a == -90.Description
TRUEnever evaluated
FALSEnever evaluated
)
0
313 sina = -1.;
never executed: sina = -1.;
0
314 else if (a == 180.
a == 180.Description
TRUEnever evaluated
FALSEnever evaluated
)
0
315 cosa = -1.;
never executed: cosa = -1.;
0
316 else{-
317 qreal b = deg2rad*a;-
318 sina = qSin(b);-
319 cosa = qCos(b);-
320 }
never executed: end of block
0
321 qreal tm11 = cosa*_m11 + sina*_m21;-
322 qreal tm12 = cosa*_m12 + sina*_m22;-
323 qreal tm21 = -sina*_m11 + cosa*_m21;-
324 qreal tm22 = -sina*_m12 + cosa*_m22;-
325 _m11 = tm11; _m12 = tm12;-
326 _m21 = tm21; _m22 = tm22;-
327 return
never executed: return *this;
*this;
never executed: return *this;
0
328}-
329QMatrix QMatrix::inverted(bool *invertible) const-
330{-
331 qreal dtr = determinant();-
332 if (dtr == 0.0
dtr == 0.0Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
333 if (invertible
invertibleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
334 *
never executed: *invertible = false;
invertible = false;
never executed: *invertible = false;
0
335 return
never executed: return QMatrix(true);
QMatrix(true);
never executed: return QMatrix(true);
0
336 }-
337 else {-
338 if (invertible
invertibleDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
339 *
never executed: *invertible = true;
invertible = true;
never executed: *invertible = true;
0
340 qreal dinv = 1.0/dtr;-
341 return
never executed: return QMatrix((_m22*dinv), (-_m12*dinv), (-_m21*dinv), (_m11*dinv), ((_m21*_dy - _m22*_dx)*dinv), ((_m12*_dx - _m11*_dy)*dinv), true);
QMatrix((_m22*dinv), (-_m12*dinv),
never executed: return QMatrix((_m22*dinv), (-_m12*dinv), (-_m21*dinv), (_m11*dinv), ((_m21*_dy - _m22*_dx)*dinv), ((_m12*_dx - _m11*_dy)*dinv), true);
0
342 (-_m21*dinv), (_m11*dinv),
never executed: return QMatrix((_m22*dinv), (-_m12*dinv), (-_m21*dinv), (_m11*dinv), ((_m21*_dy - _m22*_dx)*dinv), ((_m12*_dx - _m11*_dy)*dinv), true);
0
343 ((_m21*_dy - _m22*_dx)*dinv),
never executed: return QMatrix((_m22*dinv), (-_m12*dinv), (-_m21*dinv), (_m11*dinv), ((_m21*_dy - _m22*_dx)*dinv), ((_m12*_dx - _m11*_dy)*dinv), true);
0
344 ((_m12*_dx - _m11*_dy)*dinv),
never executed: return QMatrix((_m22*dinv), (-_m12*dinv), (-_m21*dinv), (_m11*dinv), ((_m21*_dy - _m22*_dx)*dinv), ((_m12*_dx - _m11*_dy)*dinv), true);
0
345 true);
never executed: return QMatrix((_m22*dinv), (-_m12*dinv), (-_m21*dinv), (_m11*dinv), ((_m21*_dy - _m22*_dx)*dinv), ((_m12*_dx - _m11*_dy)*dinv), true);
0
346 }-
347}-
348bool QMatrix::operator==(const QMatrix &m) const-
349{-
350 return
never executed: return _m11 == m._m11 && _m12 == m._m12 && _m21 == m._m21 && _m22 == m._m22 && _dx == m._dx && _dy == m._dy;
_m11 == m._m11 &&
never executed: return _m11 == m._m11 && _m12 == m._m12 && _m21 == m._m21 && _m22 == m._m22 && _dx == m._dx && _dy == m._dy;
0
351 _m12 == m._m12 &&
never executed: return _m11 == m._m11 && _m12 == m._m12 && _m21 == m._m21 && _m22 == m._m22 && _dx == m._dx && _dy == m._dy;
0
352 _m21 == m._m21 &&
never executed: return _m11 == m._m11 && _m12 == m._m12 && _m21 == m._m21 && _m22 == m._m22 && _dx == m._dx && _dy == m._dy;
0
353 _m22 == m._m22 &&
never executed: return _m11 == m._m11 && _m12 == m._m12 && _m21 == m._m21 && _m22 == m._m22 && _dx == m._dx && _dy == m._dy;
0
354 _dx == m._dx &&
never executed: return _m11 == m._m11 && _m12 == m._m12 && _m21 == m._m21 && _m22 == m._m22 && _dx == m._dx && _dy == m._dy;
0
355 _dy == m._dy;
never executed: return _m11 == m._m11 && _m12 == m._m12 && _m21 == m._m21 && _m22 == m._m22 && _dx == m._dx && _dy == m._dy;
0
356}-
357uint qHash(const QMatrix &key, uint seed) noexcept-
358{-
359 QtPrivate::QHashCombine hash;-
360 seed = hash(key.m11(), seed);-
361 seed = hash(key.m12(), seed);-
362 seed = hash(key.m21(), seed);-
363 seed = hash(key.m22(), seed);-
364 seed = hash(key.dx(), seed);-
365 seed = hash(key.dy(), seed);-
366 return
never executed: return seed;
seed;
never executed: return seed;
0
367}-
368bool QMatrix::operator!=(const QMatrix &m) const-
369{-
370 return
never executed: return _m11 != m._m11 || _m12 != m._m12 || _m21 != m._m21 || _m22 != m._m22 || _dx != m._dx || _dy != m._dy;
_m11 != m._m11 ||
never executed: return _m11 != m._m11 || _m12 != m._m12 || _m21 != m._m21 || _m22 != m._m22 || _dx != m._dx || _dy != m._dy;
0
371 _m12 != m._m12 ||
never executed: return _m11 != m._m11 || _m12 != m._m12 || _m21 != m._m21 || _m22 != m._m22 || _dx != m._dx || _dy != m._dy;
0
372 _m21 != m._m21 ||
never executed: return _m11 != m._m11 || _m12 != m._m12 || _m21 != m._m21 || _m22 != m._m22 || _dx != m._dx || _dy != m._dy;
0
373 _m22 != m._m22 ||
never executed: return _m11 != m._m11 || _m12 != m._m12 || _m21 != m._m21 || _m22 != m._m22 || _dx != m._dx || _dy != m._dy;
0
374 _dx != m._dx ||
never executed: return _m11 != m._m11 || _m12 != m._m12 || _m21 != m._m21 || _m22 != m._m22 || _dx != m._dx || _dy != m._dy;
0
375 _dy != m._dy;
never executed: return _m11 != m._m11 || _m12 != m._m12 || _m21 != m._m21 || _m22 != m._m22 || _dx != m._dx || _dy != m._dy;
0
376}-
377QMatrix &QMatrix::operator *=(const QMatrix &m)-
378{-
379 qreal tm11 = _m11*m._m11 + _m12*m._m21;-
380 qreal tm12 = _m11*m._m12 + _m12*m._m22;-
381 qreal tm21 = _m21*m._m11 + _m22*m._m21;-
382 qreal tm22 = _m21*m._m12 + _m22*m._m22;-
383-
384 qreal tdx = _dx*m._m11 + _dy*m._m21 + m._dx;-
385 qreal tdy = _dx*m._m12 + _dy*m._m22 + m._dy;-
386-
387 _m11 = tm11; _m12 = tm12;-
388 _m21 = tm21; _m22 = tm22;-
389 _dx = tdx; _dy = tdy;-
390 return
never executed: return *this;
*this;
never executed: return *this;
0
391}-
392QMatrix QMatrix::operator *(const QMatrix &m) const-
393{-
394 qreal tm11 = _m11*m._m11 + _m12*m._m21;-
395 qreal tm12 = _m11*m._m12 + _m12*m._m22;-
396 qreal tm21 = _m21*m._m11 + _m22*m._m21;-
397 qreal tm22 = _m21*m._m12 + _m22*m._m22;-
398-
399 qreal tdx = _dx*m._m11 + _dy*m._m21 + m._dx;-
400 qreal tdy = _dx*m._m12 + _dy*m._m22 + m._dy;-
401 return
never executed: return QMatrix(tm11, tm12, tm21, tm22, tdx, tdy, true);
QMatrix(tm11, tm12, tm21, tm22, tdx, tdy, true);
never executed: return QMatrix(tm11, tm12, tm21, tm22, tdx, tdy, true);
0
402}-
403-
404-
405-
406-
407-
408QMatrix &QMatrix::operator=(const QMatrix &matrix) noexcept-
409{-
410 _m11 = matrix._m11;-
411 _m12 = matrix._m12;-
412 _m21 = matrix._m21;-
413 _m22 = matrix._m22;-
414 _dx = matrix._dx;-
415 _dy = matrix._dy;-
416 return
never executed: return *this;
*this;
never executed: return *this;
0
417}-
418-
419-
420-
421-
422-
423-
424-
425QMatrix::operator QVariant() const-
426{-
427 return
never executed: return QVariant(QVariant::Matrix, this);
QVariant(QVariant::Matrix, this);
never executed: return QVariant(QVariant::Matrix, this);
0
428}-
429-
430__attribute__((visibility("default"))) QPainterPath operator *(const QPainterPath &p, const QMatrix &m)-
431{-
432 return
never executed: return m.map(p);
m.map(p);
never executed: return m.map(p);
0
433}-
434QDataStream &operator<<(QDataStream &s, const QMatrix &m)-
435{-
436 if (s.version() == 1
s.version() == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
437 s << (float)m.m11() << (float)m.m12() << (float)m.m21()-
438 << (float)m.m22() << (float)m.dx() << (float)m.dy();-
439 }
never executed: end of block
else {
0
440 s << double(m.m11())-
441 << double(m.m12())-
442 << double(m.m21())-
443 << double(m.m22())-
444 << double(m.dx())-
445 << double(m.dy());-
446 }
never executed: end of block
0
447 return
never executed: return s;
s;
never executed: return s;
0
448}-
449QDataStream &operator>>(QDataStream &s, QMatrix &m)-
450{-
451 if (s.version() == 1
s.version() == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
452 float m11, m12, m21, m22, dx, dy;-
453 s >> m11; s >> m12; s >> m21; s >> m22;-
454 s >> dx; s >> dy;-
455 m.setMatrix(m11, m12, m21, m22, dx, dy);-
456 }
never executed: end of block
0
457 else {-
458 double m11, m12, m21, m22, dx, dy;-
459 s >> m11;-
460 s >> m12;-
461 s >> m21;-
462 s >> m22;-
463 s >> dx;-
464 s >> dy;-
465 m.setMatrix(m11, m12, m21, m22, dx, dy);-
466 }
never executed: end of block
0
467 return
never executed: return s;
s;
never executed: return s;
0
468}-
469-
470-
471-
472QDebug operator<<(QDebug dbg, const QMatrix &m)-
473{-
474 QDebugStateSaver saver(dbg);-
475 dbg.nospace() << "QMatrix("-
476 << "11=" << m.m11()-
477 << " 12=" << m.m12()-
478 << " 21=" << m.m21()-
479 << " 22=" << m.m22()-
480 << " dx=" << m.dx()-
481 << " dy=" << m.dy()-
482 << ')';-
483 return
never executed: return dbg;
dbg;
never executed: return dbg;
0
484}-
485-
Switch to Source codePreprocessed file

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