forked from IntelRealSense/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
/
frameset.m
64 lines (62 loc) · 3.2 KB
/
frameset.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
% Wraps librealsense2 frameset class
classdef frameset < realsense.frame
methods
% Constructor
function this = frameset(handle)
this = [email protected](handle);
end
% Destructor (uses base class destructor)
% Functions
function frame = first_or_default(this, s)
narginchk(2, 2);
validateattributes(s, {'realsense.stream', 'numeric'}, {'scalar', 'nonnegative', 'real', 'integer', '<=', realsense.stream.count}, '', 's', 2);
ret = realsense.librealsense_mex('rs2::frameset', 'first_or_default', this.objectHandle, int64(s));
frame = realsense.frame(ret);
end
function frame = first(this, s)
narginchk(2, 2);
validateattributes(s, {'realsense.stream', 'numeric'}, {'scalar', 'nonnegative', 'real', 'integer', '<=', realsense.stream.count}, '', 's', 2);
ret = realsense.librealsense_mex('rs2::frameset', 'first', this.objectHandle, int64(s));
frame = realsense.frame(ret);
end
function depth_frame = get_depth_frame(this)
ret = realsense.librealsense_mex('rs2::frameset', 'get_depth_frame', this.objectHandle);
depth_frame = realsense.depth_frame(ret);
end
function color_frame = get_color_frame(this)
ret = realsense.librealsense_mex('rs2::frameset', 'get_color_frame', this.objectHandle);
color_frame = realsense.video_frame(ret);
end
function infrared_frame = get_infrared_frame(this, index)
if (nargin == 1)
ret = realsense.librealsense_mex('rs2::frameset', 'get_infrared_frame', this.objectHandle);
else
validateattributes(index, {'numeric'}, {'scalar', 'real', 'integer'}, '', 'index', 2);
ret = realsense.librealsense_mex('rs2::frameset', 'get_infrared_frame', this.objectHandle, int64(index));
end
infrared_frame = realsense.video_frame(ret);
end
function fisheye_frame = get_fisheye_frame(this, index)
if (nargin == 1)
ret = realsense.librealsense_mex('rs2::frameset', 'get_fisheye_frame', this.objectHandle);
else
validateattributes(index, {'numeric'}, {'scalar', 'real', 'integer'}, '', 'index', 2);
ret = realsense.librealsense_mex('rs2::frameset', 'get_fisheye_frame', this.objectHandle, int64(index));
end
fisheye_frame = realsense.video_frame(ret);
end
function pose_frame = get_pose_frame(this, index)
if (nargin == 1)
ret = realsense.librealsense_mex('rs2::frameset', 'get_pose_frame', this.objectHandle);
else
validateattributes(index, {'numeric'}, {'scalar', 'real', 'integer'}, '', 'index', 2);
ret = realsense.librealsense_mex('rs2::frameset', 'get_pose_frame', this.objectHandle, int64(index));
end
pose_frame = realsense.video_frame(ret);
end
function frameset_size = frame_count(this)
frameset_size = realsense.librealsense_mex('rs2::frameset', 'size', this.objectHandle);
end
% TODO: iterator protocol?
end
end