3#include <cvb/_cexports/c_img.h>
4#include <cvb/core_3d.hpp>
6#include <cvb/point_2d.hpp>
56 size_ =
sizeof(CExports::CVC3DSensorSettings);
57 rangeScale_ = rangeScale;
58 pixelPosition_ = pixelPosition;
59 pixelsMirrored_ = pixelsMirrored;
60 offsetLeft_ = sensorRoi.
Left();
61 offsetTop_ = sensorRoi.
Top();
62 width_ = sensorRoi.
Width();
63 height_ = sensorRoi.
Height();
64 resolutionReduction_ = resolutionReduction;
66 static_assert(
sizeof(
SensorSettings) ==
sizeof(CExports::CVC3DSensorSettings),
67 "size of class SensorSettings and CExports::CVC3DSensorSettings must be equal");
69 if (sensorRoi.
Left() == 0 && sensorRoi.
Top() == 0 && sensorRoi.
Width() == 0 && sensorRoi.
Height() == 0)
71 if (MirrorX() || MirrorY())
75 if (!MirrorX() && sensorRoi.
Width() < 0)
76 throw std::invalid_argument(
"reverse_x = false and sensorRoi.Width < 0 are contradictory. Please set reverse_x to TRUE.");
78 if (!MirrorY() && sensorRoi.
Height() < 0)
79 throw std::invalid_argument(
"reverse_y = false and sensorRoi.Height < 0 are contradictory. Please set reverse_y to TRUE.");
81 if (sensorRoi.
Left() < 0 || sensorRoi.
Top() < 0)
85 throw std::invalid_argument(
"Sensor ROI is not valid: sensorRoi.Top must be zero as absolutePosition = true");
93 double RangeScale() const noexcept {
return rangeScale_; }
134 if (size_ != other.size_)
136 else if (rangeScale_ != other.rangeScale_)
138 else if (pixelPosition_ != other.pixelPosition_)
140 else if (pixelsMirrored_ != other.pixelsMirrored_)
142 else if (
SensorRoi()!= other.SensorRoi())
144 else if (resolutionReduction_ != other.resolutionReduction_)
158 return !(*
this == other);
167 CExports::cvbdim_t offsetLeft_;
168 CExports::cvbdim_t offsetTop_;
169 CExports::cvbdim_t width_;
170 CExports::cvbdim_t height_;
Rectangle object.
Definition: rect.hpp:26
T Height() const noexcept
Gets the height of the rectangle.
Definition: rect.hpp:191
T Top() const noexcept
Gets first row of the rectangle.
Definition: rect.hpp:111
T Left() const noexcept
Gets first column of the rectangle.
Definition: rect.hpp:91
T Width() const noexcept
Gets the width of the rectangle.
Definition: rect.hpp:171
Class to store camera sensor settings.
Definition: sensor_settings.hpp:26
SensorSettings() noexcept
Default ctor.
Definition: sensor_settings.hpp:30
SensorSettings(double rangeScale, SensorPixelPosition pixelPosition, SensorPixelsMirrored pixelsMirrored, Rect< int > sensorRoi, Point2D< double > resolutionReduction)
Ctor passing sensor settings.
Definition: sensor_settings.hpp:54
double RangeScale() const noexcept
Gets range scale (z factor).
Definition: sensor_settings.hpp:93
bool operator==(const SensorSettings &other) const noexcept
Compares to other sensor settings.
Definition: sensor_settings.hpp:132
bool operator!=(const SensorSettings &other) const noexcept
Compares to other sensor settings.
Definition: sensor_settings.hpp:156
Point2D< double > ResolutionReduction() const noexcept
Gets horizontal (X) and vertical (Y) resolution reduction factors (due to binning).
Definition: sensor_settings.hpp:124
SensorPixelsMirrored PixelsMirrored() const noexcept
Gets information if sensor pixels are mirrored.
Definition: sensor_settings.hpp:107
SensorPixelPosition PixelPosition() const noexcept
Gets pixel position in y on sensor.
Definition: sensor_settings.hpp:100
Rect< int > SensorRoi() const noexcept
Gets sensor region of interest (ROI).
Definition: sensor_settings.hpp:114
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24
SensorPixelPosition
Indicates pixel position on sensor.
Definition: core_3d.hpp:246
@ Absolute
Scaled rangemap values represent absolute pixel position on sensor.
SensorPixelsMirrored
Indicates if sensor pixels are mirrored in rangemap.
Definition: core_3d.hpp:260
@ X
Sensor pixel values are mirrored in X (or denoted by u), so that the columns of the range map will be...
@ Y
Sensor pixel values are mirrored in Y (or denoted by v), so that the range map pixel values will be f...
@ XY
Sensor pixel values are mirrored in X and Y.