hfl_frame.h
Go to the documentation of this file.
1 // Copyright 2020 Continental AG
2 // All rights reserved.
3 //
4 // Software License Agreement (BSD 2-Clause Simplified License)
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions
8 // are met:
9 //
10 // * Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
12 // * Redistributions in binary form must reproduce the above
13 // copyright notice, this list of conditions and the following
14 // disclaimer in the documentation and/or other materials provided
15 // with the distribution.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 // COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 // POSSIBILITY OF SUCH DAMAGE.
29 
30 
36 
37 #ifndef HFL_FRAME_H_
38 #define HFL_FRAME_H_
39 #include <hfl_pixel.h>
40 
41 #include <string>
42 #include <vector>
43 
44 namespace hfl
45 {
47 using Row = uint16_t;
48 
50 using Col = uint16_t;
51 
55 class Frame
56 {
57 public:
59  std::string id_;
60 
62  uint16_t intensity_bits_;
63 
65  uint16_t range_bits_;
66 
69 
72 
81  Frame(uint16_t height, uint16_t width, uint16_t returns_size, uint16_t slices_size);
82 
91  Pixel& atPixel(Col x, Row y);
92 
98  size_t getHeight() const
99  {
100  return height_;
101  }
102 
108  size_t getWidth() const
109  {
110  return width_;
111  }
112 
118  size_t getSize() const
119  {
120  return height_ * width_;
121  }
122 
128  size_t getSlicesSize() const
129  {
130  return slices_size_;
131  }
132 
133 private:
135  size_t height_;
136 
138  size_t width_;
139 
142 
144  size_t slices_size_;
145 
147  std::vector<std::vector<Pixel>> pixels;
148 };
149 
150 } // namespace hfl
151 #endif // HFL_FRAME_H_
Pixel & atPixel(Col x, Row y)
Definition: hfl_frame.cpp:49
uint16_t Col
Column number data type.
Definition: hfl_frame.h:50
This file defines the frame&#39;s classes components.
Frame(uint16_t height, uint16_t width, uint16_t returns_size, uint16_t slices_size)
Definition: hfl_frame.cpp:42
size_t getSlicesSize() const
Definition: hfl_frame.h:128
uint16_t intensity_publish_bits_
Frame intensity bits.
Definition: hfl_frame.h:71
Storages and handles the pixel data component.
Definition: hfl_pixel.h:63
size_t getHeight() const
Definition: hfl_frame.h:98
uint16_t range_precision_bits_
Frame intensity bits.
Definition: hfl_frame.h:68
uint16_t range_bits_
Frame intensity bits.
Definition: hfl_frame.h:65
uint16_t intensity_bits_
Frame intensity bits.
Definition: hfl_frame.h:62
size_t returns_size_
Number of returns per pixel.
Definition: hfl_frame.h:141
size_t width_
Number of columns.
Definition: hfl_frame.h:138
size_t getSize() const
Definition: hfl_frame.h:118
uint16_t Row
Row number data type.
Definition: hfl_frame.h:47
std::vector< std::vector< Pixel > > pixels
Pixel data array.
Definition: hfl_frame.h:147
size_t height_
Number of rows.
Definition: hfl_frame.h:135
Handles camera&#39;s frame data.
Definition: hfl_frame.h:55
std::string id_
Frame ID.
Definition: hfl_frame.h:59
size_t slices_size_
Number of slices per pixel.
Definition: hfl_frame.h:144
size_t getWidth() const
Definition: hfl_frame.h:108


hfl_driver
Author(s): Evan Flynn , Maxton Ginier , Gerardo Bravo , Moises Diaz
autogenerated on Sat Mar 20 2021 02:27:31