1-
21function cfg = apertureTexture(action , cfg , thisEvent )
32
4- matrixSize = 400 ;
3+ transparent = [ 0 0 0 0 ] ;
54
65 switch action
76
87 case ' init'
98
9+ % we take the screen height as maximum aperture width if not
10+ % specified.
11+ if ~isfield(cfg .aperture , ' width' ) || isempty(cfg .aperture .width )
12+ cfg.aperture.width = cfg .screen .winRect(4 ) / cfg .screen .ppd ;
13+ end
14+ cfg.aperture = degToPix(' width' , cfg .aperture , cfg );
15+
1016 cfg.aperture.texture = Screen(' MakeTexture' , cfg .screen .win , ...
1117 cfg .color .background(1 ) * ones(cfg .screen .winRect([4 3 ])));
1218
1622
1723 case ' none'
1824
19- Screen(' Fillrect' , cfg .aperture .texture , [ 0 0 0 0 ] );
25+ Screen(' Fillrect' , cfg .aperture .texture , transparent );
2026
2127 case ' circle'
2228
23- Screen(' FillOval' , cfg .aperture .texture , [0 0 0 0 ], ...
24- CenterRectOnPoint([0 0 repmat(matrixSize , 1 , 2 )], ...
29+ diameter = cfg .aperture .widthPix ;
30+
31+ Screen(' FillOval' , cfg .aperture .texture , transparent , ...
32+ CenterRectOnPoint([0 0 repmat(diameter , 1 , 2 )], ...
2533 cfg .screen .winRect(3 ) / 2 , cfg .screen .winRect(4 ) / 2 ));
2634
2735 end
3038
3139 Screen(' DrawTexture' , cfg .screen .win , cfg .aperture .texture );
3240
33- % Screen('DrawTexture', cfg.screen.win, apertureTexture, ...
34- % cfg.screen.winRect, cfg.screen.winRect, current.apertureAngle - 90);
35-
36-
41+ % Screen('DrawTexture', cfg.screen.win, apertureTexture, ...
42+ % cfg.screen.winRect, cfg.screen.winRect, current.apertureAngle - 90);
43+
3744 end
38-
39-
40-
41-
42-
43-
45+
4446end
0 commit comments