Add SCIE-Lab error metric. Work in progress.

This commit is contained in:
castano
2010-11-11 19:10:14 +00:00
parent 5cf219a22e
commit 1f1afe0c33
4 changed files with 31 additions and 4 deletions

View File

@ -178,10 +178,10 @@ namespace nv
inline float perceptualColorDistance(Vector3::Arg c0, Vector3::Arg c1)
{
float rmean = (c0.r + c1.r) * 0.5f;
float r = c1.r - c0.r;
float g = c1.g - c0.g;
float b = c1.b - c0.b;
float rmean = (c0.x + c1.x) * 0.5f;
float r = c1.x - c0.x;
float g = c1.y - c0.y;
float b = c1.z - c0.z;
return sqrtf((2 + rmean)*r*r + 4*g*g + (3 - rmean)*b*b);
}