@@ -32,10 +32,12 @@ namespace librealsense
3232 {rs_fourcc (' M' ,' 4' ,' 2' ,' 0' ), RS2_STREAM_COLOR}
3333 };
3434
35- d500_color::d500_color ( std::shared_ptr< const d500_info > const & dev_info )
36- : d500_device(dev_info), device(dev_info),
37- _color_stream (new stream(RS2_STREAM_COLOR)),
38- _separate_color(true )
35+ d500_color::d500_color ( std::shared_ptr< const d500_info > const & dev_info, rs2_format native_format )
36+ : d500_device( dev_info )
37+ , device( dev_info )
38+ , _color_stream( new stream( RS2_STREAM_COLOR ) )
39+ , _separate_color( true )
40+ , _native_format( native_format )
3941 {
4042 create_color_device ( dev_info->get_context (), dev_info->get_group () );
4143 init ();
@@ -95,6 +97,32 @@ namespace librealsense
9597 register_color_processing_blocks ();
9698 }
9799
100+ void d500_color::register_color_processing_blocks ()
101+ {
102+ auto & color_ep = get_color_sensor ();
103+
104+ switch ( _native_format )
105+ {
106+ case RS2_FORMAT_YUYV:
107+ color_ep.register_processing_block ( processing_block_factory::create_pbf_vector< yuy2_converter >(
108+ RS2_FORMAT_YUYV,
109+ map_supported_color_formats ( RS2_FORMAT_YUYV ),
110+ RS2_STREAM_COLOR ) );
111+ break ;
112+ case RS2_FORMAT_M420:
113+ color_ep.register_processing_block ( processing_block_factory::create_pbf_vector< m420_converter >(
114+ RS2_FORMAT_M420,
115+ map_supported_color_formats ( RS2_FORMAT_M420 ),
116+ RS2_STREAM_COLOR ) );
117+ break ;
118+ default :
119+ throw invalid_value_exception ( " invalid native color format "
120+ + std::string ( get_string ( _native_format ) ) );
121+ }
122+ color_ep.register_processing_block ( // Color Raw (Bayer 10-bit embedded in 16-bit) for calibration
123+ processing_block_factory::create_id_pbf ( RS2_FORMAT_RAW16, RS2_STREAM_COLOR ) );
124+ }
125+
98126 void d500_color::register_options ()
99127 {
100128 auto & color_ep = get_color_sensor ();
0 commit comments