A method and system of processing raw images for display. First, a processor
corrects
the raw images with respect to an offset image to generate an offset corrected
image. Next, a level of the offset corrected image is adjusted with respect to
a gain adjust by employing saturation arithmetic to clip the level of the offset
corrected image to generate a gain corrected image. Next, a window of the gain
corrected image is adjusted with respect to a reference window to generate an output
image. Next, the output image is packed into a register for display.