Page 137 - Computational Colour Science Using MATLAB
P. 137
124 CHARACTERIZATION OF COMPUTER DISPLAYS
RGB = inv(A)*XYZ;
dacs(1) = compigog(gogvals(1,:), RGB(1));
dacs(2) = compigog(gogvals(2,:), RGB(2));
dacs(3) = compigog(gogvals(3,:), RGB(3));
dacs = dacs*255;
if (dacs(1)4255)
dacs(1) = 255;
end
if (dacs(2)4255)
dacs(2) = 255;
end
if (dacs(3)4255)
dacs(3) = 255;
end
if (dacs(1)50)
dacs(1) = 0;
end
if (dacs(2)50)
dacs(2) = 0;
end
if (dacs(3)50)
dacs(3) = 0;
end
dacs = dacs(:);
The function xyz2rgb requires an inverse version of the compgog function and
this is provided with the compigog function.
Box 22: compigogs.m
function [dacs] = compigog(gogs,rgb)
% function [dacs] = compgog(gogs,rgb)
% computes the normalized RGB values