IWORKTransformation.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 IWORKTRANSFORMATION_H_INCLUDED
11 #define IWORKTRANSFORMATION_H_INCLUDED
12
13 #include <cassert>
14
15 #include <glm/glm.hpp>
16
17 #include "libetonyek_utils.h"
18
19 namespace libetonyek
20 {
21
22 struct IWORKGeometry;
23
29 glm::dmat3 makeTransformation(const IWORKGeometry &geometry);
30
32 namespace transformations
33 {
34
41 glm::dmat3 center(double width, double height);
42
51 glm::dmat3 origin(double width, double height);
52
59 glm::dmat3 flip(bool horizontal, bool vertical);
60
67 glm::dmat3 rotate(double angle);
68
75 glm::dmat3 scale(double ratioX, double ratioY);
76
83 glm::dmat3 shear(double angleX, double angleY);
84
91 glm::dmat3 translate(double offsetX, double offsetY);
92
93 }
94
95 }
96
97 #endif // IWORKTRANSFORMATION_H_INCLUDED
98
99 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
libetonyek::transformations::flip
glm::dmat3 flip(const bool horizontal, const bool vertical)
Flip horizontally and/or vertically.
Definition: IWORKTransformation.cpp:60
libetonyek
Definition: IWORKBezierElement.cpp:20
libetonyek::transformations::origin
glm::dmat3 origin(const double width, const double height)
Translate from the center of viewport to the origin.
Definition: IWORKTransformation.cpp:55
libetonyek::transformations::translate
glm::dmat3 translate(const double offsetX, const double offsetY)
Translate along x and/or y axis.
Definition: IWORKTransformation.cpp:83
libetonyek::transformations::scale
glm::dmat3 scale(const double ratioX, const double ratioY)
Scale along x and/or y axis.
Definition: IWORKTransformation.cpp:72
libetonyek::makeTransformation
glm::dmat3 makeTransformation(const IWORKGeometry &geometry)
Create a transformation from a geometry.
Definition: IWORKTransformation.cpp:19
libetonyek::IWORKToken::width
Definition: IWORKToken.h:631
libetonyek::transformations::rotate
glm::dmat3 rotate(const double angle)
Rotate counterclockwise around origin.
Definition: IWORKTransformation.cpp:65
libetonyek::KEY1Token::horizontal
Definition: KEY1Token.h:223
libetonyek::IWORKToken::angle
Definition: IWORKToken.h:505
libetonyek::transformations::shear
glm::dmat3 shear(const double angleX, const double angleY)
Shear along x and/or y axis.
Definition: IWORKTransformation.cpp:77
libetonyek::IWORKToken::height
Definition: IWORKToken.h:551
libetonyek::transformations::center
glm::dmat3 center(const double width, const double height)
Translate to the center of viewport.
Definition: IWORKTransformation.cpp:50
libetonyek::IWORKToken::geometry
Definition: IWORKToken.h:232
libetonyek::KEY1Token::vertical
Definition: KEY1Token.h:239
libetonyek_utils.h