Mech-Eye API 2.3.3
API reference documentation for Mech-Eye Industrial 3D Camera
Loading...
Searching...
No Matches
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 upperLeftX;
44 unsigned upperLeftY;
45 size_t width;
46 size_t height;
47};
48
52enum struct IpAssignmentMethod { Unknown, DHCP = 4, Static, LLA };
53
54inline static std::string ipAssignmentMethodToString(IpAssignmentMethod type)
55{
56 switch (type) {
57 case IpAssignmentMethod::Static:
58 return "Static";
59 case IpAssignmentMethod::DHCP:
60 return "DHCP";
61 case IpAssignmentMethod::LLA:
62 return "LLA";
63 case IpAssignmentMethod::Unknown:
64 return "Unknown";
65 }
66 return "";
67}
68
69} // namespace eye
70
71} // namespace mmind
Represents a 2D container of data.
Definition Array2D.h:17
size_t height() const
Returns the height of the Array2D object.
Definition Array2D.h:36
size_t width() const
Returns the width of the Array2D object.
Definition Array2D.h:31
Describes a region of interest (ROI).
Definition CommonTypes.h:35
unsigned upperLeftY
The row coordinate of the upper-left corner of the ROI.
Definition CommonTypes.h:44
unsigned upperLeftX
The column coordinate of the upper-left corner of the ROI.
Definition CommonTypes.h:43
Describes a value range.
Definition CommonTypes.h:11
Describes a two-dimensional size with a width and a height.
Definition CommonTypes.h:22