I have made an image browser and used some image processing algorithms. This is part of it. APK installation package address: http://static.apk.hiapk.com/html/2012/08/797656.html. Welcome to download and feedback;
Illumination effects of special image effects in Android system
Public static bitmap sunshine (softreference <bitmap> BMP) {final int width = BMP. get (). getwidth (); Final int Height = BMP. get (). getheight (); log. D ("Sunshine", "Sunshine: width" + width + "height:" + height); Bitmap bitmap = (bitmap. createbitmap (width, height, bitmap. config. rgb_565); int pixr = 0; int pixg = 0; int pixb = 0; int pixcolor = 0; int newr = 0; int newg = 0; int newb = 0; int centerx = width/ 2; int centery = height/2; int radius = math. Min (centerx, centery); Final float strength = 150f; // illumination intensity 100 ~ 150 int [] pixels = new int [width * Height]; BMP. get (). getpixels (pixels, 0, width, 0, 0, width, height); int Pos = 0; // BMP. recycle (); // BMP = NULL; For (INT I = 1, length = height-1; I <length; I ++) {for (int K = 1, len = width-1; k <Len; k ++) {pos = I * width + k; pixcolor = pixels [POS]; pixr = color. red (pixcolor); pixg = color. green (pixcolor); pixb = color. blue (pixcolor); newr = pixr; newg = pixg; newb = pixb; // calculate the distance from the current point to the light center, distance between two points in a plane coordinate system V int distance = (INT) (math. pow (centery-I), 2) + math. pow (centerx-K, 2); If (distance <radius * radius) {// calculate the added illumination value by distance int result = (INT) (strength * (1.0-math. SQRT (distance)/radius); newr = pixr + result; newg = pixg + result; newb = pixb + result;} newr = math. min (255, math. max (0, newr); newg = math. min (255, math. max (0, newg); newb = math. min (255, math. max (0, newb); pixels [POS] = color. argb (255, newr, newg, newb) ;}} bitmap. setpixels (pixels, 0, width, 0, 0, width, height); Return bitmap ;}