Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/ds5/advanced_mode/advanced_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ namespace librealsense
assert_no_error(ds::fw_cmd::UAMG, results);
return results[4] > 0;
};

// "Remove IR Pattern" visual preset is available only for D400, D410, D415, D460, D465
std::string pid = _depth_sensor.get_info(RS2_CAMERA_INFO_PRODUCT_ID);
_preset_opt = std::make_shared<advanced_mode_preset_option>(*this,
_depth_sensor,
option_range{ 0,
RS2_RS400_VISUAL_PRESET_COUNT - 1,
depth_sensor.get_preset_max_value(),
1,
RS2_RS400_VISUAL_PRESET_CUSTOM });
_depth_sensor.register_option(RS2_OPTION_VISUAL_PRESET, _preset_opt);
Expand Down
19 changes: 19 additions & 0 deletions src/ds5/ds5-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,25 @@ namespace librealsense
{
//does not change over time
}

float get_preset_max_value() const override
{
float preset_max_value = RS2_RS400_VISUAL_PRESET_COUNT - 1;
switch (_owner->_pid)
{
case ds::RS400_PID:
case ds::RS410_PID:
case ds::RS415_PID:
case ds::RS465_PID:
case ds::RS460_PID:
preset_max_value = static_cast<float>(RS2_RS400_VISUAL_PRESET_REMOVE_IR_PATTERN);
break;
default:
preset_max_value = static_cast<float>(RS2_RS400_VISUAL_PRESET_MEDIUM_DENSITY);
}
return preset_max_value;
}

protected:
const ds5_device* _owner;
mutable std::atomic<float> _depth_units;
Expand Down
6 changes: 6 additions & 0 deletions src/sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,12 @@ namespace librealsense
_raw_sensor->stop();
}

float librealsense::synthetic_sensor::get_preset_max_value() const
{
// to be overriden by depth sensors which need this api
return 0.0f;
}

void synthetic_sensor::register_processing_block(const std::vector<stream_profile>& from,
const std::vector<stream_profile>& to,
std::function<std::shared_ptr<processing_block>(void)> generate_func)
Expand Down
2 changes: 2 additions & 0 deletions src/sensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ namespace librealsense
void start(frame_callback_ptr callback) override;
void stop() override;

virtual float get_preset_max_value() const;

void register_processing_block(const std::vector<stream_profile>& from,
const std::vector<stream_profile>& to,
std::function<std::shared_ptr<processing_block>(void)> generate_func);
Expand Down