File: BitsPlusBlank.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 (32 lines) | stat: -rw-r--r-- 965 bytes parent folder | download | duplicates (7)
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
function BitsPlusBlank(screen)
% BitsPlusBlank(screen)
%
% Just zero the Bits++ clut to save the screen.
% Probably shouldn't be called when screen is open.
%
% 5/4/03  dhb  Wrote it.
% 9/20/03 dhb  Needs screen pointer.
% 18/4/05 ejw  Converted it to run with OSX version of Psychtoolbox

if (nargin ~= 1)
    error('USAGE: BitsPlusBlank(screen)');
end

window = Screen('OpenWindow',screen, 0, [], 32);

% THE FOLLOWING STEP IS IMPORTANT.
% make sure the graphics card LUT is set to a linear ramp
% (else the encoded data will not be recognised by Bits++).
Screen('LoadNormalizedGammaTable', window, linspace(0, 1, 256)'*ones(1, 3));

theClut = zeros(256, 3);
%theClut(:, 2) = 2^16-1; % (DEBUG) Turn the screen green.
BitsPlusSetClut(window, theClut);

% draw a black (?) background on front and back buffers to clear out any old LUTs
Screen('FillRect',window, 0);
Screen('Flip', window);
Screen('FillRect',window, 0);
Screen('Flip', window);

Screen('CloseAll');