oldClut =
LoadIdentityClut(windowPtr [, loadOnNextFlip=0][, lutType=auto])
Loads the identity clut on the windows specified by windowPtr. If
loadOnNextFlip is set to 1, then the clut will be loaded on the next call
to
Screen('
Flip'). By default, the clut will be loaded immediately or on
the next vertical retrace.
If you use Linux and run Matlab or Octave as root user via the "sudo"
command, or if you use OS/X and have the
PsychtoolboxKernelDriver loaded
("help
PsychtoolboxKernelDriver") and the graphics card is a GPU of the
ATI/AMD Radeon X1000 series or a HD series card (e.g., HD-2000) or a
equivalent model of the
FireGL or
FirePro series, then this routine will
try to use special low-level setup code for optimal identity mapping.
Otherwise it will just make a best effort to upload a suitable clut, as
follows:
This mechanism relies on heuristics to detect the exact type of LUT to
upload into your graphics card. These heuristics may go wrong, thanks to
the ever increasing amount of graphics hardware driver bugs in both
Windows and
MacOS/X. For that reason you can also use the function
SaveIdentityClut() to manually specify either the type of LUT to use
(overriding the automatic choice), or to specify the complete LUT, or to
capture the current identity LUT of a display that works. That function
will store the override Clut in a per-user, per-GPU, per-
Screen configuration
file. If
LoadIdentityClut finds such a matching configuration file, it
will use the LUT specified there, instead of performing an automatic
selection.
The routine optionally returns the old clut in 'oldClut'.
You can restore the old "original" LUT at any time by calling
RestoreCluts, or
sca, but only until you call clear all! The original
LUT's are backed up in a global variable for this to work.
Psychtoolbox/PsychOneliners/LoadIdentityClut.m