Subversion Repositories seema-scanner

Rev

Rev 28 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 jakw 1
%PROJECTOR Matlab wrapper class for the Projector C++ class.
2
% Creates a fullscreen OpenGL context for the screen specified for fast
3
% texture or pattern projection.
4
%
5
% Jakob Wilm, DTU 2013
6
 
7
classdef Projector < handle
8
    properties (SetAccess = private, Hidden = true)
9
        objectHandle; % Handle to the underlying C++ class instance
10
    end
11
    methods (Static = true)
12
        function varargout = GetScreenInfo
13
            [varargout{1:nargout}] = ProjectorMex('GetScreenInfo');
14
        end
15
    end
16
    methods
17
        % Constructor - Create a new C++ class instance 
18
        function this = Projector(screenNum)
19
            this.objectHandle = ProjectorMex('new', screenNum);
20
        end
21
 
22
        % Destructor - Destroy the C++ class instance
23
        function delete(this)
24
            ProjectorMex('delete', this.objectHandle);
25
        end
26
 
27
        % displayTexture
28
        function varargout = displayTexture(this, texture)
29
            height = size(texture, 1);
30
            width = size(texture, 2);
31
            % swivel data to match RMO OpenGL format
32
            texture = permute(texture, [3 2 1]);
33
            [varargout{1:nargout}] = ProjectorMex('displayTexture', this.objectHandle, texture, width, height);
34
        end
35
 
36
        % displayWhite
37
        function varargout = displayWhite(this)
38
            [varargout{1:nargout}] = ProjectorMex('displayWhite', this.objectHandle);
39
        end
40
 
41
        % displayBlack
42
        function varargout = displayBlack(this)
43
            [varargout{1:nargout}] = ProjectorMex('displayBlack', this.objectHandle);
44
        end
45
 
46
        % setGamma
47
        function varargout = SetGamma(this, gamma)
48
            [varargout{1:nargout}] = ProjectorMex('SetGamma', this.objectHandle, gamma);
49
        end
50
 
51
    end
52
end