1 #ifndef SEEN_LIBNR_NR_MATRIX_SCALE_OPS_H
2 #define SEEN_LIBNR_NR_MATRIX_SCALE_OPS_H
3 /** \file
4 * Declarations (and definition if inline) of operator blah (NR::Matrix, NR::scale).
5 */
7 #include "libnr/nr-forward.h"
9 namespace NR {
11 inline Matrix &operator/=(Matrix &m, scale const &s) {
12 m[0] /= s[X]; m[1] /= s[Y];
13 m[2] /= s[X]; m[3] /= s[Y];
14 m[4] /= s[X]; m[5] /= s[Y];
15 return m;
16 }
18 inline Matrix &operator*=(Matrix &m, scale const &s) {
19 m[0] *= s[X]; m[1] *= s[Y];
20 m[2] *= s[X]; m[3] *= s[Y];
21 m[4] *= s[X]; m[5] *= s[Y];
22 return m;
23 }
25 inline Matrix operator/(Matrix const &m, scale const &s) { Matrix ret(m); ret /= s; return ret; }
27 inline Matrix operator*(Matrix const &m, scale const &s) { Matrix ret(m); ret *= s; return ret; }
29 }
31 #endif /* !SEEN_LIBNR_NR_MATRIX_SCALE_OPS_H */