/usr/share/psychtoolbox-3/PsychTests/TextureTest.m is in psychtoolbox-3-common 3.0.9+svn2579.dfsg1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | % TextureTest
%
% Exercises the new Screen('DrawTexture') command in the OS X Psychtolbox
% which replaces Screen('CopyWindow').
%
% HISTORY
% 6/28/04 awi wrote it.
% Tests which we make of textures:
%
% That that after drawing a texture onto the screen that GetImage returns
% the identical matrix
screenNumber=max(Screen('Screens'));
% Open and onscreen window on the second display
w=Screen('OpenWindow',screenNumber, 0,[],32,2);
%make some textures out of matrices
gradientVector=[0:255];
gradientMat=repmat(gradientVector, 256, 1);
gradientMatColor=gradientMat;
gradientMatColor(:,:,2)=fliplr(gradientMat(:,:,1));
gradientMatColor(:,:,3)=gradientMat(:,:,1)';
gradientMatColorAlpha=gradientMatColor;
gradientMatColorAlpha(:,:,4)=ones(256) * 255;
angleMat=zeros(256);
angleMat(1:128,1)=255;
for im=1:256
for in=1:256
if im==in
angleMat(im,in)=255;
end
end
end
tColor=Screen('MakeTexture', w, gradientMatColor);
tColorAlpha=Screen('MakeTexture', w, gradientMatColor);
a=Screen('MakeTexture', w, angleMat);
t=Screen('MakeTexture', w, gradientMat);
% See if drawing works at all
Screen('FillRect', w, 0);
Screen('FillRect', w, [255 0 0 255], [600 600 800 800]);
targetRect=RectOfMatrix(gradientMat);
Screen('DrawTexture', w, a, targetRect, OffsetRect(targetRect, 100, 100));
Screen('Flip', w);
WaitSecs(5);
Screen('CloseAll');
|