Page 203 - Computational Colour Science Using MATLAB
P. 203
190 COLOUR TOOLBOX
11.3 r2xyz.m (Box 3)
% function [xyz] = r2xyz(p, startlam, endlam, obs)
% computes XYZ from reflectance p using a table of weights
% operates on matrix p of dimensions 1 by n for
% illuminants A, C, D50, D55, D65, D75, F2, F7, F9
% 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
11.4 plocus.m (Box 4)
% function [xy] = plocus(obs)
% computes spectral locus xy using interpolated ASTM
% weights
% see function r2xyz for valid values for obs
11.5 xyz2lab.m (Box 5)
% function [lab] = xyz2lab(xyz,obs)
% computes CIELAB LAB values from XYZ tristimulus values
% requires the illuminant/observer obs to define white
% point
% see function r2xyz for valid values for obs
11.6 lab2xyz.m (Box 6)
% function [xyz] = lab2xyz(lab,obs)
% computes XYZ tristimulus values from CIELAB LAB values
% requires the illuminant/observer obs to define white
% point
% see function r2xyz for valid values for obs