-
Notifications
You must be signed in to change notification settings - Fork 0
/
DrawFixationMark.m
36 lines (31 loc) · 1.27 KB
/
DrawFixationMark.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
function [ HW ] = DrawFixationMark( HW, loc, fixWidthPx, fixLineWidthPx )
%DRAWFIXATIONMARK Draws a fixation mark with nonius lines into a stereo
%view
% loc = center of mark
% fixWidthPx = width of fixation box, in pixels
% fixLineWidthPx = line width fixation box and lines
%
% TODO parameterize locations of Nonius lines?
for eye = [0 1]
HW = ScreenCustomStereo(...
HW, 'SelectStereoDrawBuffer', HW.winPtr, eye);
Screen('FrameRect', HW.winPtr, HW.white, ...
[loc-0.5*fixWidthPx, loc+0.5*fixWidthPx], ...
fixLineWidthPx);
if eye == 0
Screen('DrawLine', HW.winPtr, ...
HW.white, loc(1), loc(2)-0.75*fixWidthPx, ...
loc(1), loc(2)-1.5*fixWidthPx, fixLineWidthPx);
Screen('DrawLine', HW.winPtr, ...
HW.white, loc(1)-0.75*fixWidthPx, loc(2), ...
loc(1)-1.5*fixWidthPx, loc(2), fixLineWidthPx);
else
Screen('DrawLine', HW.winPtr, ...
HW.white, loc(1), loc(2)+0.75*fixWidthPx, ...
loc(1), loc(2)+1.5*fixWidthPx, fixLineWidthPx);
Screen('DrawLine', HW.winPtr, ...
HW.white, loc(1)+0.75*fixWidthPx, loc(2), ...
loc(1)+1.5*fixWidthPx, loc(2), fixLineWidthPx);
end
end
end