Additions:
Screen('AddFrameToMovie', windowPtr [,rect] [,bufferName] [,moviePtr=0] [,frameduration=1]);
Screen('AddAudioBufferToMovie', moviePtr, audioBuffer);
droppedframes = Screen('StopVideoCapture', capturePtr [, discardFrames=1]);
Deletions:
Screen('AddFrameToMovie', windowPtr [,rect] [,bufferName] [,moviePtr=0] [,frameduration=1])
droppedframes = Screen('StopVideoCapture', capturePtr);
Additions:
//"windowPtr" argument:// [[Screen]] 'OpenWindow' and 'OpenOffscreenWindow'
both return a windowPtr, a number that designates the window you just created.
You can create many windows. To use a window, you pass its windowPtr to the
Toolbox refers to the elements symbolically, through RectLeft, RectTop,
etc. Since 2/97, we use Apple's standard ordering: RectLeft=1, RectTop=2,
//[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.
If your computer only has one screen (the typical scenario) and your program
produces a Matlab error while your full-screen window is open, you'll hear
the beep, but you won't be able to see the Matlab Command Window. Follow the
instructions below for bringing forward the command window, then type clear
screen to flush just the [[Screen]] MEX file, or "clear mex" to flush all the
MEX files. When flushed, as part of its exit sequence, [[Screen]] closes all its
windows, restores the screen's normal color table, and shows the cursor. Or you
can get just those effects, without flushing, by calling [[Screen]]('CloseAll')
or [[CloseAll sca]] - which is an abbreviation for [[Screen]]('CloseAll').
Command-zero brings the Matlab Command window forward. (Type a zero "0" while
holding the apple-cloverleaf "command" key down.)
Ctrl-C halts any program. (Type a "c" while holding down the "Ctrl" key).
Sometimes, Ctrl-C fails to halt progams executing in a Matlab process run with
the "-nojvm" option. To halt a runaway Psychtoolbox script in Psychtoolbox
you might resort to the Windows Task Manager to kill the Matlab process. (Use
Ctrl-Alt-Delete to open a window from which you can start the Task Manager.)
Deletions:
//"windowPtr" argument:// [[Screen]] 'OpenWindow' and
'OpenOffscreenWindow' both return a windowPtr, a number that
designates the window you just created. You can create many
windows. To use a window, you pass its windowPtr to the
Toolbox refers to the elements symbolically, through RectLeft, RectTop, etc.
Since 2/97, we use Apple's standard ordering: RectLeft=1, RectTop=2,
//[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.
If your computer only has one screen (the typical scenario) and your
program produces a Matlab error while your full-screen window is open,
you'll hear the beep, but you won't be able to see the Matlab Command
Window. Follow the instructions below for bringing forward the command
window, then type clear screen to flush just the [[Screen]] MEX file, or
"clear mex" to flush all the MEX files. When flushed, as part of its
exit sequence, [[Screen]] closes all its windows, restores the screen's normal
color table, and shows the cursor. Or you can get just those effects,
without flushing, by calling [[Screen]]('CloseAll') or [[CloseAll sca]] - which is an
abbreviation for [[Screen]]('CloseAll').
Command-zero brings the Matlab Command window forward. (Type a zero
"0" while holding the apple-cloverleaf "command" key down.)
Ctrl-C halts any program. (Type a "c" while holding down the "Ctrl"
key). Sometimes, Ctrl-C fails to halt progams executing in a Matlab process
run with the "-nojvm" option. To halt a runaway Psychtoolbox script in
Psychtoolbox you might resort to the Windows Task Manager to kill
the Matlab process. (Use Ctrl-Alt-Delete to open a window from which
you can start the Task Manager.)
Additions:
For explanation of any particular screen function, just add a question
//"rect" argument:// "rect" is a 1x4 matrix containing the coordinates of an
imaginary box containing all the pixels. All screen and window coordinates
follow Apple Macintosh conventions. (In Apples the pixels occupy the space
between the coordinates. Thus a rect [0 0 1 1] contains just one pixel.)
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 the origin at upper left of the main screen,
which has the menu bar. Historically we've had two different orderings of the
Deletions:
For an explanation of any particular screen function, just add a question
//"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. Historically we've had two different orderings of the
Deletions:
Usage:
Additions:
[sourceFactorOld, destinationFactorOld, colorMaskOld]=Screen('BlendFunction', windowIndex, [sourceFactorNew], [destinationFactorNew], [colorMaskNew]);
[normBoundsRect, offsetBoundsRect]= Screen('TextBounds', windowPtr, text [,x] [,y] [,yPositionIsBaseline] [,swapTextDirection]);
moviePtr = Screen('CreateMovie', windowPtr, movieFile [, width][, height][, frameRate=30][, movieOptions]);
Screen('FinalizeMovie', moviePtr);
Screen('AddFrameToMovie', windowPtr [,rect] [,bufferName] [,moviePtr=0] [,frameduration=1])
Deletions:
[sourceFactorOld, destinationFactorOld, colorMaskOld]=('BlendFunction', windowIndex, [sourceFactorNew], [destinationFactorNew], [colorMaskNew]);
[normBoundsRect, offsetBoundsRect]=Screen('TextBounds', windowPtr, text [, swapTextDirection]);
Additions:
[normBoundsRect, offsetBoundsRect]=Screen('TextBounds', windowPtr, text [, swapTextDirection]);
[newX,newY]=Screen('DrawText', windowPtr, text [,x] [,y] [,color] [,backgroundColor] [,yPositionIsBaseline] [,swapTextDirection]);
info = Screen('GetWindowInfo', windowPtr [, infoType=0] [, auxArg1]);
[oldtimeindex] = Screen('SetMovieTimeIndex', moviePtr, timeindex [, indexIsFrames=0]);
Deletions:
[normBoundsRect, offsetBoundsRect]=Screen('TextBounds', windowPtr, text);
[newX,newY]=Screen('DrawText', windowPtr, text [,x] [,y] [,color] [,backgroundColor] [,yPositionIsBaseline]);
info = Screen('GetWindowInfo', windowPtr [, beamposOnly=0]);
[oldtimeindex] = Screen('SetMovieTimeIndex', moviePtr, timeindex);
Additions:
Screen('FillOval', windowPtr [,color] [,rect] [,perfectUpToMaxDiameter]);
[gammatable, dacbits, reallutsize] = Screen('ReadNormalizedGammaTable', windowPtrOrScreenNumber [, physicalDisplay]);
devices = Screen('VideoCaptureDevices' [, engineId]);
Deletions:
Screen('FillOval', windowPtr [,color] [,rect]);
[gammatable, dacbits, reallutsize] = Screen('ReadNormalizedGammaTable', windowPtrOrScreenNumber);
Additions:
Screen('FillPoly', windowPtr [,color], pointList [, isConvex]);
Deletions:
Screen('FillPoly', windowPtr [,color], pointList);
Additions:
~1)""<a class="ext" href="#generalargs">General Screen arguments</a>""
~1)**""<a class="ext" href="#subfunctions">Screen Subfunctions</a>""**
~1)""<a class="ext" href="#opengl">OpenGL</a>""
~1)""<a class="ext" href="#errors">When you get a MATLAB error</a>""
~1)""<a class="ext" href="#break">Stopping Programs</a>""
~1)""<a class="ext" href="#bugs">Bugs</a>""
Deletions:
~1)""<a class="ext" href=#generalargs>General Screen arguments</a>""
~1)**""<a class="ext" href=#subfunctions>Screen Subfunctions</a>""**
~1)""<a class="ext" href=#opengl>OpenGL</a>""
~1)""<a class="ext" href=#errors>When you get a MATLAB error</a>""
~1)""<a class="ext" href=#break>Stopping Programs</a>""
~1)""<a class="ext" href=#bugs>Bugs</a>""
Additions:
~1)""<a class="ext" href=#generalargs>General Screen arguments</a>""
~1)**""<a class="ext" href=#subfunctions>Screen Subfunctions</a>""**
~1)""<a class="ext" href=#opengl>OpenGL</a>""
~1)""<a class="ext" href=#errors>When you get a MATLAB error</a>""
~1)""<a class="ext" href=#break>Stopping Programs</a>""
~1)""<a class="ext" href=#bugs>Bugs</a>""
Deletions:
~1)[[http://docs.psychtoolbox.org/Screen#generalargs General Screen arguments]]
~1)**[[http://docs.psychtoolbox.org/Screen#subfunctions Screen Subfunctions]]**
~1)[[http://docs.psychtoolbox.org/Screen#opengl OpenGL]]
~1)[[http://docs.psychtoolbox.org/Screen#errors When you get a MATLAB error]]
~1)[[http://docs.psychtoolbox.org/Screen#break Stopping Programs]]
~1)[[http://docs.psychtoolbox.org/Screen#bugs Bugs]]
Additions:
window=Screen('OpenWindow', 0, 0);
movie(i)=Screen('OpenOffscreenWindow', window, 0, rect);
Screen('FillOval', movie(i), 255, [0 0 2 2]*(i-1));
Screen('CopyWindow',movie(i),window,rect,rect);
Screen('Flip', window);
Screen('CloseAll');%%
Deletions:
window=[[Screen]]('OpenWindow', 0, 0);
movie(i)=[[Screen]]('OpenOffscreenWindow', window, 0, rect);
[[Screen]]('FillOval', movie(i), 255, [0 0 2 2]*(i-1));
[[Screen]]('CopyWindow',movie(i),window,rect,rect);
[[Screen]]('[[Flip]]', window);
[[Screen]]('CloseAll');%%
Additions:
~1)[[http://docs.psychtoolbox.org/Screen#generalargs General Screen arguments]]
~1)**[[http://docs.psychtoolbox.org/Screen#subfunctions Screen Subfunctions]]**
~1)[[http://docs.psychtoolbox.org/Screen#opengl OpenGL]]
~1)[[http://docs.psychtoolbox.org/Screen#errors When you get a MATLAB error]]
~1)[[http://docs.psychtoolbox.org/Screen#break Stopping Programs]]
~1)[[http://docs.psychtoolbox.org/Screen#bugs Bugs]]
Deletions:
~1)[[http://docs.psychtoolbox.org/wikka.php?wakka=Screen#generalargs General Screen arguments]]
~1)**[[http://docs.psychtoolbox.org/wikka.php?wakka=Screen#subfunctions Screen Subfunctions]]**
~1)[[http://docs.psychtoolbox.org/wikka.php?wakka=Screen#opengl OpenGL]]
~1)[[http://docs.psychtoolbox.org/wikka.php?wakka=Screen#errors When you get a MATLAB error]]
~1)[[http://docs.psychtoolbox.org/wikka.php?wakka=Screen#break Stopping Programs]]
~1)[[http://docs.psychtoolbox.org/wikka.php?wakka=Screen#bugs Bugs]]
Additions:
[windowPtr,rect]=Screen('OpenOffscreenWindow',windowPtrOrScreenNumber [,color] [,rect] [,pixelSize] [,specialFlags] [,multiSample]);
Deletions:
[windowPtr,rect]=Screen('OpenOffscreenWindow',windowPtrOrScreenNumber [,color] [,rect] [,pixelSize] [,specialFlags]);
Additions:
//"windowPtr" argument:// [[Screen]] 'OpenWindow' and
'OpenOffscreenWindow' both return a windowPtr, a number that
designates the window you just created. You can create many
windows. To use a window, you pass its windowPtr to the
[[Screen]] function you want to apply to that window.
Deletions:
//"windowPtr" argument:// [[Screen]] 'OpenWindow' and 'OpenOffscreenWindow'
both return a windowPtr, a number that designates the window you just
created. You can create many windows. To use a window, you pass its
windowPtr to the [[Screen]] function you want to apply to that window.
Additions:
~1)[[http://docs.psychtoolbox.org/wikka.php?wakka=Screen#generalargs General Screen arguments]]
~1)**[[http://docs.psychtoolbox.org/wikka.php?wakka=Screen#subfunctions Screen Subfunctions]]**
~1)[[http://docs.psychtoolbox.org/wikka.php?wakka=Screen#opengl OpenGL]]
~1)[[http://docs.psychtoolbox.org/wikka.php?wakka=Screen#errors When you get a MATLAB error]]
~1)[[http://docs.psychtoolbox.org/wikka.php?wakka=Screen#break Stopping Programs]]
~1)[[http://docs.psychtoolbox.org/wikka.php?wakka=Screen#bugs Bugs]]
Deletions:
~1)[[http://towolf.ath.cx/ScreenBetatest#generalargs General Screen arguments]]
~1)**[[http://towolf.ath.cx/ScreenBetatest#subfunctions Screen Subfunctions]]**
~1)[[http://towolf.ath.cx/ScreenBetatest#opengl OpenGL]]
~1)[[http://towolf.ath.cx/ScreenBetatest#errors When you get a MATLAB error]]
~1)[[http://towolf.ath.cx/ScreenBetatest#break Stopping Programs]]
~1)[[http://towolf.ath.cx/ScreenBetatest#bugs Bugs]]
Additions:
many functions.
====Contents====
~1)[[http://towolf.ath.cx/ScreenBetatest#generalargs General Screen arguments]]
~1)**[[http://towolf.ath.cx/ScreenBetatest#subfunctions Screen Subfunctions]]**
~1)[[http://towolf.ath.cx/ScreenBetatest#opengl OpenGL]]
~1)[[http://towolf.ath.cx/ScreenBetatest#errors When you get a MATLAB error]]
~1)[[http://towolf.ath.cx/ScreenBetatest#break Stopping Programs]]
~1)[[http://towolf.ath.cx/ScreenBetatest#bugs Bugs]]
""<a name="generalargs"> </a>""
===== General [[Screen]] ARGUMENTS =====
=== common to most subfunctions of [[Screen]]: ===
//"windowPtr" argument:// [[Screen]] 'OpenWindow' and 'OpenOffscreenWindow'
//"rect" argument:// "rect" is a 1x4 matrix containing the upper left and
//[optional arguments]:// Brackets in the function list, e.g. [color],
""<a name="subfunctions"> </a>""
===== [[Screen]] SUBFUNCTIONS =====
''The {{color hex="#993333" text="red keywords"}} are links for more detailed background information!''
%%(matlab)
Usage:
% Activate compatibility mode: Try to behave like the old MacOS-9 Psychtoolbox:
oldEnableFlag=Screen('Preference', 'EmulateOldPTB', [enableFlag]);
% Open or close a window or texture:
[windowPtr,rect]=Screen('OpenWindow',windowPtrOrScreenNumber [,color] [,rect] [,pixelSize] [,numberOfBuffers] [,stereomode] [,multisample][,imagingmode]);
[windowPtr,rect]=Screen('OpenOffscreenWindow',windowPtrOrScreenNumber [,color] [,rect] [,pixelSize] [,specialFlags]);
textureIndex=Screen('MakeTexture', WindowIndex, imageMatrix [, optimizeForDrawAngle=0] [, specialFlags=0] [, floatprecision=0] [, textureOrientation=0] [, textureShader=0]);
Screen('Close', [windowOrTextureIndex or list of textureIndices/offscreenWindowIndices]);
Screen('CloseAll');
% Draw lines and solids like QuickDraw and DirectX (OS 9 and Windows):
currentbuffer = Screen('SelectStereoDrawBuffer', windowPtr [, bufferid] [, param1]);
Screen('DrawLine', windowPtr [,color], fromH, fromV, toH, toV [,penWidth]);
Screen('DrawArc',windowPtr,[color],[rect],startAngle,arcAngle)
Screen('FrameArc',windowPtr,[color],[rect],startAngle,arcAngle[,penWidth] [,penHeight] [,penMode])
Screen('FillArc',windowPtr,[color],[rect],startAngle,arcAngle)
Screen('FillRect', windowPtr [,color] [,rect] );
Screen('FrameRect', windowPtr [,color] [,rect] [,penWidth]);
Screen('FillOval', windowPtr [,color] [,rect]);
Screen('FrameOval', windowPtr [,color] [,rect] [,penWidth] [,penHeight] [,penMode]);
Screen('FramePoly', windowPtr [,color], pointList [,penWidth]);
Screen('FillPoly', windowPtr [,color], pointList);
% New OpenGL functions for OS X:
Screen('glPoint', windowPtr, color, x, y [,size]);
Screen('gluDisk', windowPtr, color, x, y [,size]);
Screen('DrawDots', windowPtr, xy [,size] [,color] [,center] [,dot_type]);
Screen('DrawLines', windowPtr, xy [,width] [,colors] [,center] [,smooth]);
[sourceFactorOld, destinationFactorOld, colorMaskOld]=('BlendFunction', windowIndex, [sourceFactorNew], [destinationFactorNew], [colorMaskNew]);
% Draw Text in windows
textModes = Screen('TextModes');
oldCopyMode=Screen('TextMode', windowPtr [,textMode]);
oldTextSize=Screen('TextSize', windowPtr [,textSize]);
oldStyle=Screen('TextStyle', windowPtr [,style]);
[oldFontName,oldFontNumber]=Screen(windowPtr,'TextFont' [,fontNameOrNumber]);
[normBoundsRect, offsetBoundsRect]=Screen('TextBounds', windowPtr, text);
[newX,newY]=Screen('DrawText', windowPtr, text [,x] [,y] [,color] [,backgroundColor] [,yPositionIsBaseline]);
oldTextColor=Screen('TextColor', windowPtr [,colorVector]);
oldTextBackgroundColor=Screen('TextBackgroundColor', windowPtr [,colorVector]);
% Copy an image, very quickly, between textures, offscreen windows and onscreen windows.
[resident [texidresident]] = Screen('PreloadTextures', windowPtr [, texids]);
Screen('DrawTexture', windowPointer, texturePointer [,sourceRect] [,destinationRect] [,rotationAngle] [, filterMode] [, globalAlpha] [, modulateColor] [, textureShader] [, specialFlags] [, auxParameters]);
Screen('DrawTextures', windowPointer, texturePointer(s) [, sourceRect(s)] [, destinationRect(s)] [, rotationAngle(s)] [, filterMode(s)] [, globalAlpha(s)] [, modulateColor(s)] [, textureShader] [, specialFlags] [, auxParameters]);
Screen('CopyWindow', srcWindowPtr, dstWindowPtr, [srcRect], [dstRect], [copyMode])
% Copy an image, slowly, between matrices and windows :
imageArray=Screen('GetImage', windowPtr [,rect] [,bufferName] [,floatprecision=0] [,nrchannels=3])
Screen('PutImage', windowPtr, imageArray [,rect]);
% Synchronize with the window's screen (on-screen only):
[VBLTimestamp StimulusOnsetTime FlipTimestamp Missed Beampos] = Screen('Flip', windowPtr [, when] [, dontclear] [, dontsync] [, multiflip]);
Screen('AsyncFlipBegin', windowPtr [, when] [, dontclear] [, dontsync] [, multiflip]);
[VBLTimestamp StimulusOnsetTime FlipTimestamp Missed Beampos] = Screen('AsyncFlipEnd', windowPtr);
[VBLTimestamp StimulusOnsetTime FlipTimestamp Missed Beampos] = Screen('AsyncFlipCheckEnd', windowPtr);
[VBLTimestamp StimulusOnsetTime swapCertainTime] = Screen('WaitUntilAsyncFlipCertain', windowPtr);
[telapsed] = Screen('DrawingFinished', windowPtr [, dontclear] [, sync]);
framesSinceLastWait = Screen('WaitBlanking', windowPtr [, waitFrames]);
% Load color lookup table of the window's screen (on-screen only):
[gammatable, dacbits, reallutsize] = Screen('ReadNormalizedGammaTable', windowPtrOrScreenNumber);
Screen('LoadNormalizedGammaTable', windowPtrOrScreenNumber, table [, loadOnNextFlip] [, physicalDisplay]);
oldclut = Screen('LoadCLUT', windowPtrOrScreenNumber [, clut] [, startEntry=0] [, bits=8]);
% Get (and set) information about a window or screen:
screenNumbers=Screen('Screens' [, physicalDisplays]);
windowPtrs=Screen('Windows');
kind=Screen(windowPtr, 'WindowKind');
isOffscreen=Screen(windowPtr,'IsOffscreen');
hz=Screen('FrameRate', windowPtrOrScreenNumber [, mode] [, reqFrameRate]);
hz=Screen('NominalFrameRate', windowPtrOrScreenNumber [, mode] [, reqFrameRate]);
[ monitorFlipInterval nrValidSamples stddev ]=Screen('GetFlipInterval', windowPtr [, nrSamples] [, stddev] [, timeout]);
screenNumber=Screen('WindowScreenNumber', windowPtr);
rect=Screen('Rect', windowPtrOrScreenNumber);
pixelSize=Screen('PixelSize', windowPtrOrScreenNumber);
pixelSizes=Screen('PixelSizes', windowPtrOrScreenNumber);
[width, height]=Screen('WindowSize', windowPointerOrScreenNumber);
[width, height]=Screen('DisplaySize', ScreenNumber);
[oldmaximumvalue oldclampcolors] = Screen('ColorRange', windowPtr [, maximumvalue][, clampcolors=1]);
info = Screen('GetWindowInfo', windowPtr [, beamposOnly=0]);
resolutions=Screen('Resolutions', screenNumber);
oldResolution=Screen('Resolution', screenNumber [, newwidth] [, newheight] [, newHz] [, newPixelSize] [, specialMode]);
% Get/set details of environment, computer, and video card (i.e. screen):
struct=Screen('Version');
comp=Screen('Computer');
oldBool=Screen('Preference', 'IgnoreCase' [,bool]);
tick0Secs=Screen('Preference', 'Tick0Secs', tick0Secs);
psychTableVersion=Screen('Preference', 'PsychTableVersion');
mexFunctionName=Screen('Preference', 'PsychTableCreator');
proc=Screen('Preference', 'Process');
Screen('Preference','SkipSyncTests', skipTest);
Screen('Preference','VisualDebugLevel', level (valid values between 0 and 5));
Screen('Preference', 'ConserveVRAM', mode (valid values between 0 and 3));
Screen('Preference', 'Enable3DGraphics', [enableFlag]);
% Helper functions. Don't call these directly, use eponymous wrappers:
[x, y, buttonVector]= Screen('GetMouseHelper', numButtons);
Screen('HideCursorHelper', windowPntr);
Screen('ShowCursorHelper', windowPntr);
Screen('SetMouseHelper', windowPntrOrScreenNumber, x, y);
% Internal testing of Screen
timeList= Screen('GetTimelist');
Screen('ClearTimelist');
Screen('Preference','DebugMakeTexture', enableDebugging);
% Movie and multimedia playback functions:
[ moviePtr [duration] [fps] [width] [height] [count]]=Screen('OpenMovie', windowPtr, moviefile [, async=0] [, preloadSecs=1]);
Screen('CloseMovie', moviePtr);
[ texturePtr [timeindex]]=Screen('GetMovieImage', windowPtr, moviePtr, [waitForImage], [fortimeindex], [specialFlags = 0] [, specialFlags2 = 0]);
[droppedframes] = Screen('PlayMovie', moviePtr, rate, [loop], [soundvolume]);
timeindex = Screen('GetMovieTimeIndex', moviePtr);
[oldtimeindex] = Screen('SetMovieTimeIndex', moviePtr, timeindex);
% Video capture functions:
videoPtr =Screen('OpenVideoCapture', windowPtr [, deviceIndex] [,roirectangle] [, pixeldepth] [, numbuffers] [, allowfallback] [, targetmoviename] [, recordingflags] [, captureEngineType]);
Screen('CloseVideoCapture', capturePtr);
[fps starttime] = Screen('StartVideoCapture', capturePtr [, captureRateFPS] [, dropframes=0] [, startAt]);
droppedframes = Screen('StopVideoCapture', capturePtr);
[ texturePtr [capturetimestamp] [droppedcount] [summed_intensityOrRawImageMatrix]]=Screen('GetCapturedImage', windowPtr, capturePtr [, waitForImage=1] [,oldTexture] [,specialmode] [,targetmemptr]);
oldvalue = Screen('SetVideoCaptureParameter', capturePtr, 'parameterName' [, value]);
% Low level direct access to OpenGL-API functions:
% Online info for each function available by opening a terminal window
% and typing 'man Functionname' + Enter.
Screen('glPushMatrix', windowPtr);
Screen('glPopMatrix', windowPtr);
Screen('glLoadIdentity', windowPtr);
Screen('glTranslate', windowPtr, tx, ty [, tz]);
Screen('glScale', windowPtr, sx, sy [, sz]);
Screen('glRotate', windowPtr, angle, [rx = 0], [ry = 0] ,[rz = 1]);
% Support for 3D graphics rendering and for interfacing with external OpenGL code:
Screen('Preference', 'Enable3DGraphics', [enableFlag]); % Enable 3D gfx support.
Screen('BeginOpenGL', windowPtr [, sharecontext]); % Prepare window for external OpenGL drawing.
Screen('EndOpenGL', windowPtr); % Finish external OpenGL drawing.
[targetwindow, IsOpenGLRendering] = Screen('GetOpenGLDrawMode');
[textureHandle rect] = Screen('SetOpenGLTextureFromMemPointer', windowPtr, textureHandle, imagePtr, width, height, depth [, upsidedown][, target][, glinternalformat][, gltype][, extdataformat]);
[textureHandle rect] = Screen('SetOpenGLTexture', windowPtr, textureHandle, glTexid, target [, glWidth] [, glHeight] [, glDepth] [, textureShader]);
[ gltexid gltextarget texcoord_u texcoord_v ] =Screen('GetOpenGLTexture', windowPtr, textureHandle [, x][, y]);
% Support for plugins and for builtin high performance image processing pipeline:
[ret1, ret2, ...] = Screen('HookFunction', windowPtr, 'Subcommand', 'HookName', arg1, arg2, ...);
proxyPtr = Screen('OpenProxy', windowPtr [, imagingmode]);
transtexid = Screen('TransformTexture', sourceTexture, transformProxyPtr [, sourceTexture2][, targetTexture][, specialFlags]);
%%
""<a name="opengl"> </a>""
===== OpenGL =====
""<a name="errors"> </a>""
===== WHEN YOU GET A MATLAB ERROR =====
without flushing, by calling [[Screen]]('CloseAll') or [[CloseAll sca]] - which is an
""<a name="break"> </a>""
===== Stopping programs: =====
=== Linux: ===
Ctrl-C, Ctrl-C, then blindly type ##[[CloseAll sca]]##
""<a name="bugs"> </a>""
===== BUGS =====
Deletions:
many functions
=== See ScreenFunctions for the subfunction docs ===
=== See also [[Preference ScreenPreferences]] ===
=== General [[Screen]] ARGUMENTS, common to most subfunctions of [[Screen]]: ===
"windowPtr" argument: [[Screen]] 'OpenWindow' and 'OpenOffscreenWindow'
"rect" argument: "rect" is a 1x4 matrix containing the upper left and
[optional arguments]: Brackets in the function list, e.g. [color],
=== WHEN YOU GET A MATLAB ERROR ===
without flushing, by calling [[Screen]]('CloseAll') or sca - which is an
=== OpenGL ===
=== Stopping programs: ===
Linux:
Ctrl-Alt-Escape, followed by a mouse click kills the onscreen windows and your
Matlab session.
=== BUGS ===
Additions:
Screen is a MEX file for precise control of the video display. Screen has
many functions
=== See ScreenFunctions for the subfunction docs ===
=== See also [[Preference ScreenPreferences]] ===
>>===Inside MATLAB:===
Screen has many functions; type "Screen" for a list:
%%(matlab)Screen%%
For an explanation of any particular screen function, just add a question
%%(matlab)Screen('OpenWindow?')
Screen OpenWindow?%%
%%(matlab)Screen Preference?%%
>>
"windowPtr" argument: [[Screen]] 'OpenWindow' and 'OpenOffscreenWindow'
both return a windowPtr, a number that designates the window you just
%%(matlab)% make movie
window=[[Screen]]('OpenWindow', 0, 0);
rect=[0 0 200 200];
for i=1:100
movie(i)=[[Screen]]('OpenOffscreenWindow', window, 0, rect);
[[Screen]]('FillOval', movie(i), 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]]('[[Flip]]', window);
end;
[[Screen]]('CloseAll');%%
""<!--protected-->""
Deletions:
[[Screen]] is a MEX file for precise control of the video display. [[Screen]] has
many functions; type "[[Screen]]" for a list:
[[Screen]]
For explanation of any particular screen function, just add a question
[[Screen]]('OpenWindow?')
[[Screen]] OpenWindow?
[[Screen]] [[Preference]]?
"windowPtr" argument: [[Screen]] 'OpenWindow' and 'OpenOffscreenWindow' both
return a windowPtr, a number that designates the window you just
% make movie
window=[[Screen]]('OpenWindow', 0, 0);
rect=[0 0 200 200];
for i=1:100
movie(i)=[[Screen]]('OpenOffscreenWindow', window, 0, rect);
[[Screen]]('FillOval', movie(i), 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]]('[[Flip]]', window);
end;
[[Screen]]('CloseAll');
Edited on
2008-06-15 19:57:15 by
DocBot [manually add multisample argument to OpenOffscreenWindow]
Additions:
==[[Psychtoolbox]] › [[PsychBasic]]==
many functions; type "[[Screen]]" for a list:
[[Screen]]
[[Screen]]('OpenWindow?')
[[Screen]] OpenWindow?
[[Screen]] [[Preference]]?
Linux:
All known bugs and fixes are eventually described at the web site under "Bugs":
Initial reports appear first at the forum:
If you find a bug, please report it to the forum:
Deletions:
==[[Psychtoolbox]] › PsychBasic==
many functions.
<<===See: [[ScreenFunctions]] for the complete list===
or type **##Screen##** on the Matlab prompt for the same.<<
##Screen('OpenWindow?')
Screen OpenWindow?##
<<===See [[Preference Screen Preferences]] for the complete list===
or type **##Screen Preference?##** on the Matlab prompt for the same.<<
=== Linux: ===
=== All known bugs and fixes are eventually described at the web site under "Bugs": ===
=== Initial reports appear first at the forum: ===
=== If you find a bug, please report it to the forum: ===
No Differences
Full history for this page cannot be displayed within a single page, click
here to view more.