Mech-Eye API 2.2.1
API reference documentation for Mech-Eye 3D Laser Profiler
All Classes Functions Variables Typedefs 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
53enum struct IpAssignmentMethod { Unknown, DHCP = 4, Static, LLA };
54
55inline static std::string ipAssignmentMethodToString(IpAssignmentMethod type)
56{
57 switch (type) {
58 case IpAssignmentMethod::Static:
59 return "Static";
60 case IpAssignmentMethod::DHCP:
61 return "DHCP";
62 case IpAssignmentMethod::LLA:
63 return "LLA";
64 case IpAssignmentMethod::Unknown:
65 return "Unknown";
66 }
67 return "";
68}
69
70} // namespace eye
71
72} // namespace mmind
Describes a region of interest (ROI).
Definition CommonTypes.h:35
unsigned upperLeftY
The row coordinate of the upper-left corner of ROI.
Definition CommonTypes.h:45
unsigned upperLeftX
The column coordinate of the upper-left corner of ROI.
Definition CommonTypes.h:44
Describes a value range.
Definition CommonTypes.h:11
Describes a size with a width and a height.
Definition CommonTypes.h:22