7 #pragma comment(lib, "libmx.lib") 8 #pragma comment(lib, "libmex.lib") 9 #pragma comment(lib, "libmat.lib") 10 #pragma comment(lib, "realsense2.lib") 19 ClassFactory stream_profile_factory(
"rs2::stream_profile");
20 stream_profile_factory.
record(
"new", 1, 0, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
24 stream_profile_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
26 MatlabParamParser::destroy<rs2::stream_profile>(inv[0]);
28 stream_profile_factory.
record(
"stream_index", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
30 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
33 stream_profile_factory.
record(
"stream_type", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
35 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
38 stream_profile_factory.
record(
"format", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
40 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
43 stream_profile_factory.
record(
"fps", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
45 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
48 stream_profile_factory.
record(
"unique_id", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
50 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
53 stream_profile_factory.
record(
"clone", 1, 4, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
55 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
56 auto type = MatlabParamParser::parse<rs2_stream>(inv[1]);
57 auto index = MatlabParamParser::parse<int>(inv[2]);
58 auto format = MatlabParamParser::parse<rs2_format>(inv[3]);
61 stream_profile_factory.
record(
"operator==", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
63 auto rhs = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
64 auto lhs = MatlabParamParser::parse<rs2::stream_profile>(inv[1]);
67 stream_profile_factory.
record(
"is", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
70 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
71 auto type = MatlabParamParser::parse<std::string>(inv[1]);
72 if (type ==
"stream_profile")
74 else if (type ==
"video_stream_profile")
76 else if (type ==
"motion_stream_profile")
79 mexWarnMsgTxt(
"rs2::stream_profile::is: invalid type parameter");
83 stream_profile_factory.
record(
"as", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
86 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
87 auto type = MatlabParamParser::parse<std::string>(inv[1]);
88 if (type ==
"stream_profile")
90 else if (type ==
"video_stream_profile")
92 else if (type ==
"motion_stream_profile")
95 mexWarnMsgTxt(
"rs2::stream_profile::as: invalid type parameter");
99 stream_profile_factory.
record(
"stream_name", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
101 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
104 stream_profile_factory.
record(
"is_default", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
106 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
109 stream_profile_factory.
record(
"operator bool", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
111 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
114 stream_profile_factory.
record(
"get_extrinsics_to", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
116 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
117 auto to = MatlabParamParser::parse<rs2::stream_profile>(inv[1]);
121 stream_profile_factory.
record(
"is_cloned", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
123 auto thiz = MatlabParamParser::parse<rs2::stream_profile>(inv[0]);
126 factory->
record(stream_profile_factory);
129 ClassFactory video_stream_profile_factory(
"rs2::video_stream_profile");
131 video_stream_profile_factory.
record(
"width", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
133 auto thiz = MatlabParamParser::parse<rs2::video_stream_profile>(inv[0]);
136 video_stream_profile_factory.
record(
"height", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
138 auto thiz = MatlabParamParser::parse<rs2::video_stream_profile>(inv[0]);
141 video_stream_profile_factory.
record(
"get_intrinsics", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
143 auto thiz = MatlabParamParser::parse<rs2::video_stream_profile>(inv[0]);
146 factory->
record(video_stream_profile_factory);
149 ClassFactory motion_stream_profile_factory(
"rs2::motion_stream_profile");
151 motion_stream_profile_factory.
record(
"get_motion_intrinsics", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
153 auto thiz = MatlabParamParser::parse<rs2::motion_stream_profile>(inv[0]);
156 factory->
record(motion_stream_profile_factory);
166 frame_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
168 MatlabParamParser::destroy<rs2::frame>(inv[0]);
174 frame_factory.
record(
"operator bool", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
176 auto thiz = MatlabParamParser::parse<rs2::frame>(inv[0]);
179 frame_factory.
record(
"get_timestamp", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
181 auto thiz = MatlabParamParser::parse<rs2::frame>(inv[0]);
184 frame_factory.
record(
"get_frame_timestamp_domain", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
186 auto thiz = MatlabParamParser::parse<rs2::frame>(inv[0]);
189 frame_factory.
record(
"get_frame_metadata", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
191 auto thiz = MatlabParamParser::parse<rs2::frame>(inv[0]);
192 auto frame_metadata = MatlabParamParser::parse<rs2_frame_metadata_value>(inv[1]);
195 frame_factory.
record(
"supports_frame_metadata", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
197 auto thiz = MatlabParamParser::parse<rs2::frame>(inv[0]);
198 auto frame_metadata = MatlabParamParser::parse<rs2_frame_metadata_value>(inv[1]);
201 frame_factory.
record(
"get_frame_number", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
203 auto thiz = MatlabParamParser::parse<rs2::frame>(inv[0]);
206 frame_factory.
record(
"get_data", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
208 auto thiz = MatlabParamParser::parse<rs2::frame>(inv[0]);
211 n_bytes = vf.get_height() * vf.get_stride_in_bytes();
214 switch (thiz.get_profile().format()) {
217 mexWarnMsgTxt(
"Raw10 data provided as unsigned byte array.");
223 mexWarnMsgTxt(
"Can't detect frame dims, sending only first pixel");
232 mexWarnMsgTxt(
"Can't detect frame dims, sending only first pixel");
240 mexWarnMsgTxt(
"Can't detect frame dims, sending only first pixel");
247 mexWarnMsgTxt(
"Can't detect frame dims, sending only first pixel");
252 mexWarnMsgTxt(
"This format isn't supported yet. Sending unsigned byte stream");
255 mexWarnMsgTxt(
"Can't detect frame dims, sending only first pixel");
260 frame_factory.
record(
"get_profile", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
262 auto thiz = MatlabParamParser::parse<rs2::frame>(inv[0]);
265 frame_factory.
record(
"is", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
268 auto thiz = MatlabParamParser::parse<rs2::frame>(inv[0]);
269 auto type = MatlabParamParser::parse<std::string>(inv[1]);
272 else if (type ==
"video_frame")
274 else if (type ==
"points")
276 else if (type ==
"depth_frame")
278 else if (type ==
"disparity_frame")
280 else if (type ==
"motion_frame")
282 else if (type ==
"pose_frame")
284 else if (type ==
"frameset")
287 mexWarnMsgTxt(
"rs2::frame::is: invalid type parameter");
291 frame_factory.
record(
"as", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
294 auto thiz = MatlabParamParser::parse<rs2::frame>(inv[0]);
295 auto type = MatlabParamParser::parse<std::string>(inv[1]);
298 else if (type ==
"video_frame")
300 else if (type ==
"points")
302 else if (type ==
"depth_frame")
304 else if (type ==
"disparity_frame")
306 else if (type ==
"motion_frame")
308 else if (type ==
"pose_frame")
310 else if (type ==
"frameset")
313 mexWarnMsgTxt(
"rs2::frame::as: invalid type parameter");
317 factory->
record(frame_factory);
322 video_frame_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
324 MatlabParamParser::destroy<rs2::video_frame>(inv[0]);
326 video_frame_factory.
record(
"get_width", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
328 auto thiz = MatlabParamParser::parse<rs2::video_frame>(inv[0]);
331 video_frame_factory.
record(
"get_height", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
333 auto thiz = MatlabParamParser::parse<rs2::video_frame>(inv[0]);
336 video_frame_factory.
record(
"get_stride_in_bytes", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
338 auto thiz = MatlabParamParser::parse<rs2::video_frame>(inv[0]);
341 video_frame_factory.
record(
"get_bits_per_pixel", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
343 auto thiz = MatlabParamParser::parse<rs2::video_frame>(inv[0]);
346 video_frame_factory.
record(
"get_bytes_per_pixel", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
348 auto thiz = MatlabParamParser::parse<rs2::video_frame>(inv[0]);
351 factory->
record(video_frame_factory);
357 points_factory.
record(
"get_vertices", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
359 auto thiz = MatlabParamParser::parse<rs2::points>(inv[0]);
363 points_factory.
record(
"export_to_ply", 0, 3, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
365 auto thiz = MatlabParamParser::parse<rs2::points>(inv[0]);
366 auto fname = MatlabParamParser::parse<std::string>(inv[1]);
367 auto texture = MatlabParamParser::parse<rs2::video_frame>(inv[2]);
368 thiz.export_to_ply(fname, texture);
370 points_factory.
record(
"get_texture_coordinates", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
372 auto thiz = MatlabParamParser::parse<rs2::points>(inv[0]);
376 points_factory.
record(
"size", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
378 auto thiz = MatlabParamParser::parse<rs2::points>(inv[0]);
381 factory->
record(points_factory);
386 depth_frame_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
388 MatlabParamParser::destroy<rs2::depth_frame>(inv[0]);
390 depth_frame_factory.
record(
"get_distance", 1, 3, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
392 auto thiz = MatlabParamParser::parse<rs2::depth_frame>(inv[0]);
393 auto x = MatlabParamParser::parse<int>(inv[1]);
394 auto y = MatlabParamParser::parse<int>(inv[2]);
397 depth_frame_factory.
record(
"get_units", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
399 auto thiz = MatlabParamParser::parse<rs2::depth_frame>(inv[0]);
402 factory->
record(depth_frame_factory);
405 ClassFactory disparity_frame_factory(
"rs2::disparity_frame");
407 disparity_frame_factory.
record(
"get_baseline", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
409 auto thiz = MatlabParamParser::parse<rs2::disparity_frame>(inv[0]);
412 factory->
record(disparity_frame_factory);
417 motion_frame_factory.
record(
"get_motion_data", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
419 auto thiz = MatlabParamParser::parse<rs2::motion_frame>(inv[0]);
422 factory->
record(motion_frame_factory);
427 pose_frame_factory.
record(
"get_pose_data", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
429 auto thiz = MatlabParamParser::parse<rs2::pose_frame>(inv[0]);
432 factory->
record(pose_frame_factory);
438 frameset_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
440 MatlabParamParser::destroy<rs2::frameset>(inv[0]);
442 frameset_factory.
record(
"first_or_default", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
444 auto thiz = MatlabParamParser::parse<rs2::frameset>(inv[0]);
445 auto s = MatlabParamParser::parse<rs2_stream>(inv[1]);
448 frameset_factory.
record(
"first", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
450 auto thiz = MatlabParamParser::parse<rs2::frameset>(inv[0]);
451 auto s = MatlabParamParser::parse<rs2_stream>(inv[1]);
455 frameset_factory.
record(
"get_depth_frame", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
457 auto thiz = MatlabParamParser::parse<rs2::frameset>(inv[0]);
461 frameset_factory.
record(
"get_color_frame", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
463 auto thiz = MatlabParamParser::parse<rs2::frameset>(inv[0]);
467 frameset_factory.
record(
"get_infrared_frame", 1, 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
469 auto thiz = MatlabParamParser::parse<rs2::frameset>(inv[0]);
474 auto index = MatlabParamParser::parse<size_t>(inv[1]);
478 frameset_factory.
record(
"get_fisheye_frame", 1, 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
480 auto thiz = MatlabParamParser::parse<rs2::frameset>(inv[0]);
485 auto index = MatlabParamParser::parse<size_t>(inv[1]);
489 frameset_factory.
record(
"get_pose_frame", 1, 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
491 auto thiz = MatlabParamParser::parse<rs2::frameset>(inv[0]);
496 auto index = MatlabParamParser::parse<size_t>(inv[1]);
500 frameset_factory.
record(
"size", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
502 auto thiz = MatlabParamParser::parse<rs2::frameset>(inv[0]);
508 factory->
record(frameset_factory);
515 options_factory.
record(
"supports#rs2_option", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
517 auto thiz = MatlabParamParser::parse<rs2::options>(inv[0]);
518 auto option = MatlabParamParser::parse<rs2_option>(inv[1]);
521 options_factory.
record(
"get_option_description", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
523 auto thiz = MatlabParamParser::parse<rs2::options>(inv[0]);
524 auto option = MatlabParamParser::parse<rs2_option>(inv[1]);
527 options_factory.
record(
"get_option_value_description", 1, 3, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
529 auto thiz = MatlabParamParser::parse<rs2::options>(inv[0]);
530 auto option = MatlabParamParser::parse<rs2_option>(inv[1]);
531 auto val = MatlabParamParser::parse<float>(inv[2]);
534 options_factory.
record(
"get_option", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
536 auto thiz = MatlabParamParser::parse<rs2::options>(inv[0]);
537 auto option = MatlabParamParser::parse<rs2_option>(inv[1]);
540 options_factory.
record(
"get_option_range", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
542 auto thiz = MatlabParamParser::parse<rs2::options>(inv[0]);
543 auto option = MatlabParamParser::parse<rs2_option>(inv[1]);
546 options_factory.
record(
"set_option", 0, 3, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
548 auto thiz = MatlabParamParser::parse<rs2::options>(inv[0]);
549 auto option = MatlabParamParser::parse<rs2_option>(inv[1]);
550 auto val = MatlabParamParser::parse<float>(inv[2]);
551 thiz.set_option(option, val);
553 options_factory.
record(
"is_option_read_only", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
555 auto thiz = MatlabParamParser::parse<rs2::options>(inv[0]);
556 auto option = MatlabParamParser::parse<rs2_option>(inv[1]);
560 options_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
562 MatlabParamParser::destroy<rs2::options>(inv[0]);
564 factory->
record(options_factory);
569 sensor_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
571 MatlabParamParser::destroy<rs2::sensor>(inv[0]);
573 sensor_factory.
record(
"open#stream_profile", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
575 auto thiz = MatlabParamParser::parse<rs2::sensor>(inv[0]);
576 auto profile = MatlabParamParser::parse<rs2::stream_profile>(inv[1]);
579 sensor_factory.
record(
"supports#rs2_camera_info", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
581 auto thiz = MatlabParamParser::parse<rs2::sensor>(inv[0]);
582 auto info = MatlabParamParser::parse<rs2_camera_info>(inv[1]);
585 sensor_factory.
record(
"get_info", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
587 auto thiz = MatlabParamParser::parse<rs2::sensor>(inv[0]);
588 auto info = MatlabParamParser::parse<rs2_camera_info>(inv[1]);
591 sensor_factory.
record(
"open#vec_stream_profile", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
593 auto thiz = MatlabParamParser::parse<rs2::sensor>(inv[0]);
594 auto profiles = MatlabParamParser::parse<std::vector<rs2::stream_profile>>(inv[1]);
597 sensor_factory.
record(
"close", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
599 auto thiz = MatlabParamParser::parse<rs2::sensor>(inv[0]);
603 sensor_factory.
record(
"start#frame_queue", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
605 auto thiz = MatlabParamParser::parse<rs2::sensor>(inv[0]);
606 auto queue = MatlabParamParser::parse<rs2::frame_queue>(inv[1]);
609 sensor_factory.
record(
"stop", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
611 auto thiz = MatlabParamParser::parse<rs2::sensor>(inv[0]);
614 sensor_factory.
record(
"get_stream_profiles", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
616 auto thiz = MatlabParamParser::parse<rs2::sensor>(inv[0]);
620 sensor_factory.
record(
"operator bool", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
622 auto thiz = MatlabParamParser::parse<rs2::sensor>(inv[0]);
625 sensor_factory.
record(
"is", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
628 auto thiz = MatlabParamParser::parse<rs2::sensor>(inv[0]);
629 auto type = MatlabParamParser::parse<std::string>(inv[1]);
630 if (type ==
"sensor")
632 else if (type ==
"roi_sensor")
634 else if (type ==
"depth_sensor")
636 else if (type ==
"depth_stereo_sensor")
639 mexWarnMsgTxt(
"rs2::sensor::is: invalid type parameter");
643 sensor_factory.
record(
"as", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
646 auto thiz = MatlabParamParser::parse<rs2::sensor>(inv[0]);
647 auto type = MatlabParamParser::parse<std::string>(inv[1]);
648 if (type ==
"sensor")
650 else if (type ==
"roi_sensor")
652 else if (type ==
"depth_sensor")
654 else if (type ==
"depth_stereo_sensor")
657 mexWarnMsgTxt(
"rs2::sensor::as: invalid type parameter");
661 sensor_factory.
record(
"operator==", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
663 auto rhs = MatlabParamParser::parse<rs2::sensor>(inv[0]);
664 auto lhs = MatlabParamParser::parse<rs2::sensor>(inv[1]);
667 factory->
record(sensor_factory);
672 roi_sensor_factory.
record(
"set_region_of_interest", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
674 auto thiz = MatlabParamParser::parse<rs2::roi_sensor>(inv[0]);
675 auto roi = MatlabParamParser::parse<rs2::region_of_interest>(inv[1]);
676 thiz.set_region_of_interest(roi);
678 roi_sensor_factory.
record(
"get_region_of_interest", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
680 auto thiz = MatlabParamParser::parse<rs2::roi_sensor>(inv[0]);
684 factory->
record(roi_sensor_factory);
689 depth_sensor_factory.
record(
"get_depth_scale", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
691 auto thiz = MatlabParamParser::parse<rs2::depth_sensor>(inv[0]);
695 factory->
record(depth_sensor_factory);
698 ClassFactory depth_stereo_sensor_factory(
"rs2::depth_stereo_sensor");
700 depth_stereo_sensor_factory.
record(
"get_stereo_baseline", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
702 auto thiz = MatlabParamParser::parse<rs2::depth_stereo_sensor>(inv[0]);
705 factory->
record(depth_stereo_sensor_factory);
713 device_factory.
record(
"init", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
715 auto list = MatlabParamParser::parse<rs2::device_list>(inv[0]);
716 auto idx = MatlabParamParser::parse<uint32_t>(inv[1]);
718 MatlabParamParser::destroy<rs2::device_list>(inv[0]);
721 device_factory.
record(
"delete#uninit", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
723 MatlabParamParser::destroy<rs2::device_list>(inv[0]);
726 device_factory.
record(
"delete#init", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
728 MatlabParamParser::destroy<rs2::device>(inv[0]);
730 device_factory.
record(
"query_sensors", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
732 auto thiz = MatlabParamParser::parse<rs2::device>(inv[0]);
735 device_factory.
record(
"first", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
738 auto thiz = MatlabParamParser::parse<rs2::device>(inv[0]);
739 auto type = MatlabParamParser::parse<std::string>(inv[1]);
741 if (type ==
"sensor")
743 else if (type ==
"roi_sensor")
745 else if (type ==
"depth_sensor")
747 else if (type ==
"depth_stereo_sensor")
749 else mexErrMsgTxt(
"rs2::device::first: Could not find requested sensor type!");
752 mexErrMsgTxt(
"rs2::device::first: Could not find requested sensor type!");
755 device_factory.
record(
"supports", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
757 auto thiz = MatlabParamParser::parse<rs2::device>(inv[0]);
758 auto info = MatlabParamParser::parse<rs2_camera_info>(inv[1]);
761 device_factory.
record(
"get_info", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
763 auto thiz = MatlabParamParser::parse<rs2::device>(inv[0]);
764 auto info = MatlabParamParser::parse<rs2_camera_info>(inv[1]);
767 device_factory.
record(
"hardware_reset", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
769 auto thiz = MatlabParamParser::parse<rs2::device>(inv[0]);
770 thiz.hardware_reset();
773 device_factory.
record(
"operator bool", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
775 auto thiz = MatlabParamParser::parse<rs2::device>(inv[0]);
778 device_factory.
record(
"is", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
781 auto thiz = MatlabParamParser::parse<rs2::device>(inv[0]);
782 auto type = MatlabParamParser::parse<std::string>(inv[1]);
783 if (type ==
"device")
785 else if (type ==
"debug_protocol") {
786 mexWarnMsgTxt(
"rs2::device::is: Debug Protocol not supported in MATLAB");
789 else if (type ==
"advanced_mode")
791 else if (type ==
"recorder")
793 else if (type ==
"playback")
796 mexWarnMsgTxt(
"rs2::device::is: invalid type parameter");
800 device_factory.
record(
"as", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
803 auto thiz = MatlabParamParser::parse<rs2::device>(inv[0]);
804 auto type = MatlabParamParser::parse<std::string>(inv[1]);
805 if (type ==
"device")
807 else if (type ==
"debug_protocol") {
808 mexErrMsgTxt(
"rs2::device::as: Debug Protocol not supported in MATLAB");
811 else if (type ==
"advanced_mode")
813 else if (type ==
"recorder")
815 else if (type ==
"playback")
818 mexWarnMsgTxt(
"rs2::device::as: invalid type parameter");
822 factory->
record(device_factory);
831 playback_factory.
record(
"pause", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
833 auto thiz = MatlabParamParser::parse<rs2::playback>(inv[0]);
836 playback_factory.
record(
"resume", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
838 auto thiz = MatlabParamParser::parse<rs2::playback>(inv[0]);
841 playback_factory.
record(
"file_name", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
843 auto thiz = MatlabParamParser::parse<rs2::playback>(inv[0]);
846 playback_factory.
record(
"get_position", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
848 auto thiz = MatlabParamParser::parse<rs2::playback>(inv[0]);
851 playback_factory.
record(
"get_duration", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
853 auto thiz = MatlabParamParser::parse<rs2::playback>(inv[0]);
856 playback_factory.
record(
"seek", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
858 auto thiz = MatlabParamParser::parse<rs2::playback>(inv[0]);
859 auto time = MatlabParamParser::parse<std::chrono::nanoseconds>(inv[1]);
862 playback_factory.
record(
"is_real_time", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
864 auto thiz = MatlabParamParser::parse<rs2::playback>(inv[0]);
867 playback_factory.
record(
"set_real_time", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
869 auto thiz = MatlabParamParser::parse<rs2::playback>(inv[0]);
870 auto real_time = MatlabParamParser::parse<bool>(inv[1]);
871 thiz.set_real_time(real_time);
873 playback_factory.
record(
"set_playback_speed", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
875 auto thiz = MatlabParamParser::parse<rs2::playback>(inv[0]);
876 auto speed = MatlabParamParser::parse<float>(inv[1]);
877 thiz.set_playback_speed(speed);
880 playback_factory.
record(
"current_status", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
882 auto thiz = MatlabParamParser::parse<rs2::playback>(inv[0]);
885 playback_factory.
record(
"stop", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
887 auto thiz = MatlabParamParser::parse<rs2::playback>(inv[0]);
890 factory->
record(playback_factory);
895 recorder_factory.
record(
"new#string_device", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
897 auto file = MatlabParamParser::parse<std::string>(inv[0]);
898 auto device = MatlabParamParser::parse<rs2::device>(inv[1]);
901 recorder_factory.
record(
"pause", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
903 auto thiz = MatlabParamParser::parse<rs2::recorder>(inv[0]);
906 recorder_factory.
record(
"resume", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
908 auto thiz = MatlabParamParser::parse<rs2::recorder>(inv[0]);
911 recorder_factory.
record(
"filename", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
913 auto thiz = MatlabParamParser::parse<rs2::recorder>(inv[0]);
916 factory->
record(recorder_factory);
923 frame_queue_factory.
record(
"new", 1, 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
929 auto capacity = MatlabParamParser::parse<unsigned int>(inv[0]);
933 auto capacity = MatlabParamParser::parse<unsigned int>(inv[0]);
934 auto keep_frames = MatlabParamParser::parse<bool>(inv[1]);
938 frame_queue_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
940 MatlabParamParser::destroy<rs2::frame_queue>(inv[0]);
943 frame_queue_factory.
record(
"wait_for_frame", 1, 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
945 auto thiz = MatlabParamParser::parse<rs2::frame_queue>(inv[0]);
950 auto timeout_ms = MatlabParamParser::parse<unsigned int>(inv[1]);
954 frame_queue_factory.
record(
"poll_for_frame", 2, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
956 auto thiz = MatlabParamParser::parse<rs2::frame_queue>(inv[0]);
957 auto type = MatlabParamParser::parse<std::string>(inv[1]);
958 if (type ==
"frame") {
962 }
else if (type ==
"video_frame") {
966 }
else if (type ==
"points"){
970 }
else if (type ==
"depth_frame"){
974 }
else if (type ==
"disparity_frame"){
978 }
else if (type ==
"motion_frame"){
982 }
else if (type ==
"pose_frame"){
986 }
else if (type ==
"frameset"){
991 mexWarnMsgTxt(
"rs2::frame_queue::poll_for_frame: invalid type parameter");
996 frame_queue_factory.
record(
"capacity", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
998 auto thiz = MatlabParamParser::parse<rs2::frame_queue>(inv[0]);
1001 frame_queue_factory.
record(
"keep_frames", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1003 auto thiz = MatlabParamParser::parse<rs2::frame_queue>(inv[0]);
1006 factory->
record(frame_queue_factory);
1018 filter_factory.
record(
"process", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1020 auto thiz = MatlabParamParser::parse<rs2::filter>(inv[0]);
1021 auto frame = MatlabParamParser::parse<rs2::frame>(inv[1]);
1024 factory->
record(filter_factory);
1028 pointcloud_factory.
record(
"new", 1, 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1034 auto stream = MatlabParamParser::parse<rs2_stream>(inv[0]);
1038 auto index = MatlabParamParser::parse<int>(inv[1]);
1042 pointcloud_factory.
record(
"calculate", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1044 auto thiz = MatlabParamParser::parse<rs2::pointcloud>(inv[0]);
1045 auto depth = MatlabParamParser::parse<rs2::frame>(inv[1]);
1048 pointcloud_factory.
record(
"map_to", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1050 auto thiz = MatlabParamParser::parse<rs2::pointcloud>(inv[0]);
1051 auto mapped = MatlabParamParser::parse<rs2::frame>(inv[1]);
1052 thiz.map_to(mapped);
1054 factory->
record(pointcloud_factory);
1058 syncer_factory.
record(
"new", 1, 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1063 else if (inc == 1) {
1064 auto queue_size = MatlabParamParser::parse<int>(inv[0]);
1068 syncer_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1070 MatlabParamParser::destroy<rs2::syncer>(inv[0]);
1072 syncer_factory.
record(
"wait_for_frames", 1, 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1074 auto thiz = MatlabParamParser::parse<rs2::syncer>(inv[0]);
1078 else if (inc == 2) {
1079 auto timeout_ms = MatlabParamParser::parse<unsigned int>(inv[1]);
1083 syncer_factory.
record(
"poll_for_frames", 2, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1085 auto thiz = MatlabParamParser::parse<rs2::syncer>(inv[0]);
1090 factory->
record(syncer_factory);
1094 align_factory.
record(
"new", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1096 auto align_to = MatlabParamParser::parse<rs2_stream>(inv[0]);
1100 align_factory.
record(
"process", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1102 auto thiz = MatlabParamParser::parse<rs2::align>(inv[0]);
1103 auto frame = MatlabParamParser::parse<rs2::frameset>(inv[1]);
1106 factory->
record(align_factory);
1110 colorizer_factory.
record(
"new", 1, 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1114 auto color_scheme = MatlabParamParser::parse<float>(inv[0]);
1118 colorizer_factory.
record(
"colorize", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1120 auto thiz = MatlabParamParser::parse<rs2::colorizer>(inv[0]);
1121 auto depth = MatlabParamParser::parse<rs2::frame>(inv[1]);
1124 factory->
record(colorizer_factory);
1127 ClassFactory decimation_filter_factory(
"rs2::decimation_filter");
1128 decimation_filter_factory.
record(
"new", 1, 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1132 auto magnitude = MatlabParamParser::parse<float>(inv[0]);
1136 factory->
record(decimation_filter_factory);
1139 ClassFactory temporal_filter_factory(
"rs2::temporal_filter");
1140 temporal_filter_factory.
record(
"new", 1, 0, 3, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1143 else if (inc == 3) {
1144 auto smooth_alpha = MatlabParamParser::parse<float>(inv[0]);
1145 auto smooth_delta = MatlabParamParser::parse<float>(inv[1]);
1146 auto persistence_control = MatlabParamParser::parse<int>(inv[2]);
1149 else mexErrMsgTxt(
"rs2::temporal_filter::new: Wrong number of Inputs");
1151 factory->
record(temporal_filter_factory);
1154 ClassFactory spatial_filter_factory(
"rs2::spatial_filter");
1155 spatial_filter_factory.
record(
"new", 1, 0, 4, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1158 else if (inc == 4) {
1159 auto smooth_alpha = MatlabParamParser::parse<float>(inv[0]);
1160 auto smooth_delta = MatlabParamParser::parse<float>(inv[1]);
1161 auto magnitude = MatlabParamParser::parse<float>(inv[2]);
1162 auto hole_fill = MatlabParamParser::parse<float>(inv[3]);
1165 else mexErrMsgTxt(
"rs2::spatial_filter::new: Wrong number of Inputs");
1167 factory->
record(spatial_filter_factory);
1170 ClassFactory disparity_transform_factory(
"rs2::disparity_transform");
1171 disparity_transform_factory.
record(
"new", 1, 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1176 else if (inc == 1) {
1177 auto transform_to_disparity = MatlabParamParser::parse<bool>(inv[0]);
1181 factory->
record(disparity_transform_factory);
1184 ClassFactory hole_filling_filter_factory(
"rs2::hole_filling_filter");
1185 hole_filling_filter_factory.
record(
"new", 1, 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1189 auto mode = MatlabParamParser::parse<int>(inv[0]);
1193 factory->
record(hole_filling_filter_factory);
1199 save_to_ply_factory.
record(
"new", 1, 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1204 else if (inc == 1) {
1205 auto filename = MatlabParamParser::parse<std::string>(inv[0]);
1208 else if (inc == 2) {
1209 auto filename = MatlabParamParser::parse<std::string>(inv[0]);
1210 auto pc = MatlabParamParser::parse<rs2::pointcloud>(inv[1]);
1214 save_to_ply_factory.
record(
"process", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1216 auto thiz = MatlabParamParser::parse<rs2::save_to_ply>(inv[0]);
1217 auto frame = MatlabParamParser::parse<rs2::frameset>(inv[1]);
1220 factory->
record(save_to_ply_factory);
1223 ClassFactory save_single_frameset_factory(
"rs2::save_single_frameset");
1224 save_single_frameset_factory.
record(
"new", 1, 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1229 else if (inc == 1) {
1230 auto filename = MatlabParamParser::parse<std::string>(inv[0]);
1234 factory->
record(save_single_frameset_factory);
1242 context_factory.
record(
"new", 1, 0, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1246 context_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1248 MatlabParamParser::destroy<rs2::context>(inv[0]);
1250 context_factory.
record(
"query_devices", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1252 auto thiz = MatlabParamParser::parse<rs2::context>(inv[0]);
1255 context_factory.
record(
"query_all_sensors", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1257 auto thiz = MatlabParamParser::parse<rs2::context>(inv[0]);
1260 context_factory.
record(
"get_sensor_parent", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1262 auto thiz = MatlabParamParser::parse<rs2::context>(inv[0]);
1263 auto sensor = MatlabParamParser::parse<rs2::sensor>(inv[1]);
1266 context_factory.
record(
"load_device", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1268 auto thiz = MatlabParamParser::parse<rs2::context>(inv[0]);
1269 auto file = MatlabParamParser::parse<std::string>(inv[1]);
1272 context_factory.
record(
"unload_device", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1274 auto thiz = MatlabParamParser::parse<rs2::context>(inv[0]);
1275 auto file = MatlabParamParser::parse<std::string>(inv[1]);
1276 thiz.unload_device(file);
1278 context_factory.
record(
"unload_tracking_module", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1280 auto thiz = MatlabParamParser::parse<rs2::context>(inv[0]);
1281 thiz.unload_tracking_module();
1283 factory->
record(context_factory);
1287 device_hub_factory.
record(
"new", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1289 auto ctx = MatlabParamParser::parse<rs2::context>(inv[0]);
1292 device_hub_factory.
record(
"delete", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1294 MatlabParamParser::destroy<rs2::device_hub>(inv[0]);
1296 device_hub_factory.
record(
"wait_for_device", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1298 auto thiz = MatlabParamParser::parse<rs2::device_hub>(inv[0]);
1301 device_hub_factory.
record(
"is_connected", 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1303 auto thiz = MatlabParamParser::parse<rs2::device_hub>(inv[0]);
1304 auto dev = MatlabParamParser::parse<rs2::device>(inv[1]);
1307 factory->
record(device_hub_factory);
1312 ClassFactory pipeline_profile_factory(
"rs2::pipeline_profile");
1314 pipeline_profile_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1316 MatlabParamParser::destroy<rs2::pipeline_profile>(inv[0]);
1318 pipeline_profile_factory.
record(
"get_streams", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1320 auto thiz = MatlabParamParser::parse<rs2::pipeline_profile>(inv[0]);
1323 pipeline_profile_factory.
record(
"get_stream", 1, 2, 3, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1325 auto thiz = MatlabParamParser::parse<rs2::pipeline_profile>(inv[0]);
1326 auto stream_type = MatlabParamParser::parse<rs2_stream>(inv[1]);
1330 auto stream_index = MatlabParamParser::parse<int>(inv[2]);
1334 pipeline_profile_factory.
record(
"get_device", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1336 auto thiz = MatlabParamParser::parse<rs2::pipeline_profile>(inv[0]);
1340 factory->
record(pipeline_profile_factory);
1344 config_factory.
record(
"new", 1, 0, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1348 config_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1350 MatlabParamParser::destroy<rs2::config>(inv[0]);
1352 config_factory.
record(
"enable_stream#full", 0, 5, 7, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1354 auto thiz = MatlabParamParser::parse<rs2::config>(inv[0]);
1355 auto stream_type = MatlabParamParser::parse<rs2_stream>(inv[1]);
1356 auto stream_index = MatlabParamParser::parse<int>(inv[2]);
1357 auto width = MatlabParamParser::parse<int>(inv[3]);
1358 auto height = MatlabParamParser::parse<int>(inv[4]);
1360 thiz.enable_stream(stream_type, stream_index, width, height);
1361 }
else if (inc == 6) {
1362 auto format = MatlabParamParser::parse<rs2_format>(inv[5]);
1363 thiz.enable_stream(stream_type, stream_index, width, height,
format);
1364 }
else if (inc == 7) {
1365 auto format = MatlabParamParser::parse<rs2_format>(inv[5]);
1366 auto framerate = MatlabParamParser::parse<int>(inv[6]);
1367 thiz.enable_stream(stream_type, stream_index, width, height,
format, framerate);
1370 config_factory.
record(
"enable_stream#stream", 0, 2, 3, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1372 auto thiz = MatlabParamParser::parse<rs2::config>(inv[0]);
1373 auto stream_type = MatlabParamParser::parse<rs2_stream>(inv[1]);
1375 thiz.enable_stream(stream_type);
1376 }
else if (inc == 3){
1377 auto stream_index = MatlabParamParser::parse<int>(inv[2]);
1378 thiz.enable_stream(stream_type, stream_index);
1381 config_factory.
record(
"enable_stream#size", 0, 4, 6, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1383 auto thiz = MatlabParamParser::parse<rs2::config>(inv[0]);
1384 auto stream_type = MatlabParamParser::parse<rs2_stream>(inv[1]);
1385 auto width = MatlabParamParser::parse<int>(inv[2]);
1386 auto height = MatlabParamParser::parse<int>(inv[3]);
1388 thiz.enable_stream(stream_type, width, height);
1389 }
else if (inc == 5) {
1390 auto format = MatlabParamParser::parse<rs2_format>(inv[4]);
1391 thiz.enable_stream(stream_type, width, height,
format);
1392 }
else if (inc == 6) {
1393 auto format = MatlabParamParser::parse<rs2_format>(inv[4]);
1394 auto framerate = MatlabParamParser::parse<int>(inv[5]);
1395 thiz.enable_stream(stream_type, width, height,
format, framerate);
1398 config_factory.
record(
"enable_stream#format", 0, 3, 4, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1400 auto thiz = MatlabParamParser::parse<rs2::config>(inv[0]);
1401 auto stream_type = MatlabParamParser::parse<rs2_stream>(inv[1]);
1402 auto format = MatlabParamParser::parse<rs2_format>(inv[2]);
1404 thiz.enable_stream(stream_type, format);
1405 }
else if (inc == 4) {
1406 auto framerate = MatlabParamParser::parse<int>(inv[3]);
1407 thiz.enable_stream(stream_type, format, framerate);
1410 config_factory.
record(
"enable_stream#extended", 0, 4, 5, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1412 auto thiz = MatlabParamParser::parse<rs2::config>(inv[0]);
1413 auto stream_type = MatlabParamParser::parse<rs2_stream>(inv[1]);
1414 auto stream_index = MatlabParamParser::parse<int>(inv[2]);
1415 auto format = MatlabParamParser::parse<rs2_format>(inv[3]);
1417 thiz.enable_stream(stream_type, stream_index, format);
1418 }
else if (inc == 5) {
1419 auto framerate = MatlabParamParser::parse<int>(inv[4]);
1420 thiz.enable_stream(stream_type, stream_index, format, framerate);
1423 config_factory.
record(
"enable_all_streams", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1425 auto thiz = MatlabParamParser::parse<rs2::config>(inv[0]);
1426 thiz.enable_all_streams();
1428 config_factory.
record(
"enable_device", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1430 auto thiz = MatlabParamParser::parse<rs2::config>(inv[0]);
1431 auto serial = MatlabParamParser::parse<std::string>(inv[1]);
1432 thiz.enable_device(serial);
1434 config_factory.
record(
"enable_device_from_file", 0, 2, 3, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1436 auto thiz = MatlabParamParser::parse<rs2::config>(inv[0]);
1437 auto file_name = MatlabParamParser::parse<std::string>(inv[1]);
1439 thiz.enable_device_from_file(file_name);
1440 else if (inc == 3) {
1445 config_factory.
record(
"enable_record_to_file", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1447 auto thiz = MatlabParamParser::parse<rs2::config>(inv[0]);
1448 auto file_name = MatlabParamParser::parse<std::string>(inv[1]);
1449 thiz.enable_record_to_file(file_name);
1451 config_factory.
record(
"disable_stream", 0, 2, 3, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1453 auto thiz = MatlabParamParser::parse<rs2::config>(inv[0]);
1454 auto stream = MatlabParamParser::parse<rs2_stream>(inv[1]);
1456 thiz.disable_stream(stream);
1457 else if (inc == 3) {
1458 auto index = MatlabParamParser::parse<int>(inv[2]);
1459 thiz.disable_stream(stream,
index);
1462 config_factory.
record(
"disable_all_streams", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1464 auto thiz = MatlabParamParser::parse<rs2::config>(inv[0]);
1465 thiz.disable_all_streams();
1467 factory->
record(config_factory);
1471 pipeline_factory.
record(
"new", 1, 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[])
1475 }
else if (inc == 1) {
1476 auto ctx = MatlabParamParser::parse<rs2::context>(inv[0]);
1480 pipeline_factory.
record(
"delete", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1482 MatlabParamParser::destroy<rs2::pipeline>(inv[0]);
1484 pipeline_factory.
record(
"start", 1, 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1486 auto thiz = MatlabParamParser::parse<rs2::pipeline>(inv[0]);
1489 else if (inc == 2) {
1490 auto config = MatlabParamParser::parse<rs2::config>(inv[1]);
1494 pipeline_factory.
record(
"start#fq", 1, 2, 3, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1496 auto thiz = MatlabParamParser::parse<rs2::pipeline>(inv[0]);
1498 auto fq = MatlabParamParser::parse<rs2::frame_queue>(inv[1]);
1500 }
else if (inc == 3) {
1501 auto config = MatlabParamParser::parse<rs2::config>(inv[1]);
1502 auto fq = MatlabParamParser::parse<rs2::frame_queue>(inv[2]);
1506 pipeline_factory.
record(
"stop", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1508 auto thiz = MatlabParamParser::parse<rs2::pipeline>(inv[0]);
1511 pipeline_factory.
record(
"wait_for_frames", 1, 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1513 auto thiz = MatlabParamParser::parse<rs2::pipeline>(inv[0]);
1516 }
else if (inc == 2) {
1517 auto timeout_ms = MatlabParamParser::parse<unsigned int>(inv[1]);
1521 pipeline_factory.
record(
"poll_for_frames", 2, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1523 auto thiz = MatlabParamParser::parse<rs2::pipeline>(inv[0]);
1528 pipeline_factory.
record(
"get_active_profile", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[])
1530 auto thiz = MatlabParamParser::parse<rs2::pipeline>(inv[0]);
1533 factory->
record(pipeline_factory);
1539 free_funcs_factory.
record(
"log_to_console", 0, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[]) {
1540 auto min_severity = MatlabParamParser::parse<rs2_log_severity>(inv[0]);
1543 free_funcs_factory.
record(
"log_to_file", 0, 1, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[]) {
1544 auto min_severity = MatlabParamParser::parse<rs2_log_severity>(inv[0]);
1547 else if (inc == 2) {
1548 auto file_path = MatlabParamParser::parse<const char *>(inv[1]);
1552 free_funcs_factory.
record(
"log", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[]) {
1553 auto severity = MatlabParamParser::parse<rs2_log_severity>(inv[0]);
1554 auto message = MatlabParamParser::parse<const char *>(inv[1]);
1557 factory->
record(free_funcs_factory);
1562 ClassFactory advanced_mode_factory(
"rs400::advanced_mode");
1563 advanced_mode_factory.
record(
"is_enabled", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray*
inv[]) {
1564 auto thiz = MatlabParamParser::parse<rs400::advanced_mode>(inv[0]);
1567 advanced_mode_factory.
record(
"toggle_advanced_mode", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[]) {
1568 auto thiz = MatlabParamParser::parse<rs400::advanced_mode>(inv[0]);
1569 auto enable = MatlabParamParser::parse<bool>(inv[1]);
1570 thiz.toggle_advanced_mode(enable);
1572 advanced_mode_factory.
record(
"serialize_json", 1, 1, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[]) {
1573 auto thiz = MatlabParamParser::parse<rs400::advanced_mode>(inv[0]);
1576 advanced_mode_factory.
record(
"load_json", 0, 2, [](
int outc, mxArray* outv[],
int inc,
const mxArray* inv[]) {
1577 auto thiz = MatlabParamParser::parse<rs400::advanced_mode>(inv[0]);
1578 auto json_content = MatlabParamParser::parse<std::string>(inv[1]);
1579 thiz.load_json(json_content);
1581 factory->
record(advanced_mode_factory);
1584 mexAtExit([]() {
delete factory; });
1587 void mexFunction(
int nOutParams, mxArray *outParams[],
int nInParams,
const mxArray *inParams[])
1592 if (nInParams < 2) {
1593 mexErrMsgTxt(
"At least class and command name are needed.");
1597 auto cname = MatlabParamParser::parse<std::string>(inParams[0]);
1598 auto fname = MatlabParamParser::parse<std::string>(inParams[1]);
1600 auto f_data = factory->
get(cname, fname);
1602 mexErrMsgTxt(
"Unknown Command received.");
1606 if (f_data.out != nOutParams) {
1607 std::string errmsg = cname +
"::" + fname.substr(0, fname.find(
"#", 0)) +
": Wrong number of outputs";
1608 mexErrMsgTxt(errmsg.c_str());
1611 if (f_data.in_min > nInParams - 2 || f_data.in_max < nInParams - 2) {
1612 std::string errmsg = cname +
"::" + fname.substr(0, fname.find(
"#", 0)) +
": Wrong number of inputs";
1613 mexErrMsgTxt(errmsg.c_str());
1617 f_data.f(nOutParams, outParams, nInParams - 2, inParams + 2);
1618 }
catch (std::exception &
e) {
1619 mexErrMsgTxt(e.what());
1621 mexErrMsgTxt(
"An unknown error occured");
GLenum GLuint GLenum GLsizei const GLchar * message
void mexFunction(int nOutParams, mxArray *outParams[], int nInParams, const mxArray *inParams[])
GLenum GLuint GLenum severity
func_data get(std::string c, std::string f)
void log(rs2_log_severity severity, const char *message)
GLint GLint GLsizei GLsizei GLsizei depth
GLsizei const GLchar *const * string
static mxArray * wrap(T &&var)
def info(name, value, persistent=False)
void record(ClassFactory cls)
GLint GLsizei GLsizei height
GLint GLint GLsizei GLint GLenum format
unsigned __int64 uint64_t
void log_to_file(rs2_log_severity min_severity, const char *file_path=nullptr)
void record(std::string fname, int out, int in, std::function< mxFunc > func)
void log_to_console(rs2_log_severity min_severity)
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
GLdouble GLdouble GLint GLint const GLdouble * points
static std::enable_if<!is_basic_type< T >::value &&!traits_trampoline::use_cells< T >::value, mxArray * >::type wrap_array(const T *var, size_t length)