ds5-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 "context.h"
12 #include "image.h"
13 #include "metadata-parser.h"
14 
15 #include "ds5-nonmonochrome.h"
16 #include "ds5-private.h"
17 #include "ds5-options.h"
18 #include "ds5-timestamp.h"
21 
22 namespace librealsense
23 {
24  ds5_nonmonochrome::ds5_nonmonochrome(std::shared_ptr<context> ctx,
26  : device(ctx, group), ds5_device(ctx, group)
27  {
28  using namespace ds;
29 
30  auto pid = group.uvc_devices.front().pid;
31  auto& depth_ep = get_depth_sensor();
32 
33  // RGB for D455 from Left Imager is available with FW 5.12.8.100
34  if ((RS455_PID == pid) && (_fw_version < firmware_version("5.12.8.100")))
35  return;
36 
37  if ((_fw_version >= firmware_version("5.5.8.0")) && (!val_in_range(pid, { RS_USB2_PID, RS465_PID })))
38  {
39  if (RS455_PID != pid && RS405_PID != pid)
40  {
41  depth_ep.register_option(RS2_OPTION_ENABLE_AUTO_WHITE_BALANCE,
42  std::make_shared<uvc_xu_option<uint8_t>>(get_raw_depth_sensor(),
43  depth_xu,
45  "Enable Auto White Balance"));
46 
47  depth_ep.register_processing_block({ {RS2_FORMAT_W10} }, { {RS2_FORMAT_RAW10, RS2_STREAM_INFRARED, 1} }, []() { return std::make_shared<w10_converter>(RS2_FORMAT_RAW10); });
48  depth_ep.register_processing_block({ {RS2_FORMAT_W10} }, { {RS2_FORMAT_Y10BPACK, RS2_STREAM_INFRARED, 1} }, []() { return std::make_shared<w10_converter>(RS2_FORMAT_Y10BPACK); });
49  }
50 
51  // RS400 rolling-shutter SKUs allow to get low-quality color image from the same viewport as the depth
52  depth_ep.register_processing_block({ {RS2_FORMAT_BGR8} }, { {RS2_FORMAT_RGB8, RS2_STREAM_INFRARED} }, []() { return std::make_shared<bgr_to_rgb>(); });
53  }
54 
55  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));
56 
57  if (RS455_PID != pid && RS405_PID != pid)
59 
60  if ((_fw_version >= firmware_version("5.9.13.6") &&
61  _fw_version < firmware_version("5.9.15.1")))
62  {
64  std::make_shared<external_sync_mode>(*_hw_monitor));
65  }
66  }
67 }
virtual void register_option(rs2_option id, std::shared_ptr< option > option)
Definition: sensor.cpp:1070
firmware_version _fw_version
Definition: ds5-device.h:88
std::shared_ptr< hw_monitor > _hw_monitor
Definition: ds5-device.h:87
bool val_in_range(const T &val, const std::initializer_list< T > &list)
Definition: src/types.h:174
synthetic_sensor & get_depth_sensor()
Definition: ds5-device.h:41
const uint16_t RS455_PID
Definition: ds5-private.h:48
GLboolean GLuint group
Definition: glext.h:5688
ds5_nonmonochrome(std::shared_ptr< context > ctx, const platform::backend_device_group &group)
const uint16_t RS_USB2_PID
Definition: ds5-private.h:30
const platform::extension_unit depth_xu
Definition: ds5-private.h:159
uvc_sensor & get_raw_depth_sensor()
Definition: ds5-device.h:46
const uint8_t DS5_ENABLE_AUTO_WHITE_BALANCE
Definition: ds5-private.h:59
std::vector< rs2_format > map_supported_color_formats(rs2_format source_format)
Definition: device.cpp:263
void unregister_option(rs2_option id)
Definition: sensor.cpp:1120
std::vector< uvc_device_info > uvc_devices
Definition: backend.h:525
const uint16_t RS465_PID
Definition: ds5-private.h:45
const uint16_t RS405_PID
Definition: ds5-private.h:47


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:12