[psychtoolbox] gamma correction using PsychCal routines

I am trying to figure out how the routines in PsychCal do gamma
correction.

After I create a calibration file for my monitor using say the
VisualGammaDemo I can see that I can load the calibration variables in
a struct:

»calCM = LoadCalFile(0)
calCM =
monitorGammaGamma: 2.2996
monitorGammaThreshold: 0.0858
gammaRmsError: 0.0020
gammaInput: [256x1 double]
gammaTable: [256x3 double]
dpi: 80.7184
program: 'VisualGammaDemo'
date: '14-Mar-2000'
gammaMethod: 'visual matching'
who: 'Ethan'
monitor: 'Apple ColorSync'
whichScreen: 0
width: 1024
height: 768
hz: 74.7800
description: 'room lights on'

I've tried to look through some of the examples to understand how this
data is used correct the gamma but I don't see it. I would guess that
somewhere there should be a SCREEN 'Gamma' command but I can only find
a bunch of routines that manipulate cluts that are used in SCREEN
'SetClut'. So maybe the clut is manipulated based on the gammaTable
from the calibration file. I don't know.

Would it be possible for someone to provide me a basic overview of the
technique used to correct the gamma. Then maybe I can go through the
different functions and figure out the specific implementation.

Thanks,
Ethan
>I've tried to look through some of the examples to understand how this
>data is used correct the gamma but I don't see it. I would guess that
>somewhere there should be a SCREEN 'Gamma' command but I can only find
>a bunch of routines that manipulate cluts that are used in SCREEN
>'SetClut'. So maybe the clut is manipulated based on the gammaTable
>from the calibration file. I don't know.
>
>Would it be possible for someone to provide me a basic overview of the
>technique used to correct the gamma. Then maybe I can go through the
>different functions and figure out the specific implementation.

dear ethan

i'm unfamiliar with that code, despite having written some of it long
ago. We do gamma correction by adjusting the values in the CLUT.

(The video driver has a separate gamma table, but we generally set that
to the identity transform and do all corrections to the CLUT directly. At
the hardware level, there really is a CLUT that every pixel passes
through, whereas the driver's gamma table is strictly in software, used
by the driver to adjust the CLUT.)

david's been tied up lately, but when he gets a chance he may be able to
say more.

best

denis