d400-nonmonochrome.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2016 Intel Corporation. All Rights Reserved.
3 
4 #include <mutex>
5 #include <chrono>
6 #include <vector>
7 #include <iterator>
8 #include <cstddef>
9 
10 #include "device.h"
11 #include "image.h"
12 #include "metadata-parser.h"
13 
14 #include "d400-nonmonochrome.h"
15 #include "d400-private.h"
16 #include "d400-options.h"
17 #include "d400-info.h"
18 #include "ds/ds-timestamp.h"
21 
22 namespace librealsense
23 {
24  d400_nonmonochrome::d400_nonmonochrome( std::shared_ptr< const d400_info > const & dev_info )
25  : device(dev_info), d400_device(dev_info)
26  {
27  using namespace ds;
28 
29  auto pid = dev_info->get_group().uvc_devices.front().pid;
30  auto& depth_ep = get_depth_sensor();
31 
32  // RGB for D455 from Left Imager is available with FW 5.12.8.100
33  if ((val_in_range(pid, { RS455_PID })) && (_fw_version < firmware_version("5.12.8.100")))
34  return;
35 
36  if ((_fw_version >= firmware_version("5.5.8.0")) && (!val_in_range(pid, { RS_USB2_PID })))
37  {
38  if (!val_in_range(pid, { RS405_PID, RS455_PID }))
39  {
40  depth_ep.register_option(RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE,
41  std::make_shared<uvc_xu_option<uint8_t>>(get_raw_depth_sensor(),
42  depth_xu,
44  "Enable Auto White Balance"));
45 
46  depth_ep.register_processing_block({ {RS2_FORMAT_W10} }, { {RS2_FORMAT_RAW10, RS2_STREAM_INFRARED, 1} }, []() { return std::make_shared<w10_converter>(RS2_FORMAT_RAW10); });
47  depth_ep.register_processing_block({ {RS2_FORMAT_W10} }, { {RS2_FORMAT_Y10BPACK, RS2_STREAM_INFRARED, 1} }, []() { return std::make_shared<w10_converter>(RS2_FORMAT_Y10BPACK); });
48  }
49 
50  // RS400 rolling-shutter SKUs allow to get low-quality color image from the same viewport as the depth
51  depth_ep.register_processing_block({ {RS2_FORMAT_BGR8} }, { {RS2_FORMAT_RGB8, RS2_STREAM_INFRARED} }, []() { return std::make_shared<bgr_to_rgb>(); });
52  }
53 
54  depth_ep.register_processing_block(processing_block_factory::create_pbf_vector<uyvy_converter>(RS2_FORMAT_UYVY, map_supported_color_formats(RS2_FORMAT_UYVY), RS2_STREAM_INFRARED));
55 
56  if (!val_in_range(pid, { RS405_PID , RS455_PID }))
58 
59  if ((_fw_version >= firmware_version("5.9.13.6") &&
60  _fw_version < firmware_version("5.9.15.1")))
61  {
63  std::make_shared<external_sync_mode>(*_hw_monitor));
64  }
65  }
66 }
librealsense
Definition: algo.h:18
d400-private.h
librealsense::uvc_xu_option< uint8_t >
librealsense::synthetic_sensor::unregister_option
virtual void unregister_option(rs2_option id)
Definition: sensor.cpp:489
RS2_FORMAT_RAW10
@ RS2_FORMAT_RAW10
Definition: rs_sensor.h:74
RS2_FORMAT_RGB8
@ RS2_FORMAT_RGB8
Definition: rs_sensor.h:68
RS2_OPTION_INTER_CAM_SYNC_MODE
@ RS2_OPTION_INTER_CAM_SYNC_MODE
Definition: rs_option.h:70
librealsense::d400_device::get_raw_depth_sensor
std::shared_ptr< uvc_sensor > get_raw_depth_sensor()
Definition: d400-device.h:42
librealsense::ds::RS455_PID
const uint16_t RS455_PID
Definition: d400-private.h:38
librealsense::synthetic_sensor::register_option
virtual void register_option(rs2_option id, std::shared_ptr< option > option)
Definition: sensor.cpp:438
depth-formats-converter.h
device.h
librealsense::d400_nonmonochrome::d400_nonmonochrome
d400_nonmonochrome(std::shared_ptr< const d400_info > const &)
Definition: d400-nonmonochrome.cpp:24
librealsense::d400_device::_hw_monitor
std::shared_ptr< hw_monitor > _hw_monitor
Definition: d400-device.h:94
librealsense::d400_device::get_depth_sensor
synthetic_sensor & get_depth_sensor()
Definition: d400-device.h:37
RS2_FORMAT_W10
@ RS2_FORMAT_W10
Definition: rs_sensor.h:90
test-d405-calibration-stream.pid
pid
Definition: test-d405-calibration-stream.py:12
librealsense::val_in_range
bool val_in_range(const T &val, const std::initializer_list< T > &list)
Definition: src/types.h:66
librealsense::d400_device::_fw_version
firmware_version _fw_version
Definition: d400-device.h:95
RS2_FORMAT_Y10BPACK
@ RS2_FORMAT_Y10BPACK
Definition: rs_sensor.h:83
d400-options.h
librealsense::ds::RS_USB2_PID
const uint16_t RS_USB2_PID
Definition: d400-private.h:21
d400-info.h
librealsense::firmware_version
rsutils::version firmware_version
Definition: src/firmware-version.h:11
image.h
color-formats-converter.h
d400-nonmonochrome.h
librealsense::ds::RS405_PID
const uint16_t RS405_PID
Definition: d400-private.h:37
RS2_FORMAT_UYVY
@ RS2_FORMAT_UYVY
Definition: rs_sensor.h:77
test-fps.ds
ds
Definition: test-fps.py:77
librealsense::ds::depth_xu
const platform::extension_unit depth_xu
Definition: ds-private.h:67
RS2_STREAM_INFRARED
@ RS2_STREAM_INFRARED
Definition: rs_sensor.h:48
RS2_OPTION_EMITTER_ON_OFF
@ RS2_OPTION_EMITTER_ON_OFF
Definition: rs_option.h:74
librealsense::device
Definition: device.h:35
ds-timestamp.h
metadata-parser.h
RS2_FORMAT_BGR8
@ RS2_FORMAT_BGR8
Definition: rs_sensor.h:69
librealsense::ds::DS5_ENABLE_AUTO_WHITE_BALANCE
const uint8_t DS5_ENABLE_AUTO_WHITE_BALANCE
Definition: ds-private.h:57
librealsense::device::map_supported_color_formats
std::vector< rs2_format > map_supported_color_formats(rs2_format source_format)
Definition: device.cpp:180
RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE
@ RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE
Definition: rs_option.h:39
librealsense::d400_device
Definition: d400-device.h:26


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:02