Memorandums

知覚・認知心理学の研究と教育をめぐる凡庸な日々の覚書

screen 関数: PsychToolBox

2005-06-30 | PsychToolBox
>>help screen

Screen is a MEX file to use on- and off-screen windows for display in
experiments. Screen has many functions; type "Screen" for a list:
Screen
For explanation of any particular screen function, just add a question
mark "?". E.g. for 'OpenWindow', try either of these equivalent forms:
Screen('OpenWindow?')
Screen OpenWindow?
All the Screen Preference settings are documented together:
Screen Preference?


Each on-screen window normally fills a monitor's whole screen. (The OS9
version allows smaller windows; the Win version doesn't.) Off-screen
windows are invisible, but useful as an intermediate place to create and
store images for later display. Copying from window to window is very
fast, e.g. 36 MB/s on a PowerMac 7500/100 and 171 MB/s on a PowerBook
G4/500. It's easy to precompute a series of off-screen windows and then
show them as a movie, in real time, one per video frame.

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. All screen and window
coordinates follow Apple Macintosh conventions. (In Apple's the pixels
occupy the space between the coordinates.) Coordinates can be local to
the window (i.e. 0,0 origin is at upper left of window), or local to the
screen (origin at upper left of screen), or "global", which follows
Apple's convention of treating the entire desktop (all your screens) as
one big screen, with origin at the upper left of the main screen, which
has the menu bar. You can rearrange the screens in the desktop by using
Apple's Control Panel: Monitors or Monitors and Sounds. Historically
we've had two different orderings of the elements of rect, so, for
general compatibility, all of the Psychophysics Toolbox refers to the
elements symbolically, through RectLeft, RectTop, etc. Since 2/97, we
use Apple's standard ordering: RectLeft=1, RectTop=2, RectRight=3,
RectBottom=4.

[optional arguments]: Brackets in the function list, e.g. [color],
indicate optional arguments, not matrices. Optional arguments must be in
order, without omitting earlier ones, but you can use the empty matrix
[] as a place holder, with the same effect as omitting it.



HALTING A PROGRAM

OS9:
Command-period halts any program. (Type a period "." while holding the
apple-cloverleaf "command" key down.) If the command-period is
intercepted by any of our MEX files, all of Screen's windows will be
closed, and the cursor will be shown, to allow you to work normally in
the Matlab Command window.
コメント    この記事についてブログを書く
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする
« KbCheck : PsychToolBox | トップ | screen関数の例1 : PsychToolBox »

コメントを投稿

ブログ作成者から承認されるまでコメントは反映されません。

PsychToolBox」カテゴリの最新記事