ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
AzureKinectSensorConfig.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 <IJsonConvertible.h>
11 
12 #include <string>
13 #include <unordered_map>
14 
16 
17 struct _k4a_device_configuration_t; // Alias of k4a_device_configuration_t
18 
19 namespace cloudViewer {
20 namespace io {
21 
22 // Alternative implementation of _k4a_device_configuration_t with string values
23 
28 public:
33  const std::unordered_map<std::string, std::string> &config);
34  bool ConvertToJsonValue(Json::Value &value) const override;
35  bool ConvertFromJsonValue(const Json::Value &value) override;
36 
37 public:
38  void ConvertFromNativeConfig(const _k4a_device_configuration_t &k4a_config);
39  _k4a_device_configuration_t ConvertToNativeConfig() const;
40 
41 public:
42  // To avoid including k4a or json header, configs is stored in a map
43  std::unordered_map<std::string, std::string> config_;
44 
45 protected:
46  static bool IsValidConfig(
47  const std::unordered_map<std::string, std::string> &config,
48  bool verbose = true);
49 };
50 
51 } // namespace io
52 } // namespace cloudViewer
_k4a_device_configuration_t ConvertToNativeConfig() const
bool ConvertToJsonValue(Json::Value &value) const override
std::unordered_map< std::string, std::string > config_
void ConvertFromNativeConfig(const _k4a_device_configuration_t &k4a_config)
bool ConvertFromJsonValue(const Json::Value &value) override
AzureKinectSensorConfig()
Default constructor, default configs will be used.
static bool IsValidConfig(const std::unordered_map< std::string, std::string > &config, bool verbose=true)
Generic file read and write utility for python interface.