File: kPsychEnableSRGBRendering.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 (36 lines) | stat: -rw-r--r-- 1,602 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
26
27
28
29
30
31
32
33
34
35
36
function rval = kPsychEnableSRGBRendering
% rval = kPsychEnableSRGBRendering
%
% Return a flag that you can pass to the 'imagingmode' parameter of
% Screen('OpenWindow'). If this kPsychEnableSRGBRendering flag is
% given then rendering to the framebuffer will happen in sRGB format
% if the target framebuffer supports this, ie. is in sRGB color buffer
% format.
%
% The sRGB color space is based on typical (non-linear) monitor
% characteristics expected in a dimly lit office.  It has been
% standardized by the International Electrotechnical Commission (IEC)
% as IEC 61966-2-1. The sRGB color space roughly corresponds to 2.2
% gamma correction.
%
% See this spec for more details:
%
% https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_framebuffer_sRGB.txt
%
% In general, only RGBA8 framebuffer formats are sRGB capable, as
% typical GPU's do not implement sRGB on other formats, and for
% floating point framebuffers, sRGB encoding would be pointless,
% as they provide already a non-linear format with much more precision,
% so no need for sRGB style compression.
%
% Given that Screen() does not explicitely request sRGB system framebuffers,
% this flag will only apply to output (sink) FBO's when the imaging pipeline
% is active, and there only if an external sink texture is passed in by some
% external client, ie. the kPsychUseExternalSinkTextures flag is given as well.
%
% The only known potential client of this is currently the Oculus VR runtime
% compositor, which wants to process sRGB RGBA8 textures as input, unless you
% choose half-float textures.
%
rval = 2^23;
return