functions in dichromat.i -
dichromap
|
dichromap, type or dichromap Modify the current colormap to see how the plot (pli, plf, or plfc) would appear to a dichromat of the given TYPE, which is 1, 2, 3 (or "p", "d", "t") to simulate protan, deuteran, or tritan vision. See help, dichromat for more. Omitting TYPE toggles the original color map with the modified one provided the current colormap is still the one installed by dichromap. | |
SEE ALSO: | dichromat, cmap |
dichromat
|
drgb = dichromat(type, rgb) or drgb = dichromat(type, r, g, b) Return colors DRGB perceived by a dichromat of TYPE corresponding to screen colors RGB = [r,g,b], or R, G, B. The return value has the same dimensions as RGB or [R,G,B]. There are three classes of dichromats (colorblind people): Protrans, Deuterans, and Tritans, according to whether they lack long, medium, or short wavelength cone cells (or which type of cell is damaged). For good background material, see http://en.wikipedia.org/wiki/Color_blindness or http://cvrl.ioo.ucl.ac.uk/ and for details of the algorithm implemented here see Brettel et al., JOSA 14, 2647 (1997), http://perso.telecom-paristech.fr/~brettel. By default, DRGB is a char array, but with cmax=1, you can get a double array. The input RGB can be a char array, or any integer datatype with a maximum of 255, or a floating point array with maximum 1.0. Both input and output are sRGB values, that is, the RGB of your monitor; see the rgb_s2l and rgb_l2s functions for conversions to physically linear ("gamma corrected") RGB values. TYPE is 1 for protran, 2 for deuteran, or 3 for tritan dichromatism. You may also pass any string beginning with "p", "d", or "t", respectively. The dichromat function projects the three dimensional RGB onto a two dimensional subspace, so that there are only two primary colors instead of three. Note that tritan dichromatism is quite rare, while some male in a room of 20 probably suffers from either deuteran or (less likely) protan dichromacy. Use the dichromap function to quickly check a pseudocolor picture made with pli, plf, or plfc to see how it appears to a dichromat. | |
SEE ALSO: | dichromap, dichromat_setup, rgb_s2l, rgb_l2s |
dichromat_setup
|
dichromat_setup, xylms, xypri Set up the dichromatic projection matrices and selection tests for the dichromat function. XYLMS is either a 2x3 or 3x3 array of the CIE xy or XYZ color coordinates of the L, M, and S spectral responses of the three retinal cone cells responsible for color vision. There is some dispute about exactly what colors these are, since the experiments to find them are difficult. XYPRI is either a 2x2x3 or 3x2x3 of the xy or XYZ color coordinates of the pairs of primary trichromatic colors which will be used to represent what the dichromat sees. The third index is [protan,deuteran,tritan]. These should be chosen so that the colors returned by the dichromat function are indistinguishable from the input colors by that particular type of dichromat. | |
SEE ALSO: | dichromat |