aboutsummaryrefslogtreecommitdiffstats
path: root/src/lcms.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lcms.c')
-rw-r--r--src/lcms.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lcms.c b/src/lcms.c
index 1f3ace3baac..cdfbc0ecf99 100644
--- a/src/lcms.c
+++ b/src/lcms.c
@@ -162,7 +162,7 @@ parse_xyz_list (Lisp_Object xyz_list, cmsCIEXYZ *color)
162 162
163DEFUN ("lcms-cam02-ucs", Flcms_cam02_ucs, Slcms_cam02_ucs, 2, 3, 0, 163DEFUN ("lcms-cam02-ucs", Flcms_cam02_ucs, Slcms_cam02_ucs, 2, 3, 0,
164 doc: /* Compute CAM02-UCS metric distance between COLOR1 and COLOR2. 164 doc: /* Compute CAM02-UCS metric distance between COLOR1 and COLOR2.
165Each color is a list of XYZ coordinates, with Y scaled to unity. 165Each color is a list of XYZ coordinates, with Y scaled about unity.
166Optional argument is the XYZ white point, which defaults to illuminant D65. */) 166Optional argument is the XYZ white point, which defaults to illuminant D65. */)
167 (Lisp_Object color1, Lisp_Object color2, Lisp_Object whitepoint) 167 (Lisp_Object color1, Lisp_Object color2, Lisp_Object whitepoint)
168{ 168{
@@ -186,15 +186,11 @@ Optional argument is the XYZ white point, which defaults to illuminant D65. */)
186 if (!(CONSP (color1) && parse_xyz_list (color1, &xyz1))) 186 if (!(CONSP (color1) && parse_xyz_list (color1, &xyz1)))
187 signal_error ("Invalid color", color1); 187 signal_error ("Invalid color", color1);
188 if (!(CONSP (color2) && parse_xyz_list (color2, &xyz2))) 188 if (!(CONSP (color2) && parse_xyz_list (color2, &xyz2)))
189 signal_error ("Invalid color", color1); 189 signal_error ("Invalid color", color2);
190 if (NILP (whitepoint)) 190 if (NILP (whitepoint))
191 { 191 parse_xyz_list (Vlcms_d65_xyz, &xyzw);
192 xyzw.X = 95.047;
193 xyzw.Y = 100.0;
194 xyzw.Z = 108.883;
195 }
196 else if (!(CONSP (whitepoint) && parse_xyz_list (whitepoint, &xyzw))) 192 else if (!(CONSP (whitepoint) && parse_xyz_list (whitepoint, &xyzw)))
197 signal_error("Invalid white point", whitepoint); 193 signal_error ("Invalid white point", whitepoint);
198 194
199 vc.whitePoint.X = xyzw.X; 195 vc.whitePoint.X = xyzw.X;
200 vc.whitePoint.Y = xyzw.Y; 196 vc.whitePoint.Y = xyzw.Y;
@@ -295,6 +291,12 @@ DEFUN ("lcms2-available-p", Flcms2_available_p, Slcms2_available_p, 0, 0, 0,
295void 291void
296syms_of_lcms2 (void) 292syms_of_lcms2 (void)
297{ 293{
294 DEFVAR_LISP ("lcms-d65-xyz", Vlcms_d65_xyz,
295 doc: /* D65 illuminant as a CIE XYZ triple. */);
296 Vlcms_d65_xyz = list3 (make_float (0.950455),
297 make_float (1.0),
298 make_float (1.088753));
299
298 defsubr (&Slcms_cie_de2000); 300 defsubr (&Slcms_cie_de2000);
299 defsubr (&Slcms_cam02_ucs); 301 defsubr (&Slcms_cam02_ucs);
300 defsubr (&Slcms2_available_p); 302 defsubr (&Slcms2_available_p);