/* build up LUT (it's faster this way) */
for(i = 0; i< 256; i++)
    LUT[i] = (unsigned char) (255.0 * pow((i/255.0), gamma));

Example 1: Gamma correction.

Back to Article
Copyright © 1999, Dr. Dobb's Journal