Mech-Eye API Reference 2.1.4-alpha
API reference documentation for Mech-Eye 3D Laser Profiler
All Classes Functions Variables Enumerations Enumerator Pages
CommonTypes.h
1#pragma once
2#include <string>
3namespace mmind {
4
5namespace eye {
9template <typename T>
10struct Range
11{
12 constexpr Range() : min(0), max(0) {}
13 constexpr Range(T min, T max) : min(min), max(max) {}
14 T min;
15 T max;
16};
17
21struct Size
22{
23 constexpr Size() : width(0), height(0) {}
24 constexpr Size(size_t width, size_t height) : width(width), height(height) {}
25 bool operator==(const Size& other) { return width == other.width && height == other.height; }
26
27 size_t width;
28 size_t height;
29};
30
34struct ROI
35{
36 constexpr ROI() : upperLeftX(0), upperLeftY(0), width(0), height(0) {}
37 constexpr ROI(unsigned upperLeftX, unsigned upperLeftY, size_t width, size_t height)
38 : upperLeftX(upperLeftX), upperLeftY(upperLeftY), width(width), height(height)
39 {
40 }
41 bool operator==(const ROI& other) { return width == other.width && height == other.height; }
42
43 unsigned
45 unsigned upperLeftY;
46 size_t width;
47 size_t height;
48};
49
50
54enum struct IpAssignmentMethod { Unknown, DHCP, Static, LLA };
55
56inline static std::string ipAssignmentMethodToString(IpAssignmentMethod type)
57{
58 switch (type) {
59 case IpAssignmentMethod::Static:
60 return "Static";
61 case IpAssignmentMethod::DHCP:
62 return "DHCP";
63 case IpAssignmentMethod::LLA:
64 return "LLA";
65 case IpAssignmentMethod::Unknown:
66 return "Unknown";
67 }
68 return "";
69}
70
71} // namespace eye
72
73} // namespace mmind
A region of interest.
Definition CommonTypes.h:35
unsigned upperLeftY
The row coordinate of the upper-left corner of the region of interest.
Definition CommonTypes.h:45
unsigned upperLeftX
The column coordinate of the upper-left corner of the region of interest.
Definition CommonTypes.h:44
A value range.
Definition CommonTypes.h:11
A size with a width and a height.
Definition CommonTypes.h:22