Autoware.Auto
camera_settings.hpp
Go to the documentation of this file.
1 // Copyright 2020 Apex.AI, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef SPINNAKER_CAMERA_DRIVER__CAMERA_SETTINGS_HPP_
16 #define SPINNAKER_CAMERA_DRIVER__CAMERA_SETTINGS_HPP_
17 
18 #include <common/types.hpp>
20 
21 #include <string>
22 #include <set>
23 #include <stdexcept>
24 
25 namespace autoware
26 {
27 namespace drivers
28 {
29 namespace camera
30 {
31 namespace spinnaker
32 {
33 
35 class SPINNAKER_CAMERA_PUBLIC CameraSettings
36 {
37 public:
38  static const char * kPixelFormatStr_RGGB8;
39  static const char * kPixelFormatStr_GRBG8;
40  static const char * kPixelFormatStr_GBRG8;
41  static const char * kPixelFormatStr_BGGR8;
42  static const char * kPixelFormatStr_RGB8;
43  static const char * kPixelFormatStr_BGR8;
44  static const char * kPixelFormatStr_MONO8;
45  static const char * kPixelFormatStr_UNKNOWN;
46 
48  explicit CameraSettings(
49  std::uint32_t window_width,
50  std::uint32_t window_height,
52  const std::string & pixel_format,
53  const std::string & frame_id = "camera",
54  std::int64_t device_link_throughput_limit = 100000000L);
55 
56  inline std::uint32_t get_window_width() const noexcept {return m_window_width;}
57  inline std::uint32_t get_window_height() const noexcept {return m_window_height;}
58  inline const std::string & get_pixel_format() const noexcept {return m_pixel_format;}
59  inline const std::string & get_frame_id() const noexcept {return m_frame_id;}
60  inline common::types::float64_t get_fps() const noexcept {return m_fps;}
61  inline std::int64_t get_device_link_throughput_limit() const noexcept
62  {
63  return m_device_link_throughput_limit;
64  }
65 
66 private:
68  static const std::set<std::string> kValidPixelFormats;
69 
71  std::uint32_t m_window_width;
73  std::uint32_t m_window_height;
74 
76  std::string m_pixel_format;
77 
79  std::string m_frame_id;
80 
83 
85  std::int64_t m_device_link_throughput_limit;
86 };
87 
88 } // namespace spinnaker
89 } // namespace camera
90 } // namespace drivers
91 } // namespace autoware
92 
93 
94 #endif // SPINNAKER_CAMERA_DRIVER__CAMERA_SETTINGS_HPP_
autoware::drivers::camera::spinnaker::CameraSettings::kPixelFormatStr_MONO8
static const char * kPixelFormatStr_MONO8
Definition: camera_settings.hpp:44
autoware::drivers::camera::spinnaker::CameraSettings::kPixelFormatStr_GRBG8
static const char * kPixelFormatStr_GRBG8
Definition: camera_settings.hpp:39
autoware::drivers::camera::spinnaker::CameraSettings::get_window_height
std::uint32_t get_window_height() const noexcept
Definition: camera_settings.hpp:57
autoware::drivers::camera::spinnaker::CameraSettings::get_window_width
std::uint32_t get_window_width() const noexcept
Definition: camera_settings.hpp:56
autoware::drivers::camera::spinnaker::CameraSettings
Encapsulate settings that make sense to pass to a camera.
Definition: camera_settings.hpp:35
autoware::drivers::camera::spinnaker::CameraSettings::get_device_link_throughput_limit
std::int64_t get_device_link_throughput_limit() const noexcept
Definition: camera_settings.hpp:61
types.hpp
This file includes common type definition.
autoware::drivers::camera::spinnaker::CameraSettings::kPixelFormatStr_BGGR8
static const char * kPixelFormatStr_BGGR8
Definition: camera_settings.hpp:41
autoware::drivers::camera::spinnaker::CameraSettings::kPixelFormatStr_GBRG8
static const char * kPixelFormatStr_GBRG8
Definition: camera_settings.hpp:40
autoware::drivers::camera::spinnaker::CameraSettings::get_fps
common::types::float64_t get_fps() const noexcept
Definition: camera_settings.hpp:60
autoware
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24
autoware::drivers::camera::spinnaker::CameraSettings::kPixelFormatStr_RGB8
static const char * kPixelFormatStr_RGB8
Definition: camera_settings.hpp:42
autoware::drivers::camera::spinnaker::CameraSettings::kPixelFormatStr_RGGB8
static const char * kPixelFormatStr_RGGB8
Definition: camera_settings.hpp:38
visibility_control.hpp
autoware::drivers::camera::spinnaker::CameraSettings::get_frame_id
const std::string & get_frame_id() const noexcept
Definition: camera_settings.hpp:59
autoware::drivers::camera::spinnaker::CameraSettings::kPixelFormatStr_UNKNOWN
static const char * kPixelFormatStr_UNKNOWN
Definition: camera_settings.hpp:45
autoware::drivers::camera::spinnaker::CameraSettings::get_pixel_format
const std::string & get_pixel_format() const noexcept
Definition: camera_settings.hpp:58
autoware::common::types::float64_t
double float64_t
Definition: types.hpp:37
autoware::drivers::camera::spinnaker::CameraSettings::kPixelFormatStr_BGR8
static const char * kPixelFormatStr_BGR8
Definition: camera_settings.hpp:43