libpromeki 1.0.0-alpha
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
line.h
Go to the documentation of this file.
1
8#pragma once
9
10
11#include <promeki/config.h>
12#if PROMEKI_ENABLE_CORE
13#include <promeki/namespace.h>
14#include <promeki/point.h>
15
16PROMEKI_NAMESPACE_BEGIN
17
33template <typename T, size_t N> class Line {
34 public:
36 using Pt = Point<T, N>;
37
39 Line() = default;
40
46 Line(const Pt &s, const Pt &e) : _start(s), _end(e) {};
47
53 Line(const Pt &&s, const Pt &&e) : _start(std::move(s)), _end(std::move(e)) {}
54
59 const Pt &start() const { return _start; }
60
65 const Pt &end() const { return _end; }
66
67 private:
68 Pt _start;
69 Pt _end;
70};
71
73using Line2Di32 = Line<int32_t, 2>;
75using Line2Df = Line<float, 2>;
77using Line2Dd = Line<double, 2>;
79using Line3Di32 = Line<int32_t, 3>;
81using Line3Df = Line<float, 3>;
83using Line3Dd = Line<double, 3>;
85using Line4Di32 = Line<int32_t, 4>;
87using Line4Df = Line<float, 4>;
89using Line4Dd = Line<double, 4>;
90
91PROMEKI_NAMESPACE_END
92
93#endif // PROMEKI_ENABLE_CORE