DvsenseDriver  1.0.3
The SDK for dvsense products.
CameraTool.h
1 #ifndef CAMERA_TOOL_BASE_HPP
2 #define CAMERA_TOOL_BASE_HPP
3 
4 #include <string>
5 #include <map>
6 #include <map>
7 #include "DvsenseHal/camera/tools/ToolInfo.h"
8 
9 #ifdef _WIN32
10  #ifdef DVSENSE_HAL_EXPORTS
11  #define DVSENSE_API __declspec(dllexport)
12  #else
13  #define DVSENSE_API __declspec(dllimport)
14  #endif
15 #else
16 #define DVSENSE_API
17 #endif // _WIN32
18 
19 namespace dvsense
20 {
21 
27  class DVSENSE_API CameraTool
28  {
29  public:
30  CameraTool(std::string prefix = "") : prefix_(prefix) {}
31 
32  virtual ~CameraTool(){}
33 
41  virtual const ToolInfo getToolInfo() = 0;
42 
50  virtual std::map<std::string, BasicParameterInfo> getAllParamInfo() = 0;
51 
63  virtual bool getParamInfo(const std::string name, IntParameterInfo &info) = 0;
64  virtual bool getParamInfo(const std::string name, FloatParameterInfo& info) = 0;
65  virtual bool getParamInfo(const std::string name, BoolParameterInfo& info) = 0;
66  virtual bool getParamInfo(const std::string name, EnumParameterInfo& info) = 0;
67 
79  virtual bool getParam(const std::string name, int& value);
80  virtual bool getParam(const std::string name, float& value);
81  virtual bool getParam(const std::string name, bool& value);
82  virtual bool getParam(const std::string name, std::string& value);
94  virtual bool setParam(const std::string name, const int& value);
95  virtual bool setParam(const std::string name, const float& value);
96  virtual bool setParam(const std::string name, const double& value);
97  virtual bool setParam(const std::string name, const bool& value);
98  virtual bool setParam(const std::string name, const char* value);
99  virtual bool setParam(const std::string name, const std::string& value);
100 
101  protected:
102  std::string prefix_ = "";
103  };
104 } // namespace dvsense
105 
106 #endif // CAMERA_TOOL_BASE_HPP
相机工具的基类。工具指的是用来控制相机的抽象概念,可以用来设置各种相机参数、获取相机参数信息、进行数据处理等。
Definition: CameraTool.h:28
virtual bool getParamInfo(const std::string name, FloatParameterInfo &info)=0
virtual bool setParam(const std::string name, const int &value)
设置一个参数的值。
virtual bool setParam(const std::string name, const bool &value)
virtual bool getParam(const std::string name, std::string &value)
virtual const ToolInfo getToolInfo()=0
获取工具的信息。
virtual bool getParamInfo(const std::string name, IntParameterInfo &info)=0
获取一个参数的详细信息。
virtual bool getParam(const std::string name, bool &value)
virtual bool getParam(const std::string name, float &value)
virtual bool setParam(const std::string name, const double &value)
virtual bool setParam(const std::string name, const std::string &value)
virtual bool getParam(const std::string name, int &value)
获取一个参数的值。
virtual bool setParam(const std::string name, const char *value)
virtual std::map< std::string, BasicParameterInfo > getAllParamInfo()=0
获取所有参数的基本信息。如果想要获取某个参数的详细信息,请参考 CameraTool::getParamInfo 。
virtual ~CameraTool()
Definition: CameraTool.h:32
virtual bool getParamInfo(const std::string name, EnumParameterInfo &info)=0
virtual bool setParam(const std::string name, const float &value)
virtual bool getParamInfo(const std::string name, BoolParameterInfo &info)=0
CameraTool(std::string prefix="")
Definition: CameraTool.h:30
Definition: TypeUtils.hpp:7
工具的信息,包括类型、可以更改的参数名称和描述。
Definition: ToolInfo.h:45
布尔参数的详细信息。
Definition: ToolInfo.h:148
枚举参数的详细信息。
Definition: ToolInfo.h:162
浮点数参数的详细信息。
Definition: ToolInfo.h:122
整数参数的详细信息。
Definition: ToolInfo.h:96