Page 55 - Computational Colour Science Using MATLAB
P. 55
42 COMPUTING CIE TRISTIMULUS VALUES
% and for the 1931 and 1964 observers
% set obs to ’d65___64 for D65 and 1964, for example
% the startlam and endlam variables denote the first and
% last wavelengths (eg. 400 and 700) for your reflectance
% which must be integers of 10 in the range 360-780
if ((endlam780) | (startlam 5 360) | (rem(endlam,10)*=0) |
(rem(startlam,10)*=0))
disp(’start and end wavelengths must be divisible by 10’)
disp(’wavelength range must be 360-780 or less’);
return;
end
load weights.mat
% weights.mat contains the tables of weights
if strcmp(’a___64’,obs)
cie = a___64;
elseif strcmp(’a___31’, obs)
cie = a___31;
elseif strcmp(’c___64’, obs)
cie = a___64;
elseif strcmp(’c___31’, obs)
cie = c___31;
elseif strcmp(’d50___64’, obs)
cie = d50___64;
elseif strcmp(’d___50’, obs)
cie = d___50;
elseif strcmp(’d55___64’, obs)
cie = d55___64;
elseif strcmp(’d55___31’, obs)
cie = d55___31;
elseif strcmp(’d65___64’, obs)
cie = d65___64;
elseif strcmp(’d65___31’, obs)
cie = d65___31;
elseif strcmp(’d75___64’, obs)
cie = d75___64;
elseif strcmp(’d75___31’, obs)
cie = d75___31;
elseif strcmp(’f2___64’, obs)
cie = f2___64;
elseif strcmp(’f2___31’, obs)