100QOpenVGMatrix &QOpenVGMatrix::operator+=(
const QOpenVGMatrix &other)
102 m[0][0] += other.m[0][0];
103 m[0][1] += other.m[0][1];
104 m[0][2] += other.m[0][2];
105 m[1][0] += other.m[1][0];
106 m[1][1] += other.m[1][1];
107 m[1][2] += other.m[1][2];
108 m[2][0] += other.m[2][0];
109 m[2][1] += other.m[2][1];
110 m[2][2] += other.m[2][2];
114QOpenVGMatrix &QOpenVGMatrix::operator-=(
const QOpenVGMatrix &other)
116 m[0][0] -= other.m[0][0];
117 m[0][1] -= other.m[0][1];
118 m[0][2] -= other.m[0][2];
119 m[1][0] -= other.m[1][0];
120 m[1][1] -= other.m[1][1];
121 m[1][2] -= other.m[1][2];
122 m[2][0] -= other.m[2][0];
123 m[2][1] -= other.m[2][1];
124 m[2][2] -= other.m[2][2];
128QOpenVGMatrix &QOpenVGMatrix::operator*=(
const QOpenVGMatrix &other)
131 m0 = m[0][0] * other.m[0][0]
132 + m[1][0] * other.m[0][1]
133 + m[2][0] * other.m[0][2];
134 m1 = m[0][0] * other.m[1][0]
135 + m[1][0] * other.m[1][1]
136 + m[2][0] * other.m[1][2];
137 m[2][0] = m[0][0] * other.m[2][0]
138 + m[1][0] * other.m[2][1]
139 + m[2][0] * other.m[2][2];
143 m0 = m[0][1] * other.m[0][0]
144 + m[1][1] * other.m[0][1]
145 + m[2][1] * other.m[0][2];
146 m1 = m[0][1] * other.m[1][0]
147 + m[1][1] * other.m[1][1]
148 + m[2][1] * other.m[1][2];
149 m[2][1] = m[0][1] * other.m[2][0]
150 + m[1][1] * other.m[2][1]
151 + m[2][1] * other.m[2][2];
155 m0 = m[0][2] * other.m[0][0]
156 + m[1][2] * other.m[0][1]
157 + m[2][2] * other.m[0][2];
158 m1 = m[0][2] * other.m[1][0]
159 + m[1][2] * other.m[1][1]
160 + m[2][2] * other.m[1][2];
161 m[2][2] = m[0][2] * other.m[2][0]
162 + m[1][2] * other.m[2][1]
163 + m[2][2] * other.m[2][2];
197bool QOpenVGMatrix::operator==(
const QOpenVGMatrix &other)
const
199 return m[0][0] == other.m[0][0] &&
200 m[0][1] == other.m[0][1] &&
201 m[0][2] == other.m[0][2] &&
202 m[1][0] == other.m[1][0] &&
203 m[1][1] == other.m[1][1] &&
204 m[1][2] == other.m[1][2] &&
205 m[2][0] == other.m[2][0] &&
206 m[2][1] == other.m[2][1] &&
207 m[2][2] == other.m[2][2];
210bool QOpenVGMatrix::operator!=(
const QOpenVGMatrix &other)
const
212 return m[0][0] != other.m[0][0] ||
213 m[0][1] != other.m[0][1] ||
214 m[0][2] != other.m[0][2] ||
215 m[1][0] != other.m[1][0] ||
216 m[1][1] != other.m[1][1] ||
217 m[1][2] != other.m[1][2] ||
218 m[2][0] != other.m[2][0] ||
219 m[2][1] != other.m[2][1] ||
220 m[2][2] != other.m[2][2];
232QOpenVGMatrix
operator*(
const QOpenVGMatrix &m1,
const QOpenVGMatrix &m2)
234 QOpenVGMatrix matrix;
235 matrix.m[0][0] = m1.m[0][0] * m2.m[0][0]
236 + m1.m[1][0] * m2.m[0][1]
237 + m1.m[2][0] * m2.m[0][2];
238 matrix.m[0][1] = m1.m[0][1] * m2.m[0][0]
239 + m1.m[1][1] * m2.m[0][1]
240 + m1.m[2][1] * m2.m[0][2];
241 matrix.m[0][2] = m1.m[0][2] * m2.m[0][0]
242 + m1.m[1][2] * m2.m[0][1]
243 + m1.m[2][2] * m2.m[0][2];
245 matrix.m[1][0] = m1.m[0][0] * m2.m[1][0]
246 + m1.m[1][0] * m2.m[1][1]
247 + m1.m[2][0] * m2.m[1][2];
248 matrix.m[1][1] = m1.m[0][1] * m2.m[1][0]
249 + m1.m[1][1] * m2.m[1][1]
250 + m1.m[2][1] * m2.m[1][2];
251 matrix.m[1][2] = m1.m[0][2] * m2.m[1][0]
252 + m1.m[1][2] * m2.m[1][1]
253 + m1.m[2][2] * m2.m[1][2];
255 matrix.m[2][0] = m1.m[0][0] * m2.m[2][0]
256 + m1.m[1][0] * m2.m[2][1]
257 + m1.m[2][0] * m2.m[2][2];
258 matrix.m[2][1] = m1.m[0][1] * m2.m[2][0]
259 + m1.m[1][1] * m2.m[2][1]
260 + m1.m[2][1] * m2.m[2][2];
261 matrix.m[2][2] = m1.m[0][2] * m2.m[2][0]
262 + m1.m[1][2] * m2.m[2][1]
263 + m1.m[2][2] * m2.m[2][2];
309 QDebugStateSaver saver(dbg);
311 dbg.nospace() <<
"QOpenVGMatrix:(" << Qt::endl
312 << qSetFieldWidth(10)
313 << m(0, 0) << m(0, 1) << m(0, 2) << Qt::endl
314 << m(1, 0) << m(1, 1) << m(1, 2) << Qt::endl
315 << m(2, 0) << m(2, 1) << m(2, 2) << Qt::endl
316 << qSetFieldWidth(0) <<
')';