forked from IntelRealSense/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Edit matlab wrapper to reflect processing_block api refactoring
- Loading branch information
Lior Ramati
committed
Oct 24, 2018
1 parent
2993136
commit 0def593
Showing
15 changed files
with
173 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
% Wraps librealsense2 align class | ||
classdef align < handle | ||
classdef align < librealsense.processing_block | ||
properties (SetAccess = private, Hidden = true) | ||
objectHandle; | ||
end | ||
|
@@ -9,14 +9,10 @@ | |
narginchk(1, 1); | ||
validateattributes(align_to, {'realsense.stream', 'numeric'}, {'scalar', 'nonnegative', 'real', 'integer', '<=', realsense.stream.count}); | ||
this.objectHandle = realsense.librealsense_mex('rs2::align', 'new', int64(align_to)); | ||
this = [email protected]_block(out); | ||
end | ||
|
||
% Destructor | ||
function delete(this) | ||
if (this.objectHandle ~= 0) | ||
realsense.librealsense_mex('rs2::align', 'delete', this.objectHandle); | ||
end | ||
end | ||
% Destructor (uses base class destructor) | ||
|
||
% Functions | ||
function frames = process(this, frame) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
% Wraps librealsense2 colorizer class | ||
classdef colorizer < realsense.options | ||
classdef colorizer < realsense.processing_block | ||
methods | ||
% Constructor | ||
function this = colorizer() | ||
out = realsense.librealsense_mex('rs2::colorizer', 'new'); | ||
this = [email protected](out); | ||
function this = colorizer(color_scheme) | ||
if (nargin == 0) | ||
out = realsense.librealsense_mex('rs2::colorizer', 'new'); | ||
else | ||
validateattributes(color_scheme, {'numeric'}, {'scalar', 'nonnegative', 'real'}); | ||
out = realsense.librealsense_mex('rs2::colorizer', 'new', double(color_scheme)); | ||
end | ||
this = [email protected]_block(out); | ||
end | ||
|
||
% Destructor (uses base class destructor) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
% Wraps librealsense2 decimation_filter class | ||
classdef decimation_filter < realsense.process_interface | ||
classdef decimation_filter < realsense.processing_block | ||
methods | ||
% Constructor | ||
function this = decimation_filter() | ||
out = realsense.librealsense_mex('rs2::decimation_filter', 'new'); | ||
this = [email protected]_interface(out); | ||
function this = decimation_filter(magnitude) | ||
if (nargin == 0) | ||
out = realsense.librealsense_mex('rs2::decimation_filter', 'new'); | ||
else | ||
validateattributes(magnitude, {'numeric'}, {'scalar', 'nonnegative', 'real'}); | ||
out = realsense.librealsense_mex('rs2::decimation_filter', 'new', double(magnitude)); | ||
end | ||
this = [email protected]_block(out); | ||
end | ||
|
||
% Destructor (uses base class destructor) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
% Wraps librealsense2 hole_filling_filter class | ||
classdef hole_filling_filter < realsense.process_interface | ||
classdef hole_filling_filter < realsense.processing_block | ||
methods | ||
% Constructor | ||
function this = hole_filling_filter() | ||
out = realsense.librealsense_mex('rs2::hole_filling_filter', 'new'); | ||
this = [email protected]_interface(out); | ||
function this = hole_filling_filter(mode) | ||
if (nargin == 0) | ||
out = realsense.librealsense_mex('rs2::hole_filling_filter', 'new'); | ||
else | ||
validateattributes(mode, {'numeric'}, {'scalar', 'real', 'integer'}); | ||
out = realsense.librealsense_mex('rs2::hole_filling_filter', 'new', int64(mode)); | ||
end | ||
this = [email protected]_block(out); | ||
end | ||
|
||
% Destructor (uses base class destructor) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
% Wraps librealsense2 pointcloud class | ||
classdef pointcloud < realsense.options | ||
classdef pointcloud < realsense.processing_block | ||
methods | ||
% Constructor | ||
function this = pointcloud() | ||
out = realsense.librealsense_mex('rs2::pointcloud', 'new'); | ||
this = [email protected](out); | ||
function this = pointcloud(stream, index) | ||
switch nargin | ||
case 0 | ||
out = realsense.librealsense_mex('rs2::pointcloud', 'new'); | ||
case 1 | ||
validateattributes(stream, {'realsense.stream', 'numeric'}, {'scalar', 'nonnegative', 'real', 'integer', '<=', realsense.stream.count}); | ||
out = realsense.librealsense_mex('rs2::pointcloud', 'new', int64(stream)); | ||
case 2 | ||
validateattributes(stream, {'realsense.stream', 'numeric'}, {'scalar', 'nonnegative', 'real', 'integer', '<=', realsense.stream.count}); | ||
validateattributes(index, {'numeric'}, {'scalar', 'nonnegative', 'real', 'integer'}); | ||
out = realsense.librealsense_mex('rs2::pointcloud', 'new', int64(stream), int64(index)); | ||
end | ||
this = [email protected]_block(out); | ||
end | ||
|
||
% Destructor (uses base class destructor) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
% Wraps librealsense2 processing_block class | ||
classdef processing_block < realsense.options | ||
methods | ||
% Constructor | ||
function this = processing_block(handle) | ||
this = [email protected](handle); | ||
end | ||
|
||
% Destructor (uses base class destructor) | ||
|
||
% Functions | ||
function out_frame = process(this, frame) | ||
narginchk(2, 2) | ||
validateattributes(frame, {'realsense.frame'}, {'scalar'}, '', 'frame', 2); | ||
out = realsense.librealsense_mex('rs2::processing_block', 'process', this.objectHandle, frame.objectHandle); | ||
out_frame = realsense.frame(out); | ||
end | ||
end | ||
end |
Oops, something went wrong.