File: ScreenDacBits.m

package info (click to toggle)
psychtoolbox-3 3.0.14.20170103%2Bgit6-g605ff5c.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 103,044 kB
  • ctags: 69,483
  • sloc: ansic: 167,371; cpp: 11,232; objc: 4,708; sh: 1,875; python: 383; php: 344; makefile: 207; java: 113
file content (42 lines) | stat: -rw-r--r-- 1,574 bytes parent folder | download | duplicates (5)
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
function dacBits = ScreenDacBits(w)
% dacBits = ScreenDacBits(windowPtrOrScreenNumber)
%
% What is the precision of the DACs on this graphics card?
% 
% At present you need to know the bit depth of your graphics board's DAC
% to determine how to write its CLUT, i.e. Screen 'SetClut' or 'Gamma'.
% Use this routine and ScreenUsesHighGammaBits, instead of the the brand-
% and platform-specific IsRadiusThunder10 and IsATIRadeon10, to keep your
% program as general as possible, not tied to particular hardware or
% platform.
% 
% The value is set in PrepareScreen.m.
% 
% See also LoadClut, ScreenPixelSize, ScreenUsesHighGammaBits, ScreenClutSize.

% 2/27/02  dhb,ly  Wrote it.
% 3/20/02  dgp	   Cosmetic.
% 3/26/02  dhb     Gen2 Radeon card check.
% 6/6/02   dgp     Renamed DriverDacBits. When we don't know dacBits, ask the driver.
% 6/7/02   dgp     Cache the answer.
% 6/8/02   dgp     Renamed ScreenDacBits. 
% 6/20/02  dgp     Moved all code to PrepareScreen.m.
% 10/10/06 dhb     Just always return 8 bits, until we figure out how to update.
% 05/21/07 mk      Return queried dac size from screen. This will return 8
%                  bits if it can't query real dac size.

global g_usebitspp;

% If the global flag for using Bits++ is empty, then it hasn't been
% initialized and default it to 0.
if isempty(g_usebitspp)
    g_usebitspp = 0;
end

% dacBits=Screen(w,'Preference','DacBits');
%dacBits = 8;
if g_usebitspp
	dacBits = 14;
else
	[gammatable, dacBits, reallutsize] = Screen('ReadNormalizedGammaTable', w);
end