finding "distance" between two pixel's colors.

Posted by igor on Stack Overflow See other posts from Stack Overflow or by igor
Published on 2010-04-14T03:40:10Z Indexed on 2010/04/14 3:43 UTC
Read the original article Hit count: 303

Filed under:
|

Once more something relatively simple, but confused as to what they want.

the method to find distance on cartesian coordinate system is distance=sqrt[(x2-x1)^2 + (y2-y1)^2]

but how do i apply it here?

    //Requires: testColor to be a valid Color
    //Effects: returns the "distance" between the current Pixel's color and  
    //         the passed color
    //         uses the standard method to calculate "distance"
    //         uses the same formula as finding distance on a
    //         Cartesian coordinate system
    double colorDistance(Color testColor) const;

© Stack Overflow or respective owner

Related posts about c++

Related posts about homework