

The science of determining gamma correction is complex, and is not presented here, other than to illuminate where the name “gamma” came from. In fact, we recommend that you leave the gamma table alone because it might be in use to calibrate the monitor’s response, and wholesale changes to the gamma ramp will destroy this careful calibration. In modern game apps, as part of the post-processing of each frame, we typically provide other ways to do such things. That’s what this table was intended for, but game developers found creative uses for it, such as flashing the whole screen red for psychological effect. The monitor’s response is the function that relates the numerical value of the red, green and blue components of a pixel with that pixel’s displayed brightness.

While the table has that level of power, the typical usage is to tweak images subtly to compensate for differences in the monitor’s response. So, this lookup table is an opportunity to replace any color with any other color. This hardware uses the red, green and blue values that come from the surface to be displayed to look up gamma-corrected values in the table and then sends the corrected values to the monitor instead of the actual surface values. This hardware typically uses a lookup table to transform the pixels.
#Gamma control windows 7 code#
Gamma correction, or gamma for short, is the name of a nonlinear operation that systems use to code and decode pixel values in images.Īt the end of the graphics pipeline, just where the image leaves the computer to make its journey along the monitor cable, there is a small piece of hardware that can transform pixel values on the fly.
