Apachai.Effects.Core.Utility.ColorDifferenceSquared C# (CSharp) Method

ColorDifferenceSquared() public static method

public static ColorDifferenceSquared ( PixelData a, PixelData b ) : int
a System.Drawing.PixelData
b System.Drawing.PixelData
return int
        public static int ColorDifferenceSquared(PixelData a, PixelData b)
        {
            int diffSq = 0, tmp;

            tmp = a.R - b.R;
            diffSq += tmp * tmp;
            tmp = a.G - b.G;
            diffSq += tmp * tmp;
            tmp = a.B - b.B;
            diffSq += tmp * tmp;

            return diffSq / 3;
        }