6 #include "../include/librealsense2/h/rs_option.h" 23 virtual void set(
float value) = 0;
24 virtual float query()
const = 0;
26 virtual bool is_enabled()
const = 0;
28 virtual const char* get_description()
const = 0;
30 virtual void create_snapshot(std::shared_ptr<option>& snapshot)
const;
32 virtual ~
option() =
default;
40 virtual bool supports_option(
rs2_option id)
const = 0;
41 virtual std::vector<rs2_option> get_supported_options()
const = 0;
42 virtual const char* get_option_name(
rs2_option)
const = 0;
53 auto it = _options.find(
id);
54 if (
it == _options.end())
return false;
55 return it->second->is_enabled();
65 auto it = _options.find(
id);
66 if (
it == _options.end())
69 <<
"Device does not support option " 70 << get_option_name(
id) <<
"!");
77 return (const_cast<const options_container*>(
this)->get_option_handler(
id));
82 auto it = _options.find(
id);
83 return (
it == _options.end() ? std::shared_ptr<option>(
nullptr) :
it->second);
89 _recording_function(*
this);
99 snapshot = std::make_shared<options_container>(*this);
104 _recording_function = record_action;
107 void update(std::shared_ptr<extension_snapshot> ext)
override 109 auto ctr = As<options_container>(ext);
111 for(
auto&& opt : ctr->_options)
113 _options[opt.first] = opt.second;
117 std::vector<rs2_option> get_supported_options()
const override;
125 std::map<rs2_option, std::shared_ptr<option>>
_options;
126 std::function<void(const options_interface&)> _recording_function = [](
const options_interface&) {};
std::shared_ptr< option > get_option_handler(rs2_option id) const
const char * get_string(rs2_rs400_visual_preset value)
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
void enable_recording(std::function< void(const options_interface &)> record_action) override
std::shared_ptr< option > get_option_handler(rs2_option id)
bool supports_option(rs2_option id) const override
std::map< rs2_option, std::shared_ptr< option > > _options
#define LRS_EXTENSION_API
option & get_option(rs2_option id) override
void unregister_option(rs2_option id)
void register_option(rs2_option id, std::shared_ptr< option > option)
virtual const char * get_value_description(float) const
void update(std::shared_ptr< extension_snapshot > ext) override
void create_snapshot(std::shared_ptr< options_interface > &snapshot) const override
const option & get_option(rs2_option id) const override
virtual bool is_read_only() const
virtual const char * get_option_name(rs2_option option) const override
MAP_EXTENSION(RS2_EXTENSION_POINTS, librealsense::points)
std::string to_string(T value)