Next: Quantization Up: Image Previous: Image Representation

Image Display

Device Dependent Issues

Gamma Compensation using Color Maps

void cmap_gamma(CMap *m, Real gamval)
{
  int k;

  for (k = 0; k < 256; k++) {
    m->r[k] = 255 * pow(m->r[k]/255., 1./gamval);
    m->g[k] = 255 * pow(m->g[k]/255., 1./gamval);
    m->b[k] = 255 * pow(m->b[k]/255., 1./gamval);
  }
}



Luiz Velho
Wed Apr 7 12:17:01 "EST 1999