ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/cieluv.cal
Revision: 1.1
Committed: Sat Feb 22 02:07:21 2003 UTC (21 years, 1 month ago) by greg
Branch: MAIN
CVS Tags: rad3R5, rad3R6, rad3R6P1
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# Content
1 {
2 Compute Luv color space and color differences from XYZ primaries.
3
4 5/4/98 G.W.Larson
5 }
6 Xw = 1; Yw = 1; Zw = 1; { default white }
7 sq(x) : x*x;
8 up(Xi,Yi,Zi) : 4*Xi/(Xi + 15*Yi + 3*Zi);
9 vp(Xi,Yi,Zi) : 9*Yi/(Xi + 15*Yi + 3*Zi);
10 Ls(Yi) : if(Yi/Yw - .01, 116*(Yi/Yw)^(1/3) - 16, 903.3*Yi/Yw);
11 us(Xi,Yi,Zi) : 13*Ls(Yi)*(up(Xi,Yi,Zi) - up(Xw,Yw,Zw));
12 vs(Xi,Yi,Zi) : 13*Ls(Yi)*(vp(Xi,Yi,Zi) - vp(Xw,Yw,Zw));
13 dE(X1,Y1,Z1,X2,Y2,Z2) : sqrt(sq(Ls(Y1)-Ls(Y2)) + sq(us(X1,Y1,Z1)-us(X2,Y2,Z2))
14 + sq(vs(X1,Y1,Z1)-vs(X2,Y2,Z2)));