PsychToolBox 画面制御
screen 関数の使い方例
>>help screen
で参照。以下にその一部を転載。
------
MOVIES ARE EASY
% make movie
window=Screen(0,'OpenWindow',0);
rect=[0 0 200 200];
for i=1:100
movie(i)=Screen(window,'OpenOffscreenWindow',0,rect);
Screen(movie(i),'FillOval',255,[0 0 2 2]*(i-1));
end;
% show movie
for i=[1:100 100:-1:1] % forwards and backwards
Screen('CopyWindow',movie(i),window,rect,rect);
Screen(window,'WaitBlanking');
end;
Screen('CloseAll');
------
Screen ARGUMENTS
"windowPtr" argument: Screen 'OpenWindow' and 'OpenOffscreenWindow' both
return a windowPtr, a number that designates the window you just
created. You can create many windows. And you can obtain a windowPtr to
any of Matlab's windows. To use a window, you pass its windowPtr to the
Screen function you want to apply to that window.
"rect" argument: "rect" is a 1x4 matrix containing the upper left and
lower right coordinates of an imaginary box containing all the pixels.
Thus a rect [0 0 1 1] contains just one pixel.
screen 関数の使い方例
>>help screen
で参照。以下にその一部を転載。
------
MOVIES ARE EASY
% make movie
window=Screen(0,'OpenWindow',0);
rect=[0 0 200 200];
for i=1:100
movie(i)=Screen(window,'OpenOffscreenWindow',0,rect);
Screen(movie(i),'FillOval',255,[0 0 2 2]*(i-1));
end;
% show movie
for i=[1:100 100:-1:1] % forwards and backwards
Screen('CopyWindow',movie(i),window,rect,rect);
Screen(window,'WaitBlanking');
end;
Screen('CloseAll');
------
Screen ARGUMENTS
"windowPtr" argument: Screen 'OpenWindow' and 'OpenOffscreenWindow' both
return a windowPtr, a number that designates the window you just
created. You can create many windows. And you can obtain a windowPtr to
any of Matlab's windows. To use a window, you pass its windowPtr to the
Screen function you want to apply to that window.
"rect" argument: "rect" is a 1x4 matrix containing the upper left and
lower right coordinates of an imaginary box containing all the pixels.
Thus a rect [0 0 1 1] contains just one pixel.