File: PutImageTest.m

package info (click to toggle)
psychtoolbox-3 3.0.19.14.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,796 kB
  • sloc: ansic: 176,245; cpp: 20,103; objc: 5,393; sh: 2,753; python: 1,397; php: 384; makefile: 193; java: 113
file content (25 lines) | stat: -rw-r--r-- 828 bytes parent folder | download | duplicates (4)
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
function PutImageTest
% PutImageTest
%
% Test Screen('PutImage') when used with 'NormalizedHighresColorRange'.
%
% Derived from PutImageBug.m from Denis Pelli
% This didn't work as expected in PTB releases before June 2017,
% so now confirms a correct bug fix.

PsychDefaultSetup(0);
deferLoading=2; 
PsychImaging('PrepareConfiguration'); 
PsychImaging('AddTask','General','NormalizedHighresColorRange',1);
[window, screenRect]=PsychImaging('OpenWindow', 0, 1);

Screen('PutImage',window,(0:255)/255,screenRect);
DrawFormattedText(window, 'A ramp, 0 to 1. Click to continue.', 'center', 'center', [1 0 0]);
Screen('Flip',window);
GetClicks;

Screen('PutImage',window,uint8(0:255),screenRect);
DrawFormattedText(window, 'A byte ramp 0 to 255. Click to quit.', 'center', 'center', [1 0 0]);
Screen('Flip',window);
GetClicks;
sca;