AcoustID.Chromaprint.Filter.Filter3 C# (CSharp) Method

Filter3() public static method

public static Filter3 ( IntegralImage image, int x, int y, int w, int h, Func cmp ) : double
image IntegralImage
x int
y int
w int
h int
cmp Func
return double
        public static double Filter3(IntegralImage image, int x, int y, int w, int h, Func<double, double, double> cmp)
        {
            //Debug.Assert(x >= 0);
            //Debug.Assert(y >= 0);
            //Debug.Assert(w >= 1);
            //Debug.Assert(h >= 1);

            int w_2 = w / 2;
            int h_2 = h / 2;

            double a = image.Area(x, y + h_2, x + w_2 - 1, y + h - 1) +
                       image.Area(x + w_2, y, x + w - 1, y + h_2 - 1);
            double b = image.Area(x, y, x + w_2 - 1, y + h_2 - 1) +
                       image.Area(x + w_2, y + h_2, x + w - 1, y + h - 1);

            return cmp(a, b);
        }