The Contrast filter is very similar to Grayscale, except its override of filth crRCO( ) is , slightly more complicated. The algorithm it uses for contrast enhancement takes the red, green, and blue values separately and boosts them by '1.2 times if they arc already brighter than 128. If they are below 128, then they are divided by 1.2.-The boosted values are properly clamped at 255 by the multi clamp ) method.
The abstract class Convolver handles the basics of it convolution' filter by implementing the ImageConsumer interface to move the source pixels into an array called Img Pixels. It also creates a second array called new lmg pixels for the filtered data, Convolution filters sample a small rectangle of pixels around each pixel in an image, called the; convolution 1cm Jt1. This area, pixels in this demo, is used to decide how to change the center pixel in the area. The two concrete subclasses, shown in the next section, ' simply implement the convolve( ) method, using Img pIMla for source data and new m8 Pixela to store the result.