final float sum_xy = getSum(x, y); final float sum_x2y2 = getSum(x2, y2); final float sum_xy2 = getSum(x, y2); final float sum_x2y = getSum(x2, y);
final int sum_xy = getSum(x, y); final int sum_x2y2 = getSum(x2, y2); final int sum_xy2 = getSum(x, y2); final int sum_x2y = getSum(x2, y);
	public final float getIntensity(int x, int y, int w, int h) {		if (x < 0) {			w += x;			x = 0;		}		if (y < 0) {			h += y;			y = 0;		}		if (x + w > width) {			w = Math.max(0, width - x);		}		if (y + h > height) {			h = Math.max(0, height - y);		}		if ((w <= 0) || (h <= 0)) {			return 0.0f;		}		final int x2 = x + w;		final int y2 = y + h;				final float sum_xy = getSum(x, y);		final float sum_x2y2 = getSum(x2, y2);		final float sum_xy2 = getSum(x, y2);		final float sum_x2y = getSum(x2, y);				return (sum_x2y2 + sum_xy - (sum_xy2 + sum_x2y)) / (w * h);			}