This article provides the code line needed to add into your C++ project for getting the Intel® RealSense™ viewer presets.
How can I use the preset JSON (JavaScript Object Notation) files from Intel® RealSense™ Viewer in my C++ code?
One option for using the Presets in C++ is to add to your code the following lines:
PipelineProfile profile = pipeline.Start(cfg);
var depthSensor = profile.Device.QuerySensors()[0];
if (depthSensor.Options[Option.VisualPreset].Supported)
depthSensor.Options[Option.VisualPreset].Value = (float)Rs400VisualPreset.HighDensity;
Read more about it here.
Another option will be to use these code lines:
auto sensor = profile.get_device().first<rs2::depth_sensor>();
sensor.set_option(rs2_option::RS2_OPTION_VISUAL_PRESET, rs2_rs400_visual_preset::RS2_RS400_VISUAL_PRESET_HIGH_ACCURACY);