Docs @ Psychtoolbox Wiki : LoadNormalizedGammaTable

Search PTB Function help:
homepsychtoolbox.orgpage updateslogin

Screen('LoadNormalizedGammaTable')

PsychtoolboxScreen.{mex*,dll} subfunction

Usage
Screen('LoadNormalizedGammaTable', windowPtrOrScreenNumber, table [, loadOnNextFlip] [, physicalDisplay]);

Load the gamma table of the specified screen or window
'windowPtrOrScreenNumber'.
You need to pass the new hardware gamma table 'table' as a 'nrows' rows by 3
columns matrix. Each row corresponds to a single color index value in the
framebuffer and contains the Red- green- and blue values to use for output.
Column 1 is the red value, column 2 is the green value and column 3 is the blue
value. Values have to be in range between 0.0 (for dark pixel) and 1.0 (for
maximum intensity). Example: table(127,1)=0.67 would mean that the red color
value 127 should be displayed with 67% of the maximum red-gun intensity,
table(32, 3)=0.11 means that blue color value 32 should be displayed with 11% of
the maximum blue-gun intensity. The range of values 0-1 gets mapped to the
hardware with the accuracy attainable by the hardwares DAC's, typically between
8 and 10 bits.
The required number of rows 'nrows' is typically 256 for consumer graphics
cards.
On OS-X you can also pass 512, 1024, 2048, ..., 65535 rows instead of 256 rows,
although this only makes sense for a few selected applications, e.g., setup for
the Bits++ box. On Linux with some pro-graphics cards, e.g., some NVidia
QuadroFX cards, you can pass more than 256 rows, similar to OS/X.
If you provide the index of an onscreen window as 'ScreenNumber' and you set the
(optional) flag 'loadOnNextFlip' to 1, then update of the gamma table will not
happen immediately, but only at execution of the Screen('Flip',
windowPtrOrScreenNumber) command. This allows to synchronize change of both the
visual stimulus and change of the gamma table with each other and to the
vertical retrace. If the flag is set to its default value of zero then update of
the gamma table will happen at the next vertical retrace (or immediately if the
graphics driver doesn't support sync to vertical retrace). A 'loadOnNextFlip'
flag of 2 will load the provided table not into the hardware tables of your
graphics card, but into the hardware tables of special display devices, like
e.g., the Bits++ box. It can also be used to load clut's for color lookup table
animation. Read the section about 'EnableCLUTMapping' in the 'help PsychImaging'
for info on how to enable and use color lookup table animation.
On MacOS-X, the optional 'physicalDisplay' flag can be set to 1, zero is the
default. In this case, the 'windowPtrOrScreenNumber' argument (which then must
be a real screen number, not a window index) selects among physically present
display devices, instead of logical devices. This is important if you want to
assign different gamma-tables to multiple displays in a 'clone' or 'mirror mode'
configuration, as there is only one logical display, but multiple physical
displays, mirroring each other. Please note that screen numbering is different
for physical vs. logical displays. For a list of physical display indices, call
Screen('Screens', 1);
On GNU/Linux, the optional 'physicalDisplay' parameter selects the video output
to which the gamma table should be applied in multi-display mode. On Linux a
screen can output to multiple video displays, therefore this parameter allows to
setup individual gamma tables for each display. The default setting is -1, which
means to apply the (same) gamma table to all outputs of the given screen.
On MacOS-X and Linux, this function takes arbitrary gamma-tables which makes it
suitable for CLUT animation, although you should rather avoid CLUT animation, or
use the PsychImaging(...'EnableCLUTMapping'...) method instead. CLUT animation
nowadays is almost always the wrong approach. If you really need it, the
PsychImaging based method provides cross-platform compatibility and reliable
timing.
On Microsoft Windows, only tables with monotonically increasing values are
considered valid. Other tables get rejected by the operating system -- there's
nothing we can do about this incredibly wise decision of the Microsoft system
designers :( , so this is not suitable for CLUT animation, but only for
linearizing or calibrating display devices. The function returns the old gamma
table as optional return argument.


Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.0612 seconds