ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
RealSenseSensorConfig.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <IJsonConvertibleIO.h>
11 
12 #include <set>
13 #include <string>
14 #include <unordered_map>
15 #include <utility>
16 
17 #include "cloudViewer/core/Dtype.h"
20 
21 // Forward declarations
22 namespace rs2 {
23 class config;
24 class pipeline_profile;
25 } // namespace rs2
26 
27 namespace cloudViewer {
28 using io::RGBDSensorConfig;
29 namespace t {
30 namespace io {
31 
64 public:
69  const std::unordered_map<std::string, std::string> &config);
70  bool ConvertToJsonValue(Json::Value &value) const override;
71  bool ConvertFromJsonValue(const Json::Value &value) override;
72 
74  rs2::config ConvertToNativeConfig() const;
75 
77  static Json::Value GetMetadataJson(const rs2::pipeline_profile &profile);
78 
81  static void GetPixelDtypes(const rs2::pipeline_profile &profile,
82  RGBDVideoMetadata &metadata);
83 
84 public:
88  static std::pair<core::Dtype, uint8_t> get_dtype_channels(
89  int rs2_format_enum);
90 
91  // To avoid including RealSense or json header, config is stored in a
92  // map
93  std::unordered_map<std::string, std::string> config_;
94 };
95 
100  std::string serial;
101  std::string name;
104  std::unordered_map<std::string, std::set<std::string>> valid_configs;
105 };
106 
107 } // namespace io
108 } // namespace t
109 } // namespace cloudViewer
CloudViewerScene::LightingProfile profile
rs2::config ConvertToNativeConfig() const
Convert to RealSense config.
bool ConvertToJsonValue(Json::Value &value) const override
bool ConvertFromJsonValue(const Json::Value &value) override
RealSenseSensorConfig()
Default constructor, default configs will be used.
static void GetPixelDtypes(const rs2::pipeline_profile &profile, RGBDVideoMetadata &metadata)
static std::pair< core::Dtype, uint8_t > get_dtype_channels(int rs2_format_enum)
std::unordered_map< std::string, std::string > config_
static Json::Value GetMetadataJson(const rs2::pipeline_profile &profile)
Get metadata for a streaming RealSense camera or bag file.
Generic file read and write utility for python interface.
std::unordered_map< std::string, std::set< std::string > > valid_configs
std::string serial
Device serial number.