RealSense Cross Platform API
RealSense Cross-platform API
Classes | Public Member Functions | Protected Member Functions | List of all members
rs2::options Class Reference

#include <rs_options.hpp>

Inheritance diagram for rs2::options:
rs2::embedded_filter rs2::processing_block rs2::sensor rs2::embedded_close_range_filter rs2::embedded_decimation_filter rs2::embedded_temporal_filter rs2::asynchronous_syncer rs2::filter rs2::color_sensor rs2::debug_stream_sensor rs2::depth_mapping_sensor rs2::depth_sensor rs2::fisheye_sensor rs2::max_usable_range_sensor rs2::motion_sensor rs2::perception_sensor rs2::pose_sensor rs2::roi_sensor rs2::safety_sensor rs2::software_sensor rs2::wheel_odometer

Public Member Functions

bool supports (rs2_option option) const
 
const char * get_option_description (rs2_option option) const
 
const char * get_option_name (rs2_option option) const
 
const char * get_option_value_description (rs2_option option, float val) const
 
float get_option (rs2_option option) const
 
option_value get_option_value (rs2_option option_id) const
 
option_range get_option_range (rs2_option option) const
 
void set_option (rs2_option option, float value) const
 
void set_option_value (option_value const &value) const
 
bool is_option_read_only (rs2_option option) const
 
void on_options_changed (std::function< void(const options_list &) > callback) const
 
std::vector< rs2_option > get_supported_options ()
 
options_list get_supported_option_values ()
 
void set_composite_option (rs2_composite_option_id id, const void *data, size_t size) const
 
std::vector< uint8_t > get_composite_option (rs2_composite_option_id id) const
 
std::vector< uint8_t > get_composite_option_range (rs2_composite_option_id id) const
 
template<typename T >
T get_composite_option_as (rs2_composite_option_id id) const
 
template<typename TRange >
TRange get_composite_option_range_as (rs2_composite_option_id id) const
 
template<typename T >
void set_composite_option_from (rs2_composite_option_id id, const T &value) const
 
bool supports_composite_option (rs2_composite_option_id id) const
 
bool is_composite_option_read_only (rs2_composite_option_id id) const
 
const char * get_composite_option_description (rs2_composite_option_id id) const
 
std::vector< rs2_composite_option_id > get_supported_composite_options () const
 
options & operator= (const options &other)
 
 options (const options &other)
 
virtual ~options ()=default
 

Protected Member Functions

 options (rs2_options *o=nullptr)
 
template<class T >
options & operator= (const T &dev)
 

Constructor & Destructor Documentation

◆ options() [1/2]

rs2::options::options ( const options &  other)
inline

◆ ~options()

virtual rs2::options::~options ( )
virtualdefault

◆ options() [2/2]

rs2::options::options ( rs2_options *  o = nullptr)
inlineexplicitprotected

Member Function Documentation

◆ get_composite_option()

std::vector< uint8_t > rs2::options::get_composite_option ( rs2_composite_option_id  id) const
inline

read a composite option's current raw payload, atomically, in ONE UVC transaction

Parameters
[in]idcomposite option id to read
Returns
the option's current raw payload bytes - cast to a struct matching the option's documented wire layout

◆ get_composite_option_as()

template<typename T >
T rs2::options::get_composite_option_as ( rs2_composite_option_id  id) const
inline

typed counterpart to get_composite_option() - casts the raw payload directly into T. Validates sizeof(T) matches, and for structs with a composed dpp_header, that its version is DPP_HEADER_CURRENT_VERSION (see rs_dpp_header.h), unpopulated (0) included.

Parameters
[in]idcomposite option id to read
Returns
T, populated from the option's current raw payload

◆ get_composite_option_description()

const char* rs2::options::get_composite_option_description ( rs2_composite_option_id  id) const
inline

get a composite option's human-readable description

Parameters
[in]idcomposite option id to describe
Returns
human-readable composite option description

◆ get_composite_option_range()

std::vector< uint8_t > rs2::options::get_composite_option_range ( rs2_composite_option_id  id) const
inline

read a composite option's supported {min,max,step,def} bounds

Parameters
[in]idcomposite option id to read
Returns
the option's range payload bytes - cast to the range struct documented for id

◆ get_composite_option_range_as()

template<typename TRange >
TRange rs2::options::get_composite_option_range_as ( rs2_composite_option_id  id) const
inline

typed counterpart to get_composite_option_range() - casts the raw {min,max,step,def} payload into TRange. Validates sizeof(TRange); the wrapper itself has no version field, but each of its four bounds does, each checked the same way as check_version_supported().

Parameters
[in]idcomposite option id to read
Returns
TRange, populated from the option's raw range payload

◆ get_option()

float rs2::options::get_option ( rs2_option  option) const
inline

read option's float value

Parameters
[in]optionoption id to be queried
Returns
value of the option

◆ get_option_description()

const char* rs2::options::get_option_description ( rs2_option  option) const
inline

get option description

Parameters
[in]optionoption id to be checked
Returns
human-readable option description

◆ get_option_name()

const char* rs2::options::get_option_name ( rs2_option  option) const
inline

get option name

Parameters
[in]optionoption id to be checked
Returns
human-readable option name

◆ get_option_range()

option_range rs2::options::get_option_range ( rs2_option  option) const
inline

retrieve the available range of values of a supported option

Returns
option range containing minimum and maximum values, step and default value

◆ get_option_value()

option_value rs2::options::get_option_value ( rs2_option  option_id) const
inline

read option's value

Parameters
[in]option_idoption id to be queried
Returns
option value

◆ get_option_value_description()

const char* rs2::options::get_option_value_description ( rs2_option  option,
float  val 
) const
inline

get option value description (in case specific option value hold special meaning)

Parameters
[in]optionoption id to be checked
[in]valvalue of the option
Returns
human-readable description of a specific value of an option or null if no special meaning

◆ get_supported_composite_options()

std::vector< rs2_composite_option_id > rs2::options::get_supported_composite_options ( ) const
inline
Returns
the list of composite option ids this options object (sensor or embedded_filter) supports

◆ get_supported_option_values()

options_list rs2::options::get_supported_option_values ( )
inline

◆ get_supported_options()

std::vector<rs2_option> rs2::options::get_supported_options ( )
inline

◆ is_composite_option_read_only()

bool rs2::options::is_composite_option_read_only ( rs2_composite_option_id  id) const
inline

check if a composite option is read-only

Parameters
[in]idcomposite option id to be checked
Returns
true if the composite option is read-only

◆ is_option_read_only()

bool rs2::options::is_option_read_only ( rs2_option  option) const
inline

check if particular option is read-only

Parameters
[in]optionoption id to be checked
Returns
true if option is read-only

◆ on_options_changed()

void rs2::options::on_options_changed ( std::function< void(const options_list &) >  callback) const
inline

sets a callback in case an option in this options container value is updated

Parameters
[in]callbackthe callback function

◆ operator=() [1/2]

options& rs2::options::operator= ( const options &  other)
inline

◆ operator=() [2/2]

template<class T >
options& rs2::options::operator= ( const T &  dev)
inlineprotected

◆ set_composite_option()

void rs2::options::set_composite_option ( rs2_composite_option_id  id,
const void *  data,
size_t  size 
) const
inline

See rs_composite_option.h for the underlying C API and atomicity contract (one UVC transaction per call) - these methods just forward to the corresponding rs2_* function. write new value to a composite option, atomically, in ONE UVC transaction

Parameters
[in]idcomposite option id to write
[in]datapointer to the caller's struct matching the option's documented wire layout
[in]sizesizeof(...) of the caller's struct

◆ set_composite_option_from()

template<typename T >
void rs2::options::set_composite_option_from ( rs2_composite_option_id  id,
const T &  value 
) const
inline

typed counterpart to set_composite_option() - sends value itself. For structs carrying a header.version field, rejects a value whose version isn't current - most likely a get-modify-set that left the header zero-initialized.

Parameters
[in]idcomposite option id to write
[in]valuethe caller's struct matching the option's documented wire layout

◆ set_option()

void rs2::options::set_option ( rs2_option  option,
float  value 
) const
inline

write new value to the option

Parameters
[in]optionoption id to be queried
[in]valuenew value for the option

◆ set_option_value()

void rs2::options::set_option_value ( option_value const &  value) const
inline

write new value to the option

Parameters
[in]optionoption id to be queried
[in]valueoption (id,type,is_valid,new value)

◆ supports()

bool rs2::options::supports ( rs2_option  option) const
inline

check if particular option is supported

Parameters
[in]optionoption id to be checked
Returns
true if option is supported

◆ supports_composite_option()

bool rs2::options::supports_composite_option ( rs2_composite_option_id  id) const
inline

check if particular composite option is supported (and currently enabled)

Parameters
[in]idcomposite option id to be checked
Returns
true if the composite option is supported

The documentation for this class was generated from the following file: