This article will talk about the effects of photo effects on lighting. As before, the pixel is processed, and the algorithm is universal.
Algorithm principle: The pixels above the image according to the given center, according to the circle radius, the RGB values of the pixels are added to the corresponding values as the current point RGB values.
Cases:
ABCDE
Fghij
Klmno
If the specified H point is the center of the lighting effect, and the radius is two pixels, then the value of the G-point RGB value will be greater than the F point, because the larger the RGB value, the closer the white, so the G-point looks whiter than the F-point, that is, the closer to the light center, see:
Original:
After processing:
Code:
Http://wenku.baidu.com/link?url=-c1rYHzGqXMdrULyBYO1WnxUwic_xu1zjXQPOUfU_AqL7SCx3sStzo7nDFsthMSU0nXB_ Ojy4tmsxafqsvyiijdutorjr9bmuhdvmnhpj5y