/* 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));