lines-are-beautiful  0.0
A C++ file API for the reMarkable e-ink tablet
Line.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 "Point.hpp"
28 
29 #include <cstdint> // int8_t - int64_t
30 #include <list>
31 
32 
33 namespace rmlab
34 {
54 namespace Brushes
55 {
56  enum Brushes
57  {
63  pen1 = 2u,
64 
70  pen2 = 3u,
71 
77  fineliner = 4u,
78 
85 
92 
98  brush = 0u,
99 
107 
113  rubber = 6u,
114 
119 
126 
132  erase_all = 9u,
133 
140 
147 
153  fine_line1 = 12u,
154  fine_line2 = 13u,
155  fine_line3 = 14u
156  };
157 }
158 
166 namespace Colors
167 {
168  enum Colors
169  {
173  black = 0u,
174 
178  grey = 1u,
179 
183  white = 2u
184  };
185 }
186 
194 namespace BaseSizes
195 {
199  constexpr float small = 1.875;
200 
204  constexpr float mid = 2.0;
205 
209  constexpr float large = 2.125;
210 }
211 
219  struct Line
220  {
225  int32_t brush_type;
226 
231  int32_t color;
232 
237 
243 
247  int32_t npoints;
248 
252  std::list< Point > points;
253  };
254 
255  inline Line make_line(
256  int32_t brush_type = 1,
257  int32_t color = 0,
258  int32_t unknown_line_attribute = 0,
259  float brush_base_size = 2.125,
260  std::list< Point > points = std::list< Point >{}
261  )
262  {
263  Line newLine;
264  newLine.brush_type = brush_type;
265  newLine.color = color;
266  newLine.unknown_line_attribute = unknown_line_attribute;
267  newLine.brush_base_size = brush_base_size;
268  newLine.npoints = points.size();
269  newLine.points = points;
270 
271  return newLine;
272  }
273 }
Definition: Line.hpp:183
float brush_base_size
Definition: Line.hpp:242
int32_t unknown_line_attribute
Definition: Line.hpp:236
int32_t npoints
Definition: Line.hpp:247
Definition: Line.hpp:98
Definition: Line.hpp:118
int32_t color
Definition: Line.hpp:231
Definition: Layer.hpp:33
Definition: Line.hpp:84
Colors
Definition: Line.hpp:168
int32_t brush_type
Definition: Line.hpp:225
Definition: Line.hpp:63
Definition: Line.hpp:146
std::list< Point > points
Definition: Line.hpp:252
Definition: Line.hpp:132
Definition: Line.hpp:219
constexpr float mid
Definition: Line.hpp:204
Definition: Line.hpp:113
Definition: Line.hpp:77
Definition: Line.hpp:91
Definition: Line.hpp:125
Definition: Line.hpp:173
Definition: Line.hpp:139
constexpr float large
Definition: Line.hpp:209
constexpr float small
Definition: Line.hpp:199
Definition: Line.hpp:70
Definition: Line.hpp:106
Definition: Line.hpp:153
Definition: Line.hpp:178
Brushes
Definition: Line.hpp:56