KEYTransformation.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * This file is part of the libetonyek project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef KEYTRANSFORMATION_H_INCLUDED
11 #define KEYTRANSFORMATION_H_INCLUDED
12 
13 #include "libetonyek_utils.h"
14 
15 namespace libetonyek
16 {
17 
18 struct KEYGeometry;
19 
30 {
31 public:
35 
38  KEYTransformation(double xx, double yx, double xy, double yy, double x0, double y0);
39 
48 
56  void operator()(double &x, double &y, bool distance = false) const;
57 
65  bool approxEqual(const KEYTransformation &other, double eps = KEY_EPSILON) const;
66 
67 private:
68  // transformation matrix
69  double m_xx;
70  double m_yx;
71  double m_xy;
72  double m_yy;
73  double m_x0;
74  double m_y0;
75 };
76 
85 
93 
101 
108 
110 namespace transformations
111 {
112 
119 KEYTransformation center(double width, double height);
120 
129 KEYTransformation origin(double width, double height);
130 
137 KEYTransformation flip(bool horizontal, bool vertical);
138 
146 
153 KEYTransformation scale(double ratioX, double ratioY);
154 
161 KEYTransformation shear(double angleX, double angleY);
162 
169 KEYTransformation translate(double offsetX, double offsetY);
170 
171 }
172 
173 }
174 
175 #endif // KEYTRANSFORMATION_H_INCLUDED
176 
177 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */

Generated for libetonyek by doxygen 1.8.3.1