Code

Refactoring SPColor to C++ and removing legacy CMYK implementation
[inkscape.git] / src / libnr / nr-matrix-ops.h
1 /* operator functions for NR::Matrix. */
2 #ifndef SEEN_NR_MATRIX_OPS_H
3 #define SEEN_NR_MATRIX_OPS_H
5 #include <libnr/nr-matrix.h>
7 namespace NR {
9 inline bool operator==(Matrix const &a, Matrix const &b)
10 {
11     for(unsigned i = 0; i < 6; ++i) {
12         if ( a[i] != b[i] ) {
13             return false;
14         }
15     }
16     return true;
17 }
19 inline bool operator!=(Matrix const &a, Matrix const &b)
20 {
21     return !( a == b );
22 }
24 Matrix operator*(Matrix const &a, Matrix const &b);
26 inline Matrix operator*(Matrix const &a, NRMatrix const &b)
27 {
28     return a * NR::Matrix(b);
29 }
31 } /* namespace NR */
34 #endif /* !SEEN_NR_MATRIX_OPS_H */
36 /*
37   Local Variables:
38   mode:c++
39   c-file-style:"stroustrup"
40   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
41   indent-tabs-mode:nil
42   fill-column:99
43   End:
44 */
45 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :