44template <
typename ElementType>
99template <
typename ElementType>
106 Frame() : _width(0), _height(0), _pData(nullptr) {}
115 inline uint32_t
width()
const {
return _width; }
120 inline uint32_t
height()
const {
return _height; }
125 inline bool empty()
const {
return !_pData; }
130 inline const ElementType*
data()
const {
return _pData.get(); }
147 if (n >= _height * _width || !_pData)
148 throw std::out_of_range(
"invalid subscript");
149 ElementType*
data = _pData.get();
170 const ElementType&
at(uint32_t row, uint32_t col)
const
172 if (row >= _height || col >= _width || !_pData)
173 throw std::out_of_range(
"invalid subscript");
174 ElementType*
data = _pData.get();
175 return data[row * _width + col];
185 ElementType&
at(uint32_t row, uint32_t col)
203 _pData.reset(
new ElementType[_width * _height], [](ElementType* p) {
delete[] p; });
219 std::shared_ptr<ElementType> _pData;
244 float depthAt(uint32_t row, uint32_t col)
const {
return _depth.
at(row, col); }
245 unsigned char intensityAt(uint32_t row, uint32_t col)
const {
return _intensity.
at(row, col); }
246 unsigned int encoderAt(uint32_t row, uint32_t col)
const {
return _encoder.
at(row, col); }
247 long long frameIdAt(uint32_t row, uint32_t col)
const {
return _frameId.
at(row, col); }
249 void resize(uint32_t width, uint32_t height)
251 _columnCount = width;
253 _depth.
resize(_columnCount, _lineCount);
254 _intensity.
resize(_columnCount, _lineCount);
255 _encoder.
resize(1, _lineCount);
256 _frameId.
resize(1, _lineCount);
265 uint32_t _columnCount;
Definition of data structure in device capturing image.
Definition MechEyeFrame.hpp:101
const ElementType & operator[](std::size_t n) const
Definition MechEyeFrame.hpp:145
void release()
Definition MechEyeFrame.hpp:209
~Frame()
Definition MechEyeFrame.hpp:110
ElementType * data()
Definition MechEyeFrame.hpp:135
const ElementType * data() const
Definition MechEyeFrame.hpp:130
uint32_t height() const
Definition MechEyeFrame.hpp:120
const ElementType & at(uint32_t row, uint32_t col) const
Definition MechEyeFrame.hpp:170
ElementType & at(uint32_t row, uint32_t col)
Definition MechEyeFrame.hpp:185
uint32_t width() const
Definition MechEyeFrame.hpp:115
bool empty() const
Definition MechEyeFrame.hpp:125
ElementType & operator[](std::size_t n)
Definition MechEyeFrame.hpp:158
Frame()
Definition MechEyeFrame.hpp:106
void resize(uint32_t width, uint32_t height)
Definition MechEyeFrame.hpp:196
Definition MechEyeFrame.hpp:223
long long frameIdAt(uint32_t row, uint32_t col) const
Definition MechEyeFrame.hpp:247
float depthAt(uint32_t row, uint32_t col) const
Definition MechEyeFrame.hpp:244
const Frame< long long > & frameId() const
Definition MechEyeFrame.hpp:237
~LineBatch()
Definition MechEyeFrame.hpp:226
const Frame< unsigned char > & intensity() const
Definition MechEyeFrame.hpp:231
const Frame< unsigned int > & encoder() const
Definition MechEyeFrame.hpp:234
Frame< long long > & frameId()
Definition MechEyeFrame.hpp:238
Frame< unsigned int > & encoder()
Definition MechEyeFrame.hpp:235
LineBatch()
Definition MechEyeFrame.hpp:225
uint32_t lineCount() const
Definition MechEyeFrame.hpp:241
const Frame< float > & depth() const
Definition MechEyeFrame.hpp:228
void setLineCount(uint32_t lineCount)
Definition MechEyeFrame.hpp:240
Frame< float > & depth()
Definition MechEyeFrame.hpp:229
unsigned char intensityAt(uint32_t row, uint32_t col) const
Definition MechEyeFrame.hpp:245
unsigned int encoderAt(uint32_t row, uint32_t col) const
Definition MechEyeFrame.hpp:246
uint32_t columnCount() const
Definition MechEyeFrame.hpp:242
Frame< unsigned char > & intensity()
Definition MechEyeFrame.hpp:232
void resize(uint32_t width, uint32_t height)
Definition MechEyeFrame.hpp:249
Frame< ElementColor > ColorMap
Definition MechEyeFrame.hpp:88
Frame< ElementDepth > DepthMap
Definition MechEyeFrame.hpp:90
Frame< ElementPointXYZBGR > PointXYZBGRMap
Definition MechEyeFrame.hpp:94
Frame< ElementPointXYZ > PointXYZMap
Definition MechEyeFrame.hpp:92
Element in ColorMap.
Definition MechEyeFrame.hpp:59
uint8_t g
Green channel.
Definition MechEyeFrame.hpp:61
uint8_t b
Blue channel.
Definition MechEyeFrame.hpp:60
uint8_t r
Red channel.
Definition MechEyeFrame.hpp:62
Element in DepthMap.
Definition MechEyeFrame.hpp:51
float d
Depth channel, unit: mm.
Definition MechEyeFrame.hpp:52
Element in PointXYZBGRMap.
Definition MechEyeFrame.hpp:79
uint8_t g
Green channel.
Definition MechEyeFrame.hpp:84
uint8_t b
Blue channel.
Definition MechEyeFrame.hpp:83
uint8_t r
Red channel.
Definition MechEyeFrame.hpp:85
float y
Y channel, unit: mm.
Definition MechEyeFrame.hpp:81
float x
X channel, unit: mm.
Definition MechEyeFrame.hpp:80
float z
Z channel, unit: mm.
Definition MechEyeFrame.hpp:82
Element in PointXYZMap.
Definition MechEyeFrame.hpp:69
float y
Y channel, unit: mm.
Definition MechEyeFrame.hpp:71
float x
X channel, unit: mm.
Definition MechEyeFrame.hpp:70
float z
Z channel, unit: mm.
Definition MechEyeFrame.hpp:72