|
11 | 11 | #include "impeller/geometry/size.h" |
12 | 12 | #include "impeller/geometry/vector.h" |
13 | 13 |
|
14 | | -namespace std { |
15 | | - |
16 | | -inline std::ostream& operator<<(std::ostream& out, const impeller::Matrix& m) { |
17 | | - out << "("; |
18 | | - for (size_t i = 0; i < 4u; i++) { |
19 | | - for (size_t j = 0; j < 4u; j++) { |
20 | | - out << m.e[i][j] << ","; |
21 | | - } |
22 | | - out << std::endl; |
23 | | - } |
24 | | - out << ")"; |
25 | | - return out; |
26 | | -} |
27 | | - |
28 | | -inline std::ostream& operator<<(std::ostream& out, |
29 | | - const impeller::Quaternion& q) { |
30 | | - out << "(" << q.x << ", " << q.y << ", " << q.z << ", " << q.w << ")"; |
31 | | - return out; |
32 | | -} |
33 | | - |
34 | | -template <class T> |
35 | | -inline std::ostream& operator<<(std::ostream& out, |
36 | | - const impeller::TSize<T>& s) { |
37 | | - out << "(" << s.width << ", " << s.height << ")"; |
38 | | - return out; |
39 | | -} |
40 | | - |
41 | | -template <class T> |
42 | | -inline std::ostream& operator<<(std::ostream& out, |
43 | | - const impeller::TPoint<T>& p) { |
44 | | - out << "(" << p.x << ", " << p.y << ")"; |
45 | | - return out; |
46 | | -} |
47 | | - |
48 | | -template <class T> |
49 | | -inline std::ostream& operator<<(std::ostream& out, |
50 | | - const impeller::TRect<T>& r) { |
51 | | - out << "(" << r.origin << ", " << r.size << ")"; |
52 | | - return out; |
53 | | -} |
54 | | - |
55 | | -} // namespace std |
56 | | - |
57 | 14 | inline bool NumberNear(double a, double b) { |
58 | 15 | static const double epsilon = 1e-3; |
59 | 16 | return (a > (b - epsilon)) && (a < (b + epsilon)); |
|
0 commit comments