Here you can find the source of interpolateBrightness(int a, int b, int c, int d)
private static int interpolateBrightness(int a, int b, int c, int d)
//package com.java2s; //License from project: Open Source License public class Main { private static int interpolateBrightness(int a, int b, int c, int d) { if (a == 0) a = d;//from w w w .j ava 2s .co m if (b == 0) b = d; if (c == 0) c = d; return (a + b + c + d) >> 2 & 0xFF00FF; } }