lines-are-beautiful  0.0
A C++ file API for the reMarkable e-ink tablet
Point.hpp
Go to the documentation of this file.
1 /* Copyright 2017-2018 Axel Huebl
2  *
3  * This file is part of lines-are-beautiful.
4  *
5  * lines-are-beautiful is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * lines-are-beautiful is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with lines-are-beautiful.
17  * If not, see <http://www.gnu.org/licenses/>.
18  */
19 
25 #pragma once
26 
27 #include <cmath>
28 
29 
30 namespace rmlab
31 {
32 namespace ranges
33 {
37  enum Coords
38  {
43  minX = 0u,
44 
49  maxX = 1404u,
50 
55  minY = 0u,
56 
61  maxY = 1872u,
62  };
63 
67  constexpr float minP = 0.0;
68 
72  constexpr float maxP = 1.0;
73 
77  constexpr float minRot = -M_PI / 2.0;
78 
82  constexpr float maxRot = M_PI / 2.0;
83 }
84 
89  struct Point
90  {
97  float x;
98 
105  float y;
106 
112  float pressure;
113 
119  float rotX;
120 
126  float rotY;
127  };
128 
129  inline Point make_point(
130  float x,
131  float y,
132  float pressure,
133  float rotX,
134  float rotY
135  )
136  {
137  Point newPoint;
138  newPoint.x = x;
139  newPoint.y = y;
140  newPoint.pressure = pressure;
141  newPoint.rotX = rotX;
142  newPoint.rotY = rotY;
143  return newPoint;
144  }
145 }
Definition: Point.hpp:89
Definition: Point.hpp:49
Definition: Layer.hpp:33
Definition: Point.hpp:55
Definition: Point.hpp:43
constexpr float maxP
Definition: Point.hpp:72
float rotX
Definition: Point.hpp:119
Definition: Point.hpp:61
constexpr float minRot
Definition: Point.hpp:77
float y
Definition: Point.hpp:105
constexpr float minP
Definition: Point.hpp:67
constexpr float maxRot
Definition: Point.hpp:82
Coords
Definition: Point.hpp:37
float rotY
Definition: Point.hpp:126
float x
Definition: Point.hpp:97
float pressure
Definition: Point.hpp:112