3#include <cvb/_cexports/c_img.h>
4#include <cvb/core_3d.hpp>
6#include <cvb/point_2d.hpp>
31 : size_(sizeof(CExports::CVC3DSensorSettings))
39 , resolutionReductionX_(1.0)
40 , resolutionReductionY_(1.0)
64 : size_(sizeof(CExports::CVC3DSensorSettings))
65 , rangeScale_(rangeScale)
66 , pixelPosition_(pixelPosition)
67 , pixelsMirrored_(pixelsMirrored)
68 , offsetLeft_(sensorRoi.Left())
69 , offsetTop_(sensorRoi.Top())
70 , width_(sensorRoi.Width())
71 , height_(sensorRoi.Height())
72 , resolutionReductionX_(resolutionReduction.
X())
73 , resolutionReductionY_(resolutionReduction.
Y())
75 static_assert(
sizeof(
SensorSettings) ==
sizeof(CExports::CVC3DSensorSettings),
76 "size of class SensorSettings and CExports::CVC3DSensorSettings must be equal");
78 if (sensorRoi.
Left() == 0 && sensorRoi.
Top() == 0 && sensorRoi.
Width() == 0 && sensorRoi.
Height() == 0)
80 if (MirrorX() || MirrorY())
84 if (!MirrorX() && sensorRoi.
Width() < 0)
85 throw std::invalid_argument(
"reverse_x = false and sensorRoi.Width < 0 are contradictory. Please set reverse_x to TRUE.");
87 if (!MirrorY() && sensorRoi.
Height() < 0)
88 throw std::invalid_argument(
"reverse_y = false and sensorRoi.Height < 0 are contradictory. Please set reverse_y to TRUE.");
90 if (sensorRoi.
Left() < 0 || sensorRoi.
Top() < 0)
94 throw std::invalid_argument(
"Sensor ROI is not valid: sensorRoi.Top must be zero as absolutePosition = true");
143 return size_ == other.size_
144 && rangeScale_ == other.rangeScale_
145 && pixelPosition_ == other.pixelPosition_
146 && pixelsMirrored_ == other.pixelsMirrored_
148 && resolutionReductionX_ == other.resolutionReductionX_
149 && resolutionReductionY_ == other.resolutionReductionY_;
160 return !(*
this == other);
170 CExports::cvbdim_t offsetLeft_;
171 CExports::cvbdim_t offsetTop_;
172 CExports::cvbdim_t width_;
173 CExports::cvbdim_t height_;
176 double resolutionReductionX_;
177 double resolutionReductionY_;
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:63
double RangeScale() const noexcept
Gets range scale (z factor).
Definition: sensor_settings.hpp:102
bool operator==(const SensorSettings &other) const noexcept
Compares to other sensor settings.
Definition: sensor_settings.hpp:141
bool operator!=(const SensorSettings &other) const noexcept
Compares to other sensor settings.
Definition: sensor_settings.hpp:158
Point2D< double > ResolutionReduction() const noexcept
Gets horizontal (X) and vertical (Y) resolution reduction factors (due to binning).
Definition: sensor_settings.hpp:133
SensorPixelsMirrored PixelsMirrored() const noexcept
Gets information if sensor pixels are mirrored.
Definition: sensor_settings.hpp:116
SensorPixelPosition PixelPosition() const noexcept
Gets pixel position in y on sensor.
Definition: sensor_settings.hpp:109
Rect< int > SensorRoi() const noexcept
Gets sensor region of interest (ROI).
Definition: sensor_settings.hpp:123
Root namespace for the Image Manager interface.
Definition: c_barcode.h:15
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.