Subject: Re: X brightness level
To: None <dbushong@cory.EECS.Berkeley.EDU>
From: Taras Ivanenko <ivanenko@ctpa03.mit.edu>
List: port-mac68k
Date: 09/24/1996 20:49:35
> xsetroot -solid #050505:  whit-ish gray.   Really weird.. anyone know how 
> to fiddle with gamma correction under X?

I noticed also that the colors are different from the other machines
where I work. 

I know very little on intvid kernels as I do not
have machine to run them, but if you are using "colorkit" kernel, here
is relevant information:

The "color kit" kernel uses default gamma correction table which is
loaded from the card. I tried to go through the description of gamma
table format but did not try to change it. As I remember, Ken Nakata
did not change much of my definitions.

ioctl's are defined as

#define GRFIOCSETGAMMA         _IOWR('G', (32+4), struct
VDGammaRecord)
#define GRFIOCGETGAMMA         _IOWR('G', (64+8), struct
VDGammaRecord)

The data structures are: (have somewhere Apple's technical note with
the description of gamma tables)

struct VDGammaRecord {
  struct GammaTable *csGTable;
  int length;
};

typedef struct VDGammaRecord VDGamma;

struct GammaTable {
  short gVersion;     /* {gtab version, currently 0} */
  short gType;        /* {drHwId value} */
  short gFormulaSize; /* {size of formula data, below} */
  short gChanCnt;     /* {# of component channels} */
  short gDataCnt;     /* {# of values per channel} = 2gDataWidth ?*/
  short gDataWidth;   /* {size of data in tables} */
  u_int8_t data[4];
  /*
     {gamma correction look-up tables}
     gFormulaData: array [0.. gFormulaSize] of byte;

     {data for gamma calculation formula}
     gData: array [0.. gDataCnt] of byte;

     Repeat for R, G, B in order, up to gChanCnt.  

     The standard tables included in Apple's driver have only one
table,
     which is applied to all three output channels.  
     */
};

typedef struct GammaTable GammaTable;


Again, the definitions for intvid kernel may be completely
different. Good luck,

	Taras Ivanenko.