- * This is the RLAB space, normalized to D65, which means that the standard
- * D65 illuminant (x=0.31271, y=0.32902, z=1-y-x) gives L=M=S under this transformation.
- * This makes sense because sRGB (which is used to derive those XYZ values
- * in the first place) assumes the D65 illuminant, and so the D65 illuminant
- * also gives R=G=B in sRGB.
+ * CIECAM02 chromatic adaptation, while related to the transformation we want,
+ * is a more complex phenomenon that depends on factors like the total luminance
+ * (in cd/m²) of the illuminant, and can no longer be implemented by just scaling
+ * each component in LMS space linearly. The simpler way out is to use the HPE matrix,
+ * which is intended to be close to the actual cone response; this results in
+ * the “von Kries transformation” when we couple it with normalization in LMS space.
+ *
+ * http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html compares
+ * von Kries transformation with using another matrix, the Bradford matrix,
+ * and generally finds that the Bradford method gives a better result,
+ * as in giving better matches with the true result (as calculated using
+ * spectral matching) when converting between various CIE illuminants.
+ * The actual perceptual differences were found to be minor, though.
+ * We use the Bradford tranformation matrix from that page, and compute the
+ * inverse ourselves. (The Bradford matrix is also used in CMCCAT97.)
+ *
+ * We normalize the Bradford fundamentals to D65, which means that the standard
+ * D65 illuminant (x=0.31271, y=0.32902, z=1-y-x) gives L=M=S under this
+ * transformation. This makes sense because sRGB (which is used to derive
+ * those XYZ values in the first place) assumes the D65 illuminant, and so the
+ * D65 illuminant also gives R=G=B in sRGB. (We could also have done this
+ * step separately in XYZ space, but we'd have to do it to all colors we
+ * wanted scaled to LMS.)