Commit e868fbbf authored by Ulrich Sibiller's avatar Ulrich Sibiller

update xcms files to libX11 1.3.4

parent 27492905
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -55,8 +55,7 @@ ...@@ -55,8 +55,7 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsAddColorSpace(pCS) XcmsAddColorSpace(XcmsColorSpace *pCS)
XcmsColorSpace *pCS;
/* /*
* DESCRIPTION * DESCRIPTION
* DI Color Spaces are managed on a global basis. * DI Color Spaces are managed on a global basis.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -55,8 +55,7 @@ ...@@ -55,8 +55,7 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsAddFunctionSet(pNewFS) XcmsAddFunctionSet(XcmsFunctionSet *pNewFS)
XcmsFunctionSet *pNewFS;
/* /*
* DESCRIPTION * DESCRIPTION
* Additional Screen Color Characterization Function Sets are * Additional Screen Color Characterization Function Sets are
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -84,17 +84,16 @@ from The Open Group. ...@@ -84,17 +84,16 @@ from The Open Group.
* SYNOPSIS * SYNOPSIS
*/ */
XcmsCCC XcmsCCC
XcmsCreateCCC(dpy, screenNumber, visual, clientWhitePt, gamutCompProc, XcmsCreateCCC(
gamutCompClientData, whitePtAdjProc, whitePtAdjClientData) Display *dpy,
Display *dpy; int screenNumber,
int screenNumber; Visual *visual,
Visual *visual; XcmsColor *clientWhitePt,
XcmsColor *clientWhitePt; XcmsCompressionProc gamutCompProc,
XcmsCompressionProc gamutCompProc; XPointer gamutCompClientData,
XPointer gamutCompClientData; XcmsWhiteAdjustProc whitePtAdjProc,
XcmsWhiteAdjustProc whitePtAdjProc; XPointer whitePtAdjClientData)
XPointer whitePtAdjClientData;
/* /*
* DESCRIPTION * DESCRIPTION
* Given a Display, Screen, Visual, etc., this routine creates * Given a Display, Screen, Visual, etc., this routine creates
...@@ -114,7 +113,7 @@ XcmsCreateCCC(dpy, screenNumber, visual, clientWhitePt, gamutCompProc, ...@@ -114,7 +113,7 @@ XcmsCreateCCC(dpy, screenNumber, visual, clientWhitePt, gamutCompProc,
if (pDefaultCCC == NULL || if (pDefaultCCC == NULL ||
!(newccc = (XcmsCCC) Xcalloc(1, (unsigned) sizeof(XcmsCCCRec)))) { !(newccc = (XcmsCCC) Xcalloc(1, (unsigned) sizeof(XcmsCCCRec)))) {
return(NULL); return(NULL);
} }
/* /*
* Should inherit the following as result of a memmove(): * Should inherit the following as result of a memmove():
...@@ -171,10 +170,10 @@ XcmsCreateCCC(dpy, screenNumber, visual, clientWhitePt, gamutCompProc, ...@@ -171,10 +170,10 @@ XcmsCreateCCC(dpy, screenNumber, visual, clientWhitePt, gamutCompProc,
* *
* SYNOPSIS * SYNOPSIS
*/ */
XcmsCCC XcmsCCC
XcmsDefaultCCC(dpy, screenNumber) XcmsDefaultCCC(
Display *dpy; Display *dpy,
int screenNumber; int screenNumber)
/* /*
* DESCRIPTION * DESCRIPTION
* Given a Display and Screen, this routine creates * Given a Display and Screen, this routine creates
...@@ -254,8 +253,7 @@ XcmsDefaultCCC(dpy, screenNumber) ...@@ -254,8 +253,7 @@ XcmsDefaultCCC(dpy, screenNumber)
* SYNOPSIS * SYNOPSIS
*/ */
void void
XcmsFreeCCC(ccc) XcmsFreeCCC(XcmsCCC ccc)
XcmsCCC ccc;
/* /*
* DESCRIPTION * DESCRIPTION
* Frees memory associated with a Color Conversion Context * Frees memory associated with a Color Conversion Context
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -237,7 +237,7 @@ ConvertMixedColors( ...@@ -237,7 +237,7 @@ ConvertMixedColors(
* batches: * batches:
* DI to DD * DI to DD
* DD to DI(not CIEXYZ) * DD to DI(not CIEXYZ)
* *
* format_flag: * format_flag:
* 0x01 : convert Device-Dependent only specifications to the * 0x01 : convert Device-Dependent only specifications to the
* target format. * target format.
...@@ -419,7 +419,7 @@ _XcmsDIConvertColors( ...@@ -419,7 +419,7 @@ _XcmsDIConvertColors(
* 3. The calling routine may want to convert only between * 3. The calling routine may want to convert only between
* CIExyY <-> CIEXYZ <-> CIEuvY * CIExyY <-> CIEXYZ <-> CIEuvY
* therefore, this routine allows pWhitePt to equal NULL. * therefore, this routine allows pWhitePt to equal NULL.
* *
* *
* RETURNS * RETURNS
* XcmsFailure if failed, * XcmsFailure if failed,
...@@ -505,7 +505,7 @@ Continue: ...@@ -505,7 +505,7 @@ Continue:
* complementary, i.e., * complementary, i.e.,
* for an i, 0 <= i < n elements * for an i, 0 <= i < n elements
* from_CIEXYZ[i] is not the inverse of to_CIEXYZ[i] * from_CIEXYZ[i] is not the inverse of to_CIEXYZ[i]
* *
* Execute the functions all the way to CIEXYZ * Execute the functions all the way to CIEXYZ
*/ */
while (*src_to_CIEXYZ) { while (*src_to_CIEXYZ) {
...@@ -601,7 +601,7 @@ _XcmsDDConvertColors( ...@@ -601,7 +601,7 @@ _XcmsDDConvertColors(
/* /*
* Its ok if pColors_in_out->format == XcmsCIEXYZFormat * Its ok if pColors_in_out->format == XcmsCIEXYZFormat
* or * or
* if newFormat == XcmsCIEXYZFormat * if newFormat == XcmsCIEXYZFormat
*/ */
if ( !( ValidDDColorSpaceID(ccc, pColors_in_out->format) if ( !( ValidDDColorSpaceID(ccc, pColors_in_out->format)
...@@ -668,7 +668,7 @@ Continue: ...@@ -668,7 +668,7 @@ Continue:
* complementary, i.e., * complementary, i.e.,
* for an i, 0 <= i < n elements * for an i, 0 <= i < n elements
* from_CIEXYZ[i] is not the inverse of to_CIEXYZ[i] * from_CIEXYZ[i] is not the inverse of to_CIEXYZ[i]
* *
* Execute the functions all the way to CIEXYZ * Execute the functions all the way to CIEXYZ
*/ */
while (*src_to_CIEXYZ) { while (*src_to_CIEXYZ) {
...@@ -712,12 +712,12 @@ Continue: ...@@ -712,12 +712,12 @@ Continue:
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsConvertColors(ccc, pColors_in_out, nColors, targetFormat, pCompressed) XcmsConvertColors(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors,
XcmsColorFormat targetFormat; XcmsColorFormat targetFormat,
Bool *pCompressed; Bool *pCompressed)
/* /*
* DESCRIPTION * DESCRIPTION
* Convert XcmsColor structures to another format * Convert XcmsColor structures to another format
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. TekColor is a * of Xcms based on the TekColor Color Management System. TekColor is a
* trademark of Tektronix, Inc. The term "TekHVC" designates a particular * trademark of Tektronix, Inc. The term "TekHVC" designates a particular
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* foreign patents pending). Permission is hereby granted to use, copy, * foreign patents pending). Permission is hereby granted to use, copy,
* modify, sell, and otherwise distribute this software and its * modify, sell, and otherwise distribute this software and its
* documentation for any purpose and without fee, provided that: * documentation for any purpose and without fee, provided that:
* *
* 1. This copyright, permission, and disclaimer notice is reproduced in * 1. This copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and any modification thereof and in * all copies of this software and any modification thereof and in
* supporting documentation; * supporting documentation;
* 2. Any color-handling application which displays TekHVC color * 2. Any color-handling application which displays TekHVC color
* cooordinates identifies these as TekHVC color coordinates in any * cooordinates identifies these as TekHVC color coordinates in any
* interface that displays these coordinates and in any associated * interface that displays these coordinates and in any associated
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
* including those provided in this file and any equivalent pathways and * including those provided in this file and any equivalent pathways and
* mathematical derivations, regardless of digital (e.g., floating point * mathematical derivations, regardless of digital (e.g., floating point
* or integer) representation. * or integer) representation.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
/************************************************************************* /*************************************************************************
* Note: The DBL_EPSILON for ANSI is 1e-5 so my checks need to take * Note: The DBL_EPSILON for ANSI is 1e-5 so my checks need to take
* this into account. If your DBL_EPSILON is different then * this into account. If your DBL_EPSILON is different then
* adjust this define. * adjust this define.
* *
* Also note that EPS is the error factor in the calculations * Also note that EPS is the error factor in the calculations
* This may need to be the same as XMY_DBL_EPSILON in * This may need to be the same as XMY_DBL_EPSILON in
...@@ -198,7 +198,24 @@ TekHVC_ParseString( ...@@ -198,7 +198,24 @@ TekHVC_ParseString(
&pColor->spec.TekHVC.H, &pColor->spec.TekHVC.H,
&pColor->spec.TekHVC.V, &pColor->spec.TekHVC.V,
&pColor->spec.TekHVC.C) != 3) { &pColor->spec.TekHVC.C) != 3) {
return(XcmsFailure); char *s; /* Maybe failed due to locale */
int f;
if ((s = strdup(spec))) {
for (f = 0; s[f]; ++f)
if (s[f] == '.')
s[f] = ',';
else if (s[f] == ',')
s[f] = '.';
if (sscanf(s + n + 1, "%lf/%lf/%lf",
&pColor->spec.TekHVC.H,
&pColor->spec.TekHVC.V,
&pColor->spec.TekHVC.C) != 3) {
free(s);
return(XcmsFailure);
}
free(s);
} else
return(XcmsFailure);
} }
pColor->format = XcmsTekHVCFormat; pColor->format = XcmsTekHVCFormat;
pColor->pixel = 0; pColor->pixel = 0;
...@@ -299,7 +316,7 @@ XcmsTekHVC_ValidSpec( ...@@ -299,7 +316,7 @@ XcmsTekHVC_ValidSpec(
} }
while (pColor->spec.TekHVC.H >= 360.0) { while (pColor->spec.TekHVC.H >= 360.0) {
pColor->spec.TekHVC.H -= 360.0; pColor->spec.TekHVC.H -= 360.0;
} }
return(XcmsSuccess); return(XcmsSuccess);
} }
...@@ -310,11 +327,11 @@ XcmsTekHVC_ValidSpec( ...@@ -310,11 +327,11 @@ XcmsTekHVC_ValidSpec(
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsTekHVCToCIEuvY(ccc, pHVC_WhitePt, pColors_in_out, nColors) XcmsTekHVCToCIEuvY(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pHVC_WhitePt; XcmsColor *pHVC_WhitePt,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors)
/* /*
* DESCRIPTION * DESCRIPTION
* Transforms an array of TekHVC color specifications, given * Transforms an array of TekHVC color specifications, given
...@@ -396,9 +413,9 @@ XcmsTekHVCToCIEuvY(ccc, pHVC_WhitePt, pColors_in_out, nColors) ...@@ -396,9 +413,9 @@ XcmsTekHVCToCIEuvY(ccc, pHVC_WhitePt, pColors_in_out, nColors)
tempHue = radians(tempHue); tempHue = radians(tempHue);
/* Calculate u'v' for the obtained hue */ /* Calculate u'v' for the obtained hue */
u = (XcmsFloat) ((XCMS_COS(tempHue) * pColor->spec.TekHVC.C) / u = (XcmsFloat) ((XCMS_COS(tempHue) * pColor->spec.TekHVC.C) /
(pColor->spec.TekHVC.V * (double)CHROMA_SCALE_FACTOR)); (pColor->spec.TekHVC.V * (double)CHROMA_SCALE_FACTOR));
v = (XcmsFloat) ((XCMS_SIN(tempHue) * pColor->spec.TekHVC.C) / v = (XcmsFloat) ((XCMS_SIN(tempHue) * pColor->spec.TekHVC.C) /
(pColor->spec.TekHVC.V * (double)CHROMA_SCALE_FACTOR)); (pColor->spec.TekHVC.V * (double)CHROMA_SCALE_FACTOR));
/* Based on the white point get the offset from best red */ /* Based on the white point get the offset from best red */
...@@ -431,11 +448,11 @@ XcmsTekHVCToCIEuvY(ccc, pHVC_WhitePt, pColors_in_out, nColors) ...@@ -431,11 +448,11 @@ XcmsTekHVCToCIEuvY(ccc, pHVC_WhitePt, pColors_in_out, nColors)
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIEuvYToTekHVC(ccc, pHVC_WhitePt, pColors_in_out, nColors) XcmsCIEuvYToTekHVC(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pHVC_WhitePt; XcmsColor *pHVC_WhitePt,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors)
/* /*
* DESCRIPTION * DESCRIPTION
* Transforms an array of CIECIEuvY.color specifications, given * Transforms an array of CIECIEuvY.color specifications, given
...@@ -603,6 +620,6 @@ _XcmsTekHVC_CheckModify( ...@@ -603,6 +620,6 @@ _XcmsTekHVC_CheckModify(
} else if (pColor->spec.TekHVC.H >= 360.0) { } else if (pColor->spec.TekHVC.H >= 360.0) {
n = pColor->spec.TekHVC.H / 360.0; n = pColor->spec.TekHVC.H / 360.0;
pColor->spec.TekHVC.H -= n * 360.0; pColor->spec.TekHVC.H -= n * 360.0;
} }
return(1); return(1);
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. TekColor is a * of Xcms based on the TekColor Color Management System. TekColor is a
* trademark of Tektronix, Inc. The term "TekHVC" designates a particular * trademark of Tektronix, Inc. The term "TekHVC" designates a particular
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* foreign patents pending). Permission is hereby granted to use, copy, * foreign patents pending). Permission is hereby granted to use, copy,
* modify, sell, and otherwise distribute this software and its * modify, sell, and otherwise distribute this software and its
* documentation for any purpose and without fee, provided that: * documentation for any purpose and without fee, provided that:
* *
* 1. This copyright, permission, and disclaimer notice is reproduced in * 1. This copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and any modification thereof and in * all copies of this software and any modification thereof and in
* supporting documentation; * supporting documentation;
* 2. Any color-handling application which displays TekHVC color * 2. Any color-handling application which displays TekHVC color
* cooordinates identifies these as TekHVC color coordinates in any * cooordinates identifies these as TekHVC color coordinates in any
* interface that displays these coordinates and in any associated * interface that displays these coordinates and in any associated
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
* including those provided in this file and any equivalent pathways and * including those provided in this file and any equivalent pathways and
* mathematical derivations, regardless of digital (e.g., floating point * mathematical derivations, regardless of digital (e.g., floating point
* or integer) representation. * or integer) representation.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -65,20 +65,20 @@ ...@@ -65,20 +65,20 @@
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsTekHVCClipC (ccc, pColors_in_out, nColors, i, pCompressed) XcmsTekHVCClipC (
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors,
unsigned int i; unsigned int i,
Bool *pCompressed; Bool *pCompressed)
/* /*
* DESCRIPTION * DESCRIPTION
* Reduce the Chroma for a specific hue and value to * Reduce the Chroma for a specific hue and value to
* to bring the given color into the gamut of the * to bring the given color into the gamut of the
* specified device. As required of gamut compression * specified device. As required of gamut compression
* functions in Xcms, this routine returns pColor_in_out * functions in Xcms, this routine returns pColor_in_out
* in XcmsCIEXYZFormat on successful completion. * in XcmsCIEXYZFormat on successful completion.
* *
* Since this routine works with the value within * Since this routine works with the value within
* pColor_in_out intermediate results may be returned * pColor_in_out intermediate results may be returned
* even though it may be invalid. * even though it may be invalid.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. TekColor is a * of Xcms based on the TekColor Color Management System. TekColor is a
* trademark of Tektronix, Inc. The term "TekHVC" designates a particular * trademark of Tektronix, Inc. The term "TekHVC" designates a particular
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* foreign patents pending). Permission is hereby granted to use, copy, * foreign patents pending). Permission is hereby granted to use, copy,
* modify, sell, and otherwise distribute this software and its * modify, sell, and otherwise distribute this software and its
* documentation for any purpose and without fee, provided that: * documentation for any purpose and without fee, provided that:
* *
* 1. This copyright, permission, and disclaimer notice is reproduced in * 1. This copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and any modification thereof and in * all copies of this software and any modification thereof and in
* supporting documentation; * supporting documentation;
* 2. Any color-handling application which displays TekHVC color * 2. Any color-handling application which displays TekHVC color
* cooordinates identifies these as TekHVC color coordinates in any * cooordinates identifies these as TekHVC color coordinates in any
* interface that displays these coordinates and in any associated * interface that displays these coordinates and in any associated
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
* including those provided in this file and any equivalent pathways and * including those provided in this file and any equivalent pathways and
* mathematical derivations, regardless of digital (e.g., floating point * mathematical derivations, regardless of digital (e.g., floating point
* or integer) representation. * or integer) representation.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -65,16 +65,16 @@ ...@@ -65,16 +65,16 @@
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsTekHVCClipV (ccc, pColors_in_out, nColors, i, pCompressed) XcmsTekHVCClipV (
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors,
unsigned int i; unsigned int i,
Bool *pCompressed; Bool *pCompressed)
/* /*
* DESCRIPTION * DESCRIPTION
* Return the closest value for a specific hue and chroma. * Return the closest value for a specific hue and chroma.
* This routine takes any color as input and outputs * This routine takes any color as input and outputs
* a CIE XYZ color. * a CIE XYZ color.
* *
* Since this routine works with the value within * Since this routine works with the value within
...@@ -114,7 +114,7 @@ XcmsTekHVCClipV (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -114,7 +114,7 @@ XcmsTekHVCClipV (ccc, pColors_in_out, nColors, i, pCompressed)
*/ */
pColor = pColors_in_out + i; pColor = pColors_in_out + i;
if (ccc->visual->class < StaticColor && if (ccc->visual->class < StaticColor &&
FunctionSetOfCCC(ccc) != (XPointer) &XcmsLinearRGBFunctionSet) { FunctionSetOfCCC(ccc) != (XPointer) &XcmsLinearRGBFunctionSet) {
/* /*
...@@ -162,7 +162,7 @@ XcmsTekHVCClipV (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -162,7 +162,7 @@ XcmsTekHVCClipV (ccc, pColors_in_out, nColors, i, pCompressed)
/* When the value input is less than the maximum value point */ /* When the value input is less than the maximum value point */
/* compute the intersection of the line from 0,0 to max_V, max_C */ /* compute the intersection of the line from 0,0 to max_V, max_C */
/* using the chroma input. */ /* using the chroma input. */
pColor->spec.TekHVC.V = pColor->spec.TekHVC.C * pColor->spec.TekHVC.V = pColor->spec.TekHVC.C *
hvc_max.spec.TekHVC.V / hvc_max.spec.TekHVC.C; hvc_max.spec.TekHVC.V / hvc_max.spec.TekHVC.C;
if (pColor->spec.TekHVC.V >= hvc_max.spec.TekHVC.V) { if (pColor->spec.TekHVC.V >= hvc_max.spec.TekHVC.V) {
pColor->spec.TekHVC.C = hvc_max.spec.TekHVC.C; pColor->spec.TekHVC.C = hvc_max.spec.TekHVC.C;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. TekColor is a * of Xcms based on the TekColor Color Management System. TekColor is a
* trademark of Tektronix, Inc. The term "TekHVC" designates a particular * trademark of Tektronix, Inc. The term "TekHVC" designates a particular
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* foreign patents pending). Permission is hereby granted to use, copy, * foreign patents pending). Permission is hereby granted to use, copy,
* modify, sell, and otherwise distribute this software and its * modify, sell, and otherwise distribute this software and its
* documentation for any purpose and without fee, provided that: * documentation for any purpose and without fee, provided that:
* *
* 1. This copyright, permission, and disclaimer notice is reproduced in * 1. This copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and any modification thereof and in * all copies of this software and any modification thereof and in
* supporting documentation; * supporting documentation;
* 2. Any color-handling application which displays TekHVC color * 2. Any color-handling application which displays TekHVC color
* cooordinates identifies these as TekHVC color coordinates in any * cooordinates identifies these as TekHVC color coordinates in any
* interface that displays these coordinates and in any associated * interface that displays these coordinates and in any associated
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
* including those provided in this file and any equivalent pathways and * including those provided in this file and any equivalent pathways and
* mathematical derivations, regardless of digital (e.g., floating point * mathematical derivations, regardless of digital (e.g., floating point
* or integer) representation. * or integer) representation.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -73,15 +73,15 @@ ...@@ -73,15 +73,15 @@
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsTekHVCClipVC (ccc, pColors_in_out, nColors, i, pCompressed) XcmsTekHVCClipVC (
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors,
unsigned int i; unsigned int i,
Bool *pCompressed; Bool *pCompressed)
/* /*
* DESCRIPTION * DESCRIPTION
* This routine will find the closest value and chroma * This routine will find the closest value and chroma
* for a specific hue. The color input is converted to * for a specific hue. The color input is converted to
* HVC format and returned as CIE XYZ format. * HVC format and returned as CIE XYZ format.
* *
...@@ -174,7 +174,7 @@ XcmsTekHVCClipVC (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -174,7 +174,7 @@ XcmsTekHVCClipVC (ccc, pColors_in_out, nColors, i, pCompressed)
/* the value and chroma given and the line from 0,0 and hvc_max. */ /* the value and chroma given and the line from 0,0 and hvc_max. */
Chroma = pColor->spec.TekHVC.C; Chroma = pColor->spec.TekHVC.C;
Value = pColor->spec.TekHVC.V; Value = pColor->spec.TekHVC.V;
pColor->spec.TekHVC.C = pColor->spec.TekHVC.C =
(Value + (hvc_max.spec.TekHVC.C / hvc_max.spec.TekHVC.V * Chroma)) / (Value + (hvc_max.spec.TekHVC.C / hvc_max.spec.TekHVC.V * Chroma)) /
((hvc_max.spec.TekHVC.V / hvc_max.spec.TekHVC.C) + ((hvc_max.spec.TekHVC.V / hvc_max.spec.TekHVC.C) +
(hvc_max.spec.TekHVC.C / hvc_max.spec.TekHVC.V)); (hvc_max.spec.TekHVC.C / hvc_max.spec.TekHVC.V));
...@@ -221,7 +221,7 @@ XcmsTekHVCClipVC (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -221,7 +221,7 @@ XcmsTekHVCClipVC (ccc, pColors_in_out, nColors, i, pCompressed)
if (!_XcmsTekHVC_CheckModify(pColor)) { if (!_XcmsTekHVC_CheckModify(pColor)) {
return (XcmsFailure); return (XcmsFailure);
} }
tmpDist = (XcmsFloat) XCMS_SQRT ((double) tmpDist = (XcmsFloat) XCMS_SQRT ((double)
(((Chroma - pColor->spec.TekHVC.C) * (((Chroma - pColor->spec.TekHVC.C) *
(Chroma - pColor->spec.TekHVC.C)) + (Chroma - pColor->spec.TekHVC.C)) +
((Value - pColor->spec.TekHVC.V) * ((Value - pColor->spec.TekHVC.V) *
...@@ -233,7 +233,7 @@ XcmsTekHVCClipVC (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -233,7 +233,7 @@ XcmsTekHVCClipVC (ccc, pColors_in_out, nColors, i, pCompressed)
nI = (nMaxCount + nI) / 2; nI = (nMaxCount + nI) / 2;
saveDist = tmpDist; saveDist = tmpDist;
bestValue = pColor->spec.TekHVC.V; bestValue = pColor->spec.TekHVC.V;
bestChroma = pColor->spec.TekHVC.C; bestChroma = pColor->spec.TekHVC.C;
} }
if (nI == nILast || nI == 0) { if (nI == nILast || nI == 0) {
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. TekColor is a * of Xcms based on the TekColor Color Management System. TekColor is a
* trademark of Tektronix, Inc. The term "TekHVC" designates a particular * trademark of Tektronix, Inc. The term "TekHVC" designates a particular
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* foreign patents pending). Permission is hereby granted to use, copy, * foreign patents pending). Permission is hereby granted to use, copy,
* modify, sell, and otherwise distribute this software and its * modify, sell, and otherwise distribute this software and its
* documentation for any purpose and without fee, provided that: * documentation for any purpose and without fee, provided that:
* *
* 1. This copyright, permission, and disclaimer notice is reproduced in * 1. This copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and any modification thereof and in * all copies of this software and any modification thereof and in
* supporting documentation; * supporting documentation;
* 2. Any color-handling application which displays TekHVC color * 2. Any color-handling application which displays TekHVC color
* cooordinates identifies these as TekHVC color coordinates in any * cooordinates identifies these as TekHVC color coordinates in any
* interface that displays these coordinates and in any associated * interface that displays these coordinates and in any associated
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
* including those provided in this file and any equivalent pathways and * including those provided in this file and any equivalent pathways and
* mathematical derivations, regardless of digital (e.g., floating point * mathematical derivations, regardless of digital (e.g., floating point
* or integer) representation. * or integer) representation.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -69,11 +69,11 @@ ...@@ -69,11 +69,11 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsTekHVCQueryMinV (ccc, hue, chroma, pColor_return) XcmsTekHVCQueryMinV (
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue; XcmsFloat hue,
XcmsFloat chroma; XcmsFloat chroma,
XcmsColor *pColor_return; XcmsColor *pColor_return)
/* /*
* DESCRIPTION * DESCRIPTION
...@@ -95,7 +95,7 @@ XcmsTekHVCQueryMinV (ccc, hue, chroma, pColor_return) ...@@ -95,7 +95,7 @@ XcmsTekHVCQueryMinV (ccc, hue, chroma, pColor_return)
* XcmsFailure - Failure * XcmsFailure - Failure
* XcmsSuccess - Succeeded with no modifications * XcmsSuccess - Succeeded with no modifications
* *
*/ */
{ {
XcmsCCCRec myCCC; XcmsCCCRec myCCC;
XcmsColor tmp; XcmsColor tmp;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. TekColor is a * of Xcms based on the TekColor Color Management System. TekColor is a
* trademark of Tektronix, Inc. The term "TekHVC" designates a particular * trademark of Tektronix, Inc. The term "TekHVC" designates a particular
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* foreign patents pending). Permission is hereby granted to use, copy, * foreign patents pending). Permission is hereby granted to use, copy,
* modify, sell, and otherwise distribute this software and its * modify, sell, and otherwise distribute this software and its
* documentation for any purpose and without fee, provided that: * documentation for any purpose and without fee, provided that:
* *
* 1. This copyright, permission, and disclaimer notice is reproduced in * 1. This copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and any modification thereof and in * all copies of this software and any modification thereof and in
* supporting documentation; * supporting documentation;
* 2. Any color-handling application which displays TekHVC color * 2. Any color-handling application which displays TekHVC color
* cooordinates identifies these as TekHVC color coordinates in any * cooordinates identifies these as TekHVC color coordinates in any
* interface that displays these coordinates and in any associated * interface that displays these coordinates and in any associated
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
* including those provided in this file and any equivalent pathways and * including those provided in this file and any equivalent pathways and
* mathematical derivations, regardless of digital (e.g., floating point * mathematical derivations, regardless of digital (e.g., floating point
* or integer) representation. * or integer) representation.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -72,11 +72,11 @@ ...@@ -72,11 +72,11 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsTekHVCQueryMaxC(ccc, hue, value, pColor_return) XcmsTekHVCQueryMaxC(
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue; XcmsFloat hue,
XcmsFloat value; XcmsFloat value,
XcmsColor *pColor_return; XcmsColor *pColor_return)
/* /*
* DESCRIPTION * DESCRIPTION
* Return the maximum chroma for a specific hue and value. * Return the maximum chroma for a specific hue and value.
...@@ -210,7 +210,7 @@ XcmsTekHVCQueryMaxC(ccc, hue, value, pColor_return) ...@@ -210,7 +210,7 @@ XcmsTekHVCQueryMaxC(ccc, hue, value, pColor_return)
if (ftmp1 < ftmp2) { if (ftmp1 < ftmp2) {
tmp.spec.TekHVC.V = lastValue; tmp.spec.TekHVC.V = lastValue;
tmp.spec.TekHVC.C = lastChroma; tmp.spec.TekHVC.C = lastChroma;
} }
if (_XcmsTekHVC_CheckModify (&tmp)) { if (_XcmsTekHVC_CheckModify (&tmp)) {
memcpy((char *)pColor_return, (char *)&tmp, sizeof(XcmsColor)); memcpy((char *)pColor_return, (char *)&tmp, sizeof(XcmsColor));
return(XcmsSuccess); return(XcmsSuccess);
...@@ -235,7 +235,7 @@ XcmsTekHVCQueryMaxC(ccc, hue, value, pColor_return) ...@@ -235,7 +235,7 @@ XcmsTekHVCQueryMaxC(ccc, hue, value, pColor_return)
tmp.spec.TekHVC.C = lastChroma; tmp.spec.TekHVC.C = lastChroma;
} }
} }
} }
/* make sure to return the input hue */ /* make sure to return the input hue */
tmp.spec.TekHVC.H = hue; tmp.spec.TekHVC.H = hue;
memcpy((char *)pColor_return, (char *)&tmp, sizeof(XcmsColor)); memcpy((char *)pColor_return, (char *)&tmp, sizeof(XcmsColor));
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. TekColor is a * of Xcms based on the TekColor Color Management System. TekColor is a
* trademark of Tektronix, Inc. The term "TekHVC" designates a particular * trademark of Tektronix, Inc. The term "TekHVC" designates a particular
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* foreign patents pending). Permission is hereby granted to use, copy, * foreign patents pending). Permission is hereby granted to use, copy,
* modify, sell, and otherwise distribute this software and its * modify, sell, and otherwise distribute this software and its
* documentation for any purpose and without fee, provided that: * documentation for any purpose and without fee, provided that:
* *
* 1. This copyright, permission, and disclaimer notice is reproduced in * 1. This copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and any modification thereof and in * all copies of this software and any modification thereof and in
* supporting documentation; * supporting documentation;
* 2. Any color-handling application which displays TekHVC color * 2. Any color-handling application which displays TekHVC color
* cooordinates identifies these as TekHVC color coordinates in any * cooordinates identifies these as TekHVC color coordinates in any
* interface that displays these coordinates and in any associated * interface that displays these coordinates and in any associated
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
* including those provided in this file and any equivalent pathways and * including those provided in this file and any equivalent pathways and
* mathematical derivations, regardless of digital (e.g., floating point * mathematical derivations, regardless of digital (e.g., floating point
* or integer) representation. * or integer) representation.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -72,11 +72,11 @@ ...@@ -72,11 +72,11 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsTekHVCQueryMaxV(ccc, hue, chroma, pColor_return) XcmsTekHVCQueryMaxV(
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue; XcmsFloat hue,
XcmsFloat chroma; XcmsFloat chroma,
XcmsColor *pColor_return; XcmsColor *pColor_return)
/* /*
* DESCRIPTION * DESCRIPTION
* Return the maximum value for a specified hue and chroma. * Return the maximum value for a specified hue and chroma.
...@@ -142,7 +142,7 @@ XcmsTekHVCQueryMaxV(ccc, hue, chroma, pColor_return) ...@@ -142,7 +142,7 @@ XcmsTekHVCQueryMaxV(ccc, hue, chroma, pColor_return)
if (max_vc.spec.TekHVC.C < tmp.spec.TekHVC.C) { if (max_vc.spec.TekHVC.C < tmp.spec.TekHVC.C) {
/* /*
* If the chroma is greater than the chroma for the * If the chroma is greater than the chroma for the
* maximum value/chroma point then the value is the * maximum value/chroma point then the value is the
* the value for the maximum value, chroma point. * the value for the maximum value, chroma point.
* This is an error but it I return the best approximation I can. * This is an error but it I return the best approximation I can.
...@@ -154,7 +154,7 @@ XcmsTekHVCQueryMaxV(ccc, hue, chroma, pColor_return) ...@@ -154,7 +154,7 @@ XcmsTekHVCQueryMaxV(ccc, hue, chroma, pColor_return)
return(XcmsSuccess); return(XcmsSuccess);
} else if (max_vc.spec.TekHVC.C == tmp.spec.TekHVC.C) { } else if (max_vc.spec.TekHVC.C == tmp.spec.TekHVC.C) {
/* /*
* If the chroma is equal to the chroma for the * If the chroma is equal to the chroma for the
* maximum value/chroma point then the value is the * maximum value/chroma point then the value is the
* the value for the maximum value, chroma point. * the value for the maximum value, chroma point.
*/ */
...@@ -196,7 +196,7 @@ XcmsTekHVCQueryMaxV(ccc, hue, chroma, pColor_return) ...@@ -196,7 +196,7 @@ XcmsTekHVCQueryMaxV(ccc, hue, chroma, pColor_return)
tmp.spec.TekHVC.H = hue; /* use the saved hue */ tmp.spec.TekHVC.H = hue; /* use the saved hue */
memcpy ((char *) pColor_return, (char *) &tmp, sizeof (XcmsColor)); memcpy ((char *) pColor_return, (char *) &tmp, sizeof (XcmsColor));
return(XcmsSuccess); return(XcmsSuccess);
} }
nChroma += savedChroma - tmp.spec.TekHVC.C; nChroma += savedChroma - tmp.spec.TekHVC.C;
if (nChroma > max_vc.spec.TekHVC.C) { if (nChroma > max_vc.spec.TekHVC.C) {
nChroma = max_vc.spec.TekHVC.C; nChroma = max_vc.spec.TekHVC.C;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. TekColor is a * of Xcms based on the TekColor Color Management System. TekColor is a
* trademark of Tektronix, Inc. The term "TekHVC" designates a particular * trademark of Tektronix, Inc. The term "TekHVC" designates a particular
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* foreign patents pending). Permission is hereby granted to use, copy, * foreign patents pending). Permission is hereby granted to use, copy,
* modify, sell, and otherwise distribute this software and its * modify, sell, and otherwise distribute this software and its
* documentation for any purpose and without fee, provided that: * documentation for any purpose and without fee, provided that:
* *
* 1. This copyright, permission, and disclaimer notice is reproduced in * 1. This copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and any modification thereof and in * all copies of this software and any modification thereof and in
* supporting documentation; * supporting documentation;
* 2. Any color-handling application which displays TekHVC color * 2. Any color-handling application which displays TekHVC color
* cooordinates identifies these as TekHVC color coordinates in any * cooordinates identifies these as TekHVC color coordinates in any
* interface that displays these coordinates and in any associated * interface that displays these coordinates and in any associated
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
* including those provided in this file and any equivalent pathways and * including those provided in this file and any equivalent pathways and
* mathematical derivations, regardless of digital (e.g., floating point * mathematical derivations, regardless of digital (e.g., floating point
* or integer) representation. * or integer) representation.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -102,7 +102,7 @@ _XcmsTekHVCQueryMaxVCRGB( ...@@ -102,7 +102,7 @@ _XcmsTekHVCQueryMaxVCRGB(
* XcmsFailure - Failure * XcmsFailure - Failure
* XCMS_SUCCUSS - Succeeded * XCMS_SUCCUSS - Succeeded
* *
*/ */
{ {
XcmsFloat nSmall, nLarge; XcmsFloat nSmall, nLarge;
XcmsColor tmp; XcmsColor tmp;
...@@ -122,14 +122,14 @@ _XcmsTekHVCQueryMaxVCRGB( ...@@ -122,14 +122,14 @@ _XcmsTekHVCQueryMaxVCRGB(
* is NULL. * is NULL.
*/ */
if ((_XcmsConvertColorsWithWhitePt(ccc, &tmp, if ((_XcmsConvertColorsWithWhitePt(ccc, &tmp,
&ccc->pPerScrnInfo->screenWhitePt, 1, XcmsRGBiFormat, (Bool *) NULL) &ccc->pPerScrnInfo->screenWhitePt, 1, XcmsRGBiFormat, (Bool *) NULL)
== XcmsFailure) && tmp.format != XcmsRGBiFormat) { == XcmsFailure) && tmp.format != XcmsRGBiFormat) {
return (XcmsFailure); return (XcmsFailure);
} }
/* Now pick the smallest RGB */ /* Now pick the smallest RGB */
nSmall = MIN3(tmp.spec.RGBi.red, nSmall = MIN3(tmp.spec.RGBi.red,
tmp.spec.RGBi.green, tmp.spec.RGBi.green,
tmp.spec.RGBi.blue); tmp.spec.RGBi.blue);
/* Make the smallest RGB equal to zero */ /* Make the smallest RGB equal to zero */
tmp.spec.RGBi.red -= nSmall; tmp.spec.RGBi.red -= nSmall;
...@@ -137,8 +137,8 @@ _XcmsTekHVCQueryMaxVCRGB( ...@@ -137,8 +137,8 @@ _XcmsTekHVCQueryMaxVCRGB(
tmp.spec.RGBi.blue -= nSmall; tmp.spec.RGBi.blue -= nSmall;
/* Now pick the largest RGB */ /* Now pick the largest RGB */
nLarge = MAX3(tmp.spec.RGBi.red, nLarge = MAX3(tmp.spec.RGBi.red,
tmp.spec.RGBi.green, tmp.spec.RGBi.green,
tmp.spec.RGBi.blue); tmp.spec.RGBi.blue);
/* Scale the RGB values based on the largest one */ /* Scale the RGB values based on the largest one */
tmp.spec.RGBi.red /= nLarge; tmp.spec.RGBi.red /= nLarge;
...@@ -155,7 +155,7 @@ _XcmsTekHVCQueryMaxVCRGB( ...@@ -155,7 +155,7 @@ _XcmsTekHVCQueryMaxVCRGB(
/* Convert from RGBi to HVC */ /* Convert from RGBi to HVC */
if (_XcmsConvertColorsWithWhitePt(ccc, &tmp, if (_XcmsConvertColorsWithWhitePt(ccc, &tmp,
&ccc->pPerScrnInfo->screenWhitePt, 1, XcmsTekHVCFormat, (Bool *) NULL) &ccc->pPerScrnInfo->screenWhitePt, 1, XcmsTekHVCFormat, (Bool *) NULL)
== XcmsFailure) { == XcmsFailure) {
return (XcmsFailure); return (XcmsFailure);
} }
...@@ -163,7 +163,7 @@ _XcmsTekHVCQueryMaxVCRGB( ...@@ -163,7 +163,7 @@ _XcmsTekHVCQueryMaxVCRGB(
/* make sure to return the input hue */ /* make sure to return the input hue */
tmp.spec.TekHVC.H = hue; tmp.spec.TekHVC.H = hue;
memcpy((char *)pColor_return, (char *)&tmp, sizeof(XcmsColor)); memcpy((char *)pColor_return, (char *)&tmp, sizeof(XcmsColor));
return (XcmsSuccess); return (XcmsSuccess);
} }
...@@ -180,10 +180,10 @@ _XcmsTekHVCQueryMaxVCRGB( ...@@ -180,10 +180,10 @@ _XcmsTekHVCQueryMaxVCRGB(
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsTekHVCQueryMaxVC (ccc, hue, pColor_return) XcmsTekHVCQueryMaxVC (
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue; XcmsFloat hue,
XcmsColor *pColor_return; XcmsColor *pColor_return)
/* /*
* DESCRIPTION * DESCRIPTION
...@@ -200,7 +200,7 @@ XcmsTekHVCQueryMaxVC (ccc, hue, pColor_return) ...@@ -200,7 +200,7 @@ XcmsTekHVCQueryMaxVC (ccc, hue, pColor_return)
* XcmsFailure - Failure * XcmsFailure - Failure
* XcmsSuccess - Succeeded * XcmsSuccess - Succeeded
* *
*/ */
{ {
XcmsCCCRec myCCC; XcmsCCCRec myCCC;
...@@ -217,7 +217,7 @@ XcmsTekHVCQueryMaxVC (ccc, hue, pColor_return) ...@@ -217,7 +217,7 @@ XcmsTekHVCQueryMaxVC (ccc, hue, pColor_return)
if (XcmsAddColorSpace(&XcmsTekHVCColorSpace) == XcmsFailure) { if (XcmsAddColorSpace(&XcmsTekHVCColorSpace) == XcmsFailure) {
return(XcmsFailure); return(XcmsFailure);
} }
/* Use my own CCC */ /* Use my own CCC */
memcpy ((char *)&myCCC, (char *)ccc, sizeof(XcmsCCCRec)); memcpy ((char *)&myCCC, (char *)ccc, sizeof(XcmsCCCRec));
myCCC.clientWhitePt.format = XcmsUndefinedFormat; myCCC.clientWhitePt.format = XcmsUndefinedFormat;
...@@ -228,8 +228,8 @@ XcmsTekHVCQueryMaxVC (ccc, hue, pColor_return) ...@@ -228,8 +228,8 @@ XcmsTekHVCQueryMaxVC (ccc, hue, pColor_return)
} }
while (hue >= 360.0) { while (hue >= 360.0) {
hue -= 360.0; hue -= 360.0;
} }
return(_XcmsTekHVCQueryMaxVCRGB (&myCCC, hue, pColor_return, return(_XcmsTekHVCQueryMaxVCRGB (&myCCC, hue, pColor_return,
(XcmsRGBi *)NULL)); (XcmsRGBi *)NULL));
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. TekColor is a * of Xcms based on the TekColor Color Management System. TekColor is a
* trademark of Tektronix, Inc. The term "TekHVC" designates a particular * trademark of Tektronix, Inc. The term "TekHVC" designates a particular
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* foreign patents pending). Permission is hereby granted to use, copy, * foreign patents pending). Permission is hereby granted to use, copy,
* modify, sell, and otherwise distribute this software and its * modify, sell, and otherwise distribute this software and its
* documentation for any purpose and without fee, provided that: * documentation for any purpose and without fee, provided that:
* *
* 1. This copyright, permission, and disclaimer notice is reproduced in * 1. This copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and any modification thereof and in * all copies of this software and any modification thereof and in
* supporting documentation; * supporting documentation;
* 2. Any color-handling application which displays TekHVC color * 2. Any color-handling application which displays TekHVC color
* cooordinates identifies these as TekHVC color coordinates in any * cooordinates identifies these as TekHVC color coordinates in any
* interface that displays these coordinates and in any associated * interface that displays these coordinates and in any associated
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
* including those provided in this file and any equivalent pathways and * including those provided in this file and any equivalent pathways and
* mathematical derivations, regardless of digital (e.g., floating point * mathematical derivations, regardless of digital (e.g., floating point
* or integer) representation. * or integer) representation.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -65,16 +65,16 @@ ...@@ -65,16 +65,16 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsTekHVCQueryMaxVSamples(ccc, hue, pColor_in_out, nSamples) XcmsTekHVCQueryMaxVSamples(
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue; XcmsFloat hue,
XcmsColor *pColor_in_out; XcmsColor *pColor_in_out,
unsigned int nSamples; unsigned int nSamples)
/* /*
* DESCRIPTION * DESCRIPTION
* Return a set of values and chromas for the input Hue. * Return a set of values and chromas for the input Hue.
* This routine will take any color as input. * This routine will take any color as input.
* It returns TekHVC colors. * It returns TekHVC colors.
* *
* Since this routine works with the value within * Since this routine works with the value within
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. TekColor is a * of Xcms based on the TekColor Color Management System. TekColor is a
* trademark of Tektronix, Inc. The term "TekHVC" designates a particular * trademark of Tektronix, Inc. The term "TekHVC" designates a particular
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* foreign patents pending). Permission is hereby granted to use, copy, * foreign patents pending). Permission is hereby granted to use, copy,
* modify, sell, and otherwise distribute this software and its * modify, sell, and otherwise distribute this software and its
* documentation for any purpose and without fee, provided that: * documentation for any purpose and without fee, provided that:
* *
* 1. This copyright, permission, and disclaimer notice is reproduced in * 1. This copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and any modification thereof and in * all copies of this software and any modification thereof and in
* supporting documentation; * supporting documentation;
* 2. Any color-handling application which displays TekHVC color * 2. Any color-handling application which displays TekHVC color
* cooordinates identifies these as TekHVC color coordinates in any * cooordinates identifies these as TekHVC color coordinates in any
* interface that displays these coordinates and in any associated * interface that displays these coordinates and in any associated
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
* including those provided in this file and any equivalent pathways and * including those provided in this file and any equivalent pathways and
* mathematical derivations, regardless of digital (e.g., floating point * mathematical derivations, regardless of digital (e.g., floating point
* or integer) representation. * or integer) representation.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -65,15 +65,14 @@ ...@@ -65,15 +65,14 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsTekHVCWhiteShiftColors(ccc, pWhitePtFrom, pWhitePtTo, destSpecFmt, XcmsTekHVCWhiteShiftColors(
pColors_in_out, nColors, pCompressed) XcmsCCC ccc,
XcmsCCC ccc; XcmsColor *pWhitePtFrom,
XcmsColor *pWhitePtFrom; XcmsColor *pWhitePtTo,
XcmsColor *pWhitePtTo; XcmsColorFormat destSpecFmt,
XcmsColorFormat destSpecFmt; XcmsColor *pColors_in_out,
XcmsColor *pColors_in_out; unsigned int nColors,
unsigned int nColors; Bool *pCompressed)
Bool *pCompressed;
/* /*
* DESCRIPTION * DESCRIPTION
* Convert color specifications in an array of XcmsColor structures * Convert color specifications in an array of XcmsColor structures
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -47,8 +47,7 @@ ...@@ -47,8 +47,7 @@
* SYNOPSIS * SYNOPSIS
*/ */
XcmsColorFormat XcmsColorFormat
XcmsFormatOfPrefix(prefix) XcmsFormatOfPrefix(char *prefix)
char *prefix;
/* /*
* DESCRIPTION * DESCRIPTION
* Returns the Color Space ID for the specified prefix * Returns the Color Space ID for the specified prefix
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -187,7 +187,7 @@ XcmsColorSpace XcmsRGBColorSpace = ...@@ -187,7 +187,7 @@ XcmsColorSpace XcmsRGBColorSpace =
}; };
/* /*
* Device-Independent Color Spaces known to the * Device-Independent Color Spaces known to the
* LINEAR_RGB Screen Color Characteristics Function Set. * LINEAR_RGB Screen Color Characteristics Function Set.
*/ */
static XcmsColorSpace *DDColorSpaces[] = { static XcmsColorSpace *DDColorSpaces[] = {
...@@ -481,17 +481,17 @@ LINEAR_RGB_InitSCCData( ...@@ -481,17 +481,17 @@ LINEAR_RGB_InitSCCData(
/* /*
* Allocate memory for pScreenData * Allocate memory for pScreenData
*/ */
if (!(pScreenData = pScreenDefaultData = (LINEAR_RGB_SCCData *) if (!(pScreenData = pScreenDefaultData = (LINEAR_RGB_SCCData *)
Xcalloc (1, sizeof(LINEAR_RGB_SCCData)))) { Xcalloc (1, sizeof(LINEAR_RGB_SCCData)))) {
return(XcmsFailure); return(XcmsFailure);
} }
/* /*
* 1. Get the XYZ->RGB and RGB->XYZ matrices * 1. Get the XYZ->RGB and RGB->XYZ matrices
*/ */
if (MatrixAtom == None || if (MatrixAtom == None ||
!_XcmsGetProperty (dpy, RootWindow(dpy, screenNumber), MatrixAtom, !_XcmsGetProperty (dpy, RootWindow(dpy, screenNumber), MatrixAtom,
&format_return, &nitems, &nbytes_return, &property_return) || &format_return, &nitems, &nbytes_return, &property_return) ||
nitems != 18 || format_return != 32) { nitems != 18 || format_return != 32) {
/* /*
...@@ -656,7 +656,7 @@ LINEAR_RGB_InitSCCData( ...@@ -656,7 +656,7 @@ LINEAR_RGB_InitSCCData(
/* /*
* This is a per-Visual intensity table * This is a per-Visual intensity table
*/ */
if (!(pScreenData = (LINEAR_RGB_SCCData *) if (!(pScreenData = (LINEAR_RGB_SCCData *)
Xcalloc (1, sizeof(LINEAR_RGB_SCCData)))) { Xcalloc (1, sizeof(LINEAR_RGB_SCCData)))) {
return(XcmsFailure); return(XcmsFailure);
} }
...@@ -665,7 +665,7 @@ LINEAR_RGB_InitSCCData( ...@@ -665,7 +665,7 @@ LINEAR_RGB_InitSCCData(
18 * sizeof(XcmsFloat)); 18 * sizeof(XcmsFloat));
/* Create, initialize, and add map */ /* Create, initialize, and add map */
if (!(pNewMap = (XcmsIntensityMap *) if (!(pNewMap = (XcmsIntensityMap *)
Xcalloc (1, sizeof(XcmsIntensityMap)))) { Xcalloc (1, sizeof(XcmsIntensityMap)))) {
Xfree((char *)pScreenData); Xfree((char *)pScreenData);
return(XcmsFailure); return(XcmsFailure);
...@@ -719,7 +719,7 @@ LINEAR_RGB_InitSCCData( ...@@ -719,7 +719,7 @@ LINEAR_RGB_InitSCCData(
&nitems) == XcmsFailure) { &nitems) == XcmsFailure) {
goto FreeBlueTbl; goto FreeBlueTbl;
} }
} }
} else if (cType == 1) { } else if (cType == 1) {
/* Red Intensity Table */ /* Red Intensity Table */
if (!(pScreenData->pRedTbl = (IntensityTbl *) if (!(pScreenData->pRedTbl = (IntensityTbl *)
...@@ -849,7 +849,7 @@ LINEAR_RGB_FreeSCCData( ...@@ -849,7 +849,7 @@ LINEAR_RGB_FreeSCCData(
if (pScreenData && pScreenData != &Default_RGB_SCCData) { if (pScreenData && pScreenData != &Default_RGB_SCCData) {
if (pScreenData->pRedTbl) { if (pScreenData->pRedTbl) {
if (pScreenData->pGreenTbl) { if (pScreenData->pGreenTbl) {
if (pScreenData->pRedTbl->pBase != if (pScreenData->pRedTbl->pBase !=
pScreenData->pGreenTbl->pBase) { pScreenData->pGreenTbl->pBase) {
if (pScreenData->pGreenTbl->pBase) { if (pScreenData->pGreenTbl->pBase) {
Xfree ((char *)pScreenData->pGreenTbl->pBase); Xfree ((char *)pScreenData->pGreenTbl->pBase);
...@@ -860,7 +860,7 @@ LINEAR_RGB_FreeSCCData( ...@@ -860,7 +860,7 @@ LINEAR_RGB_FreeSCCData(
} }
} }
if (pScreenData->pBlueTbl) { if (pScreenData->pBlueTbl) {
if (pScreenData->pRedTbl->pBase != if (pScreenData->pRedTbl->pBase !=
pScreenData->pBlueTbl->pBase) { pScreenData->pBlueTbl->pBase) {
if (pScreenData->pBlueTbl->pBase) { if (pScreenData->pBlueTbl->pBase) {
Xfree ((char *)pScreenData->pBlueTbl->pBase); Xfree ((char *)pScreenData->pBlueTbl->pBase);
...@@ -919,7 +919,7 @@ _XcmsGetTableType0( ...@@ -919,7 +919,7 @@ _XcmsGetTableType0(
} }
switch (format) { switch (format) {
case 8: case 8:
for (; nElements--; pIRec++) { for (; nElements--; pIRec++) {
/* 0xFFFF/0xFF = 0x101 */ /* 0xFFFF/0xFF = 0x101 */
pIRec->value = _XcmsGetElement (format, pChar, pCount) * 0x101; pIRec->value = _XcmsGetElement (format, pChar, pCount) * 0x101;
...@@ -927,14 +927,14 @@ _XcmsGetTableType0( ...@@ -927,14 +927,14 @@ _XcmsGetTableType0(
_XcmsGetElement (format, pChar, pCount) / (XcmsFloat)255.0; _XcmsGetElement (format, pChar, pCount) / (XcmsFloat)255.0;
} }
break; break;
case 16: case 16:
for (; nElements--; pIRec++) { for (; nElements--; pIRec++) {
pIRec->value = _XcmsGetElement (format, pChar, pCount); pIRec->value = _XcmsGetElement (format, pChar, pCount);
pIRec->intensity = _XcmsGetElement (format, pChar, pCount) pIRec->intensity = _XcmsGetElement (format, pChar, pCount)
/ (XcmsFloat)65535.0; / (XcmsFloat)65535.0;
} }
break; break;
case 32: case 32:
for (; nElements--; pIRec++) { for (; nElements--; pIRec++) {
pIRec->value = _XcmsGetElement (format, pChar, pCount); pIRec->value = _XcmsGetElement (format, pChar, pCount);
pIRec->intensity = _XcmsGetElement (format, pChar, pCount) pIRec->intensity = _XcmsGetElement (format, pChar, pCount)
...@@ -981,21 +981,21 @@ _XcmsGetTableType1( ...@@ -981,21 +981,21 @@ _XcmsGetTableType1(
} }
switch (format) { switch (format) {
case 8: case 8:
for (count = 0; count < max_index+1; count++, pIRec++) { for (count = 0; count < max_index+1; count++, pIRec++) {
pIRec->value = (count * 65535) / max_index; pIRec->value = (count * 65535) / max_index;
pIRec->intensity = _XcmsGetElement (format, pChar, pCount) pIRec->intensity = _XcmsGetElement (format, pChar, pCount)
/ (XcmsFloat)255.0; / (XcmsFloat)255.0;
} }
break; break;
case 16: case 16:
for (count = 0; count < max_index+1; count++, pIRec++) { for (count = 0; count < max_index+1; count++, pIRec++) {
pIRec->value = (count * 65535) / max_index; pIRec->value = (count * 65535) / max_index;
pIRec->intensity = _XcmsGetElement (format, pChar, pCount) pIRec->intensity = _XcmsGetElement (format, pChar, pCount)
/ (XcmsFloat)65535.0; / (XcmsFloat)65535.0;
} }
break; break;
case 32: case 32:
for (count = 0; count < max_index+1; count++, pIRec++) { for (count = 0; count < max_index+1; count++, pIRec++) {
pIRec->value = (count * 65535) / max_index; pIRec->value = (count * 65535) / max_index;
pIRec->intensity = _XcmsGetElement (format, pChar, pCount) pIRec->intensity = _XcmsGetElement (format, pChar, pCount)
...@@ -1088,7 +1088,7 @@ _XcmsValueInterpolation( ...@@ -1088,7 +1088,7 @@ _XcmsValueInterpolation(
{ {
XcmsFloat ratio; XcmsFloat ratio;
ratio = ((XcmsFloat)key->value - (XcmsFloat)lo->value) / ratio = ((XcmsFloat)key->value - (XcmsFloat)lo->value) /
((XcmsFloat)hi->value - (XcmsFloat)lo->value); ((XcmsFloat)hi->value - (XcmsFloat)lo->value);
answer->value = key->value; answer->value = key->value;
answer->intensity = (hi->intensity - lo->intensity) * ratio; answer->intensity = (hi->intensity - lo->intensity) * ratio;
...@@ -1239,7 +1239,7 @@ static void _XcmsMatVec( ...@@ -1239,7 +1239,7 @@ static void _XcmsMatVec(
XcmsFloat *pMat, XcmsFloat *pIn, XcmsFloat *pOut) XcmsFloat *pMat, XcmsFloat *pIn, XcmsFloat *pOut)
/* /*
* DESCRIPTION * DESCRIPTION
* Multiply the passed vector by the passed matrix to return a * Multiply the passed vector by the passed matrix to return a
* vector. Matrix is 3x3, vectors are of length 3. * vector. Matrix is 3x3, vectors are of length 3.
* *
* RETURNS * RETURNS
...@@ -1430,7 +1430,24 @@ XcmsLRGB_RGBi_ParseString( ...@@ -1430,7 +1430,24 @@ XcmsLRGB_RGBi_ParseString(
&pColor->spec.RGBi.red, &pColor->spec.RGBi.red,
&pColor->spec.RGBi.green, &pColor->spec.RGBi.green,
&pColor->spec.RGBi.blue) != 3) { &pColor->spec.RGBi.blue) != 3) {
return(XcmsFailure); char *s; /* Maybe failed due to locale */
int f;
if ((s = strdup(spec))) {
for (f = 0; s[f]; ++f)
if (s[f] == '.')
s[f] = ',';
else if (s[f] == ',')
s[f] = '.';
if (sscanf(s + n + 1, "%lf/%lf/%lf",
&pColor->spec.RGBi.red,
&pColor->spec.RGBi.green,
&pColor->spec.RGBi.blue) != 3) {
free(s);
return(XcmsFailure);
}
free(s);
} else
return(XcmsFailure);
} }
/* /*
...@@ -1449,12 +1466,12 @@ XcmsLRGB_RGBi_ParseString( ...@@ -1449,12 +1466,12 @@ XcmsLRGB_RGBi_ParseString(
* SYNOPSIS * SYNOPSIS
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsCIEXYZToRGBi(ccc, pXcmsColors_in_out, nColors, pCompressed) XcmsCIEXYZToRGBi(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pXcmsColors_in_out;/* pointer to XcmsColors to convert */ XcmsColor *pXcmsColors_in_out,/* pointer to XcmsColors to convert */
unsigned int nColors; /* Number of colors */ unsigned int nColors, /* Number of colors */
Bool *pCompressed; /* pointer to an array of Bool */ Bool *pCompressed) /* pointer to an array of Bool */
/* /*
* DESCRIPTION * DESCRIPTION
* Converts color specifications in an array of XcmsColor * Converts color specifications in an array of XcmsColor
...@@ -1515,7 +1532,7 @@ XcmsCIEXYZToRGBi(ccc, pXcmsColors_in_out, nColors, pCompressed) ...@@ -1515,7 +1532,7 @@ XcmsCIEXYZToRGBi(ccc, pXcmsColors_in_out, nColors, pCompressed)
/* /*
* Aha!! Here's that little trick that will allow * Aha!! Here's that little trick that will allow
* gamut compression routines to get the out of bound * gamut compression routines to get the out of bound
* RGBi. * RGBi.
*/ */
memcpy((char *)&pColor->spec, (char *)tmp, sizeof(tmp)); memcpy((char *)&pColor->spec, (char *)tmp, sizeof(tmp));
pColor->format = XcmsRGBiFormat; pColor->format = XcmsRGBiFormat;
...@@ -1571,12 +1588,12 @@ XcmsCIEXYZToRGBi(ccc, pXcmsColors_in_out, nColors, pCompressed) ...@@ -1571,12 +1588,12 @@ XcmsCIEXYZToRGBi(ccc, pXcmsColors_in_out, nColors, pCompressed)
* SYNOPSIS * SYNOPSIS
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsRGBiToCIEXYZ(ccc, pXcmsColors_in_out, nColors, pCompressed) XcmsRGBiToCIEXYZ(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pXcmsColors_in_out;/* pointer to XcmsColors to convert */ XcmsColor *pXcmsColors_in_out,/* pointer to XcmsColors to convert */
unsigned int nColors; /* Number of colors */ unsigned int nColors, /* Number of colors */
Bool *pCompressed; /* pointer to a bit array */ Bool *pCompressed) /* pointer to a bit array */
/* /*
* DESCRIPTION * DESCRIPTION
* Converts color specifications in an array of XcmsColor * Converts color specifications in an array of XcmsColor
...@@ -1624,12 +1641,12 @@ XcmsRGBiToCIEXYZ(ccc, pXcmsColors_in_out, nColors, pCompressed) ...@@ -1624,12 +1641,12 @@ XcmsRGBiToCIEXYZ(ccc, pXcmsColors_in_out, nColors, pCompressed)
* SYNOPSIS * SYNOPSIS
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsRGBiToRGB(ccc, pXcmsColors_in_out, nColors, pCompressed) XcmsRGBiToRGB(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pXcmsColors_in_out;/* pointer to XcmsColors to convert */ XcmsColor *pXcmsColors_in_out,/* pointer to XcmsColors to convert */
unsigned int nColors; /* Number of colors */ unsigned int nColors, /* Number of colors */
Bool *pCompressed; /* pointer to a bit array */ Bool *pCompressed) /* pointer to a bit array */
/* /*
* DESCRIPTION * DESCRIPTION
* Converts color specifications in an array of XcmsColor * Converts color specifications in an array of XcmsColor
...@@ -1707,7 +1724,7 @@ XcmsRGBiToRGB(ccc, pXcmsColors_in_out, nColors, pCompressed) ...@@ -1707,7 +1724,7 @@ XcmsRGBiToRGB(ccc, pXcmsColors_in_out, nColors, pCompressed)
* SYNOPSIS * SYNOPSIS
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsRGBToRGBi( XcmsRGBToRGBi(
XcmsCCC ccc, XcmsCCC ccc,
XcmsColor *pXcmsColors_in_out,/* pointer to XcmsColors to convert */ XcmsColor *pXcmsColors_in_out,/* pointer to XcmsColors to convert */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -160,7 +160,24 @@ CIELab_ParseString( ...@@ -160,7 +160,24 @@ CIELab_ParseString(
&pColor->spec.CIELab.L_star, &pColor->spec.CIELab.L_star,
&pColor->spec.CIELab.a_star, &pColor->spec.CIELab.a_star,
&pColor->spec.CIELab.b_star) != 3) { &pColor->spec.CIELab.b_star) != 3) {
return(XcmsFailure); char *s; /* Maybe failed due to locale */
int f;
if ((s = strdup(spec))) {
for (f = 0; s[f]; ++f)
if (s[f] == '.')
s[f] = ',';
else if (s[f] == ',')
s[f] = '.';
if (sscanf(s + n + 1, "%lf/%lf/%lf",
&pColor->spec.CIELab.L_star,
&pColor->spec.CIELab.a_star,
&pColor->spec.CIELab.b_star) != 3) {
free(s);
return(XcmsFailure);
}
free(s);
} else
return(XcmsFailure);
} }
pColor->format = XcmsCIELabFormat; pColor->format = XcmsCIELabFormat;
pColor->pixel = 0; pColor->pixel = 0;
...@@ -213,11 +230,11 @@ XcmsCIELab_ValidSpec( ...@@ -213,11 +230,11 @@ XcmsCIELab_ValidSpec(
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIELabToCIEXYZ(ccc, pLab_WhitePt, pColors_in_out, nColors) XcmsCIELabToCIEXYZ(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pLab_WhitePt; XcmsColor *pLab_WhitePt,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors)
/* /*
* DESCRIPTION * DESCRIPTION
* Converts color specifications in an array of XcmsColor * Converts color specifications in an array of XcmsColor
...@@ -316,11 +333,11 @@ XcmsCIELabToCIEXYZ(ccc, pLab_WhitePt, pColors_in_out, nColors) ...@@ -316,11 +333,11 @@ XcmsCIELabToCIEXYZ(ccc, pLab_WhitePt, pColors_in_out, nColors)
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIEXYZToCIELab(ccc, pLab_WhitePt, pColors_in_out, nColors) XcmsCIEXYZToCIELab(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pLab_WhitePt; XcmsColor *pLab_WhitePt,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors)
/* /*
* DESCRIPTION * DESCRIPTION
* Converts color specifications in an array of XcmsColor * Converts color specifications in an array of XcmsColor
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -52,20 +52,20 @@ ...@@ -52,20 +52,20 @@
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsCIELabClipab (ccc, pColors_in_out, nColors, i, pCompressed) XcmsCIELabClipab (
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors,
unsigned int i; unsigned int i,
Bool *pCompressed; Bool *pCompressed)
/* /*
* DESCRIPTION * DESCRIPTION
* Reduce the Chroma for a specific hue and chroma to * Reduce the Chroma for a specific hue and chroma to
* to bring the given color into the gamut of the * to bring the given color into the gamut of the
* specified device. As required of gamut compression * specified device. As required of gamut compression
* functions, this routine returns pColor_in_out * functions, this routine returns pColor_in_out
* in XcmsCIEXYZFormat on successful completion. * in XcmsCIEXYZFormat on successful completion.
* *
* Since this routine works with the L* within * Since this routine works with the L* within
* pColor_in_out intermediate results may be returned * pColor_in_out intermediate results may be returned
* even though it may be invalid. * even though it may be invalid.
...@@ -111,7 +111,7 @@ XcmsCIELabClipab (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -111,7 +111,7 @@ XcmsCIELabClipab (ccc, pColors_in_out, nColors, i, pCompressed)
} }
} }
if (XcmsCIELabQueryMaxC(ccc, if (XcmsCIELabQueryMaxC(ccc,
degrees(XCMS_CIELAB_PMETRIC_HUE(pColor->spec.CIELab.a_star, degrees(XCMS_CIELAB_PMETRIC_HUE(pColor->spec.CIELab.a_star,
pColor->spec.CIELab.b_star)), pColor->spec.CIELab.b_star)),
pColor->spec.CIELab.L_star, pColor->spec.CIELab.L_star,
pColor) == XcmsFailure) { pColor) == XcmsFailure) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -52,16 +52,16 @@ ...@@ -52,16 +52,16 @@
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsCIELabClipL (ccc, pColors_in_out, nColors, i, pCompressed) XcmsCIELabClipL (
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors,
unsigned int i; unsigned int i,
Bool *pCompressed; Bool *pCompressed)
/* /*
* DESCRIPTION * DESCRIPTION
* Return the closest L* for a specific hue and chroma. * Return the closest L* for a specific hue and chroma.
* This routine takes any color as input and outputs * This routine takes any color as input and outputs
* a CIE XYZ color. * a CIE XYZ color.
* *
* Since this routine works with the L* within * Since this routine works with the L* within
...@@ -95,7 +95,7 @@ XcmsCIELabClipL (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -95,7 +95,7 @@ XcmsCIELabClipL (ccc, pColors_in_out, nColors, i, pCompressed)
*/ */
pColor = pColors_in_out + i; pColor = pColors_in_out + i;
if (ccc->visual->class < StaticColor) { if (ccc->visual->class < StaticColor) {
/* /*
* GRAY ! * GRAY !
...@@ -136,7 +136,7 @@ XcmsCIELabClipL (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -136,7 +136,7 @@ XcmsCIELabClipL (ccc, pColors_in_out, nColors, i, pCompressed)
memcpy((char *)pColor, (char *)&Lab_max, sizeof(XcmsColor)); memcpy((char *)pColor, (char *)&Lab_max, sizeof(XcmsColor));
return (XcmsFailure); return (XcmsFailure);
} else if (pColor->spec.CIELab.L_star < Lab_max.spec.CIELab.L_star) { } else if (pColor->spec.CIELab.L_star < Lab_max.spec.CIELab.L_star) {
/* Find the minimum lightness for the given chroma. */ /* Find the minimum lightness for the given chroma. */
if (pColor->format != XcmsCIELabFormat) { if (pColor->format != XcmsCIELabFormat) {
if (_XcmsDIConvertColors(ccc, pColor, if (_XcmsDIConvertColors(ccc, pColor,
ScreenWhitePointOfCCC(ccc), 1, XcmsCIELabFormat) ScreenWhitePointOfCCC(ccc), 1, XcmsCIELabFormat)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -60,15 +60,15 @@ ...@@ -60,15 +60,15 @@
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsCIELabClipLab (ccc, pColors_in_out, nColors, i, pCompressed) XcmsCIELabClipLab (
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors,
unsigned int i; unsigned int i,
Bool *pCompressed; Bool *pCompressed)
/* /*
* DESCRIPTION * DESCRIPTION
* This routine will find the closest L* and chroma * This routine will find the closest L* and chroma
* for a specific hue. The color input is converted to * for a specific hue. The color input is converted to
* CIE L*u*v* format and returned as CIE XYZ format. * CIE L*u*v* format and returned as CIE XYZ format.
* *
...@@ -138,12 +138,12 @@ XcmsCIELabClipLab (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -138,12 +138,12 @@ XcmsCIELabClipLab (ccc, pColors_in_out, nColors, i, pCompressed)
chroma = XCMS_CIELAB_PMETRIC_CHROMA(pColor->spec.CIELab.a_star, chroma = XCMS_CIELAB_PMETRIC_CHROMA(pColor->spec.CIELab.a_star,
pColor->spec.CIELab.b_star); pColor->spec.CIELab.b_star);
memcpy((char *)&Lab_max, (char *)pColor, sizeof(XcmsColor)); memcpy((char *)&Lab_max, (char *)pColor, sizeof(XcmsColor));
if (_XcmsCIELabQueryMaxLCRGB (&myCCC, hue, &Lab_max, &rgb_max) if (_XcmsCIELabQueryMaxLCRGB (&myCCC, hue, &Lab_max, &rgb_max)
== XcmsFailure) { == XcmsFailure) {
return (XcmsFailure); return (XcmsFailure);
} }
maxLstar = Lab_max.spec.CIELab.L_star; maxLstar = Lab_max.spec.CIELab.L_star;
/* Now check and return the appropriate L* */ /* Now check and return the appropriate L* */
if (saveLstar == maxLstar) { if (saveLstar == maxLstar) {
/* When the L* input is equal to the maximum L* */ /* When the L* input is equal to the maximum L* */
...@@ -197,7 +197,7 @@ XcmsCIELabClipLab (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -197,7 +197,7 @@ XcmsCIELabClipLab (ccc, pColors_in_out, nColors, i, pCompressed)
bestLstar = pColor->spec.CIELab.L_star; bestLstar = pColor->spec.CIELab.L_star;
bestastar = pColor->spec.CIELab.a_star; bestastar = pColor->spec.CIELab.a_star;
bestbstar = pColor->spec.CIELab.b_star; bestbstar = pColor->spec.CIELab.b_star;
bestChroma = chroma; bestChroma = chroma;
} }
if (nI == nILast || nI == 0) { if (nI == nILast || nI == 0) {
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -60,11 +60,11 @@ ...@@ -60,11 +60,11 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return) XcmsCIELabQueryMinL(
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue_angle; /* hue angle in degrees */ XcmsFloat hue_angle, /* hue angle in degrees */
XcmsFloat chroma; XcmsFloat chroma,
XcmsColor *pColor_return; XcmsColor *pColor_return)
/* /*
* DESCRIPTION * DESCRIPTION
* Return the maximum Lstar for a specified hue_angle and chroma. * Return the maximum Lstar for a specified hue_angle and chroma.
...@@ -106,7 +106,7 @@ XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return) ...@@ -106,7 +106,7 @@ XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return)
} }
while (hue_angle >= 360.0) { while (hue_angle >= 360.0) {
hue_angle -= 360.0; hue_angle -= 360.0;
} }
hue = radians(hue_angle); hue = radians(hue_angle);
tmp.spec.CIELab.L_star = START_L_STAR; tmp.spec.CIELab.L_star = START_L_STAR;
...@@ -114,7 +114,7 @@ XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return) ...@@ -114,7 +114,7 @@ XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return)
tmp.spec.CIELab.b_star = XCMS_CIEBSTAROFHUE(hue, chroma); tmp.spec.CIELab.b_star = XCMS_CIEBSTAROFHUE(hue, chroma);
tmp.pixel = pColor_return->pixel; tmp.pixel = pColor_return->pixel;
tmp.format = XcmsCIELabFormat; tmp.format = XcmsCIELabFormat;
/* Step 1: Obtain the maximum L_star and chroma for this hue. */ /* Step 1: Obtain the maximum L_star and chroma for this hue. */
if (_XcmsCIELabQueryMaxLCRGB(&myCCC, hue, &max_lc, &rgb_saved) if (_XcmsCIELabQueryMaxLCRGB(&myCCC, hue, &max_lc, &rgb_saved)
== XcmsFailure) { == XcmsFailure) {
...@@ -126,7 +126,7 @@ XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return) ...@@ -126,7 +126,7 @@ XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return)
if (max_chroma <= chroma) { if (max_chroma <= chroma) {
/* /*
* If the chroma is greater than the chroma for the * If the chroma is greater than the chroma for the
* maximum L/chroma point then the L_star is the * maximum L/chroma point then the L_star is the
* the L_star for the maximum L_star/chroma point. * the L_star for the maximum L_star/chroma point.
* This is an error but I return the best approximation I can. * This is an error but I return the best approximation I can.
...@@ -137,7 +137,7 @@ XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return) ...@@ -137,7 +137,7 @@ XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return)
} }
/* /*
* If the chroma is equal to the chroma for the * If the chroma is equal to the chroma for the
* maximum L_star/chroma point then the L_star is the * maximum L_star/chroma point then the L_star is the
* the L_star for the maximum L* and chroma point. * the L_star for the maximum L* and chroma point.
*/ */
...@@ -180,15 +180,15 @@ XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return) ...@@ -180,15 +180,15 @@ XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return)
/* Found It! */ /* Found It! */
memcpy ((char *) pColor_return, (char *) &tmp, sizeof (XcmsColor)); memcpy ((char *) pColor_return, (char *) &tmp, sizeof (XcmsColor));
return(XcmsSuccess); return(XcmsSuccess);
} }
nChroma += chroma - tmp_chroma; nChroma += chroma - tmp_chroma;
if (nChroma > max_chroma) { if (nChroma > max_chroma) {
nChroma = max_chroma; nChroma = max_chroma;
rFactor *= 0.5; /* selective relaxation employed */ rFactor *= 0.5; /* selective relaxation employed */
} else if (nChroma < 0.0) { } else if (nChroma < 0.0) {
if (XCMS_FABS(lastChroma - chroma) < if (XCMS_FABS(lastChroma - chroma) <
XCMS_FABS(tmp_chroma - chroma)) { XCMS_FABS(tmp_chroma - chroma)) {
memcpy ((char *)pColor_return, (char *)&prev, memcpy ((char *)pColor_return, (char *)&prev,
sizeof(XcmsColor)); sizeof(XcmsColor));
} else { } else {
memcpy ((char *)pColor_return, (char *)&tmp, memcpy ((char *)pColor_return, (char *)&tmp,
...@@ -202,7 +202,7 @@ XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return) ...@@ -202,7 +202,7 @@ XcmsCIELabQueryMinL(ccc, hue_angle, chroma, pColor_return)
} }
if (nCount >= nMaxCount) { if (nCount >= nMaxCount) {
if (XCMS_FABS(lastChroma - chroma) < if (XCMS_FABS(lastChroma - chroma) <
XCMS_FABS(tmp_chroma - chroma)) { XCMS_FABS(tmp_chroma - chroma)) {
memcpy ((char *)pColor_return, (char *)&prev, memcpy ((char *)pColor_return, (char *)&prev,
sizeof(XcmsColor)); sizeof(XcmsColor));
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -63,11 +63,11 @@ ...@@ -63,11 +63,11 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIELabQueryMaxC(ccc, hue_angle, L_star, pColor_return) XcmsCIELabQueryMaxC(
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue_angle; /* hue angle in degrees */ XcmsFloat hue_angle, /* hue angle in degrees */
XcmsFloat L_star; XcmsFloat L_star,
XcmsColor *pColor_return; XcmsColor *pColor_return)
/* /*
* DESCRIPTION * DESCRIPTION
* Return the maximum chroma for a specific hue_angle and L_star. * Return the maximum chroma for a specific hue_angle and L_star.
...@@ -103,7 +103,7 @@ XcmsCIELabQueryMaxC(ccc, hue_angle, L_star, pColor_return) ...@@ -103,7 +103,7 @@ XcmsCIELabQueryMaxC(ccc, hue_angle, L_star, pColor_return)
/* Use my own CCC and inherit screen white Pt */ /* Use my own CCC and inherit screen white Pt */
memcpy ((char *)&myCCC, (char *)ccc, sizeof(XcmsCCCRec)); memcpy ((char *)&myCCC, (char *)ccc, sizeof(XcmsCCCRec));
myCCC.clientWhitePt.format = XcmsUndefinedFormat; myCCC.clientWhitePt.format = XcmsUndefinedFormat;
myCCC.gamutCompProc = (XcmsCompressionProc)NULL;/* no gamut comp func */ myCCC.gamutCompProc = (XcmsCompressionProc)NULL;/* no gamut comp func */
while (hue_angle < 0.0) { while (hue_angle < 0.0) {
...@@ -111,7 +111,7 @@ XcmsCIELabQueryMaxC(ccc, hue_angle, L_star, pColor_return) ...@@ -111,7 +111,7 @@ XcmsCIELabQueryMaxC(ccc, hue_angle, L_star, pColor_return)
} }
while (hue_angle >= 360.0) { while (hue_angle >= 360.0) {
hue_angle -= 360.0; hue_angle -= 360.0;
} }
hue = radians(hue_angle); hue = radians(hue_angle);
tmp.spec.CIELab.L_star = L_star; tmp.spec.CIELab.L_star = L_star;
...@@ -190,7 +190,7 @@ XcmsCIELabQueryMaxC(ccc, hue_angle, L_star, pColor_return) ...@@ -190,7 +190,7 @@ XcmsCIELabQueryMaxC(ccc, hue_angle, L_star, pColor_return)
/* printf("rFactor = %lf\n", rFactor); */ /* printf("rFactor = %lf\n", rFactor); */
} }
} }
if (XCMS_FABS(last_L_star - L_star) < if (XCMS_FABS(last_L_star - L_star) <
XCMS_FABS(tmp.spec.CIELab.L_star - L_star)) { XCMS_FABS(tmp.spec.CIELab.L_star - L_star)) {
tmp.spec.CIELab.a_star = lastaStar; tmp.spec.CIELab.a_star = lastaStar;
tmp.spec.CIELab.b_star = lastbStar; tmp.spec.CIELab.b_star = lastbStar;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -60,11 +60,11 @@ ...@@ -60,11 +60,11 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return) XcmsCIELabQueryMaxL(
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue_angle; /* hue in degrees */ XcmsFloat hue_angle, /* hue in degrees */
XcmsFloat chroma; XcmsFloat chroma,
XcmsColor *pColor_return; XcmsColor *pColor_return)
/* /*
* DESCRIPTION * DESCRIPTION
* Return the maximum Lstar for a specified hue_angle and chroma. * Return the maximum Lstar for a specified hue_angle and chroma.
...@@ -106,7 +106,7 @@ XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return) ...@@ -106,7 +106,7 @@ XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return)
} }
while (hue_angle >= 360.0) { while (hue_angle >= 360.0) {
hue_angle -= 360.0; hue_angle -= 360.0;
} }
hue = radians(hue_angle); hue = radians(hue_angle);
tmp.spec.CIELab.L_star = START_L_STAR; tmp.spec.CIELab.L_star = START_L_STAR;
...@@ -114,7 +114,7 @@ XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return) ...@@ -114,7 +114,7 @@ XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return)
tmp.spec.CIELab.b_star = XCMS_CIEBSTAROFHUE(hue, chroma); tmp.spec.CIELab.b_star = XCMS_CIEBSTAROFHUE(hue, chroma);
tmp.pixel = pColor_return->pixel; tmp.pixel = pColor_return->pixel;
tmp.format = XcmsCIELabFormat; tmp.format = XcmsCIELabFormat;
/* Step 1: Obtain the maximum L_star and chroma for this hue. */ /* Step 1: Obtain the maximum L_star and chroma for this hue. */
if (_XcmsCIELabQueryMaxLCRGB(&myCCC, hue, &max_lc, &rgb_saved) if (_XcmsCIELabQueryMaxLCRGB(&myCCC, hue, &max_lc, &rgb_saved)
== XcmsFailure) { == XcmsFailure) {
...@@ -126,7 +126,7 @@ XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return) ...@@ -126,7 +126,7 @@ XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return)
if (max_chroma <= chroma) { if (max_chroma <= chroma) {
/* /*
* If the chroma is greater than the chroma for the * If the chroma is greater than the chroma for the
* maximum L/chroma point then the L_star is the * maximum L/chroma point then the L_star is the
* the L_star for the maximum L_star/chroma point. * the L_star for the maximum L_star/chroma point.
* This is an error but I return the best approximation I can. * This is an error but I return the best approximation I can.
...@@ -137,7 +137,7 @@ XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return) ...@@ -137,7 +137,7 @@ XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return)
} }
/* /*
* If the chroma is equal to the chroma for the * If the chroma is equal to the chroma for the
* maximum L_star/chroma point then the L_star is the * maximum L_star/chroma point then the L_star is the
* the L_star for the maximum L* and chroma point. * the L_star for the maximum L* and chroma point.
*/ */
...@@ -180,13 +180,13 @@ XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return) ...@@ -180,13 +180,13 @@ XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return)
/* Found It! */ /* Found It! */
memcpy ((char *) pColor_return, (char *) &tmp, sizeof (XcmsColor)); memcpy ((char *) pColor_return, (char *) &tmp, sizeof (XcmsColor));
return(XcmsSuccess); return(XcmsSuccess);
} }
nChroma += chroma - tmp_chroma; nChroma += chroma - tmp_chroma;
if (nChroma > max_chroma) { if (nChroma > max_chroma) {
nChroma = max_chroma; nChroma = max_chroma;
rFactor *= 0.5; /* selective relaxation employed */ rFactor *= 0.5; /* selective relaxation employed */
} else if (nChroma < 0.0) { } else if (nChroma < 0.0) {
if (XCMS_FABS(lastChroma - chroma) < if (XCMS_FABS(lastChroma - chroma) <
XCMS_FABS(tmp_chroma - chroma)) { XCMS_FABS(tmp_chroma - chroma)) {
memcpy ((char *)pColor_return, (char *)&prev, memcpy ((char *)pColor_return, (char *)&prev,
sizeof(XcmsColor)); sizeof(XcmsColor));
...@@ -202,7 +202,7 @@ XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return) ...@@ -202,7 +202,7 @@ XcmsCIELabQueryMaxL(ccc, hue_angle, chroma, pColor_return)
} }
if (nCount >= nMaxCount) { if (nCount >= nMaxCount) {
if (XCMS_FABS(lastChroma - chroma) < if (XCMS_FABS(lastChroma - chroma) <
XCMS_FABS(tmp_chroma - chroma)) { XCMS_FABS(tmp_chroma - chroma)) {
memcpy ((char *)pColor_return, (char *)&prev, memcpy ((char *)pColor_return, (char *)&prev,
sizeof(XcmsColor)); sizeof(XcmsColor));
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -81,7 +81,7 @@ _XcmsCIELabQueryMaxLCRGB( ...@@ -81,7 +81,7 @@ _XcmsCIELabQueryMaxLCRGB(
* by a binary search of all possible chromas. An assumption * by a binary search of all possible chromas. An assumption
* is made that there are no local maxima. Use the unrounded * is made that there are no local maxima. Use the unrounded
* Max psychometric chroma because the difference check can be * Max psychometric chroma because the difference check can be
* small. * small.
* *
* NOTE: No local CCC is used because this is a private * NOTE: No local CCC is used because this is a private
* routine and all routines that call it are expected * routine and all routines that call it are expected
...@@ -96,7 +96,7 @@ _XcmsCIELabQueryMaxLCRGB( ...@@ -96,7 +96,7 @@ _XcmsCIELabQueryMaxLCRGB(
* XcmsFailure - Failure * XcmsFailure - Failure
* XcmsSuccess - Succeeded * XcmsSuccess - Succeeded
* *
*/ */
{ {
XcmsFloat nSmall, nLarge; XcmsFloat nSmall, nLarge;
XcmsColor tmp; XcmsColor tmp;
...@@ -113,15 +113,15 @@ _XcmsCIELabQueryMaxLCRGB( ...@@ -113,15 +113,15 @@ _XcmsCIELabQueryMaxLCRGB(
* out of bounds RGBi values in tmp when the ccc->gamutCompProc * out of bounds RGBi values in tmp when the ccc->gamutCompProc
* is NULL. * is NULL.
*/ */
if ((_XcmsConvertColorsWithWhitePt(ccc, &tmp, ScreenWhitePointOfCCC(ccc), if ((_XcmsConvertColorsWithWhitePt(ccc, &tmp, ScreenWhitePointOfCCC(ccc),
(unsigned int)1, XcmsRGBiFormat, (Bool *) NULL) (unsigned int)1, XcmsRGBiFormat, (Bool *) NULL)
== XcmsFailure) && tmp.format != XcmsRGBiFormat) { == XcmsFailure) && tmp.format != XcmsRGBiFormat) {
return (XcmsFailure); return (XcmsFailure);
} }
/* Now pick the smallest RGB */ /* Now pick the smallest RGB */
nSmall = MIN3(tmp.spec.RGBi.red, nSmall = MIN3(tmp.spec.RGBi.red,
tmp.spec.RGBi.green, tmp.spec.RGBi.green,
tmp.spec.RGBi.blue); tmp.spec.RGBi.blue);
/* Make the smallest RGB equal to zero */ /* Make the smallest RGB equal to zero */
tmp.spec.RGBi.red -= nSmall; tmp.spec.RGBi.red -= nSmall;
...@@ -129,8 +129,8 @@ _XcmsCIELabQueryMaxLCRGB( ...@@ -129,8 +129,8 @@ _XcmsCIELabQueryMaxLCRGB(
tmp.spec.RGBi.blue -= nSmall; tmp.spec.RGBi.blue -= nSmall;
/* Now pick the largest RGB */ /* Now pick the largest RGB */
nLarge = MAX3(tmp.spec.RGBi.red, nLarge = MAX3(tmp.spec.RGBi.red,
tmp.spec.RGBi.green, tmp.spec.RGBi.green,
tmp.spec.RGBi.blue); tmp.spec.RGBi.blue);
/* Scale the RGB values based on the largest one */ /* Scale the RGB values based on the largest one */
tmp.spec.RGBi.red /= nLarge; tmp.spec.RGBi.red /= nLarge;
...@@ -147,13 +147,13 @@ _XcmsCIELabQueryMaxLCRGB( ...@@ -147,13 +147,13 @@ _XcmsCIELabQueryMaxLCRGB(
/* Convert from RGBi to Lab */ /* Convert from RGBi to Lab */
if (_XcmsConvertColorsWithWhitePt(ccc, &tmp, if (_XcmsConvertColorsWithWhitePt(ccc, &tmp,
ScreenWhitePointOfCCC(ccc), 1, XcmsCIELabFormat, (Bool *) NULL) ScreenWhitePointOfCCC(ccc), 1, XcmsCIELabFormat, (Bool *) NULL)
== XcmsFailure) { == XcmsFailure) {
return (XcmsFailure); return (XcmsFailure);
} }
memcpy((char *)pColor_return, (char *)&tmp, sizeof(XcmsColor)); memcpy((char *)pColor_return, (char *)&tmp, sizeof(XcmsColor));
return (XcmsSuccess); return (XcmsSuccess);
} }
...@@ -170,10 +170,10 @@ _XcmsCIELabQueryMaxLCRGB( ...@@ -170,10 +170,10 @@ _XcmsCIELabQueryMaxLCRGB(
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIELabQueryMaxLC (ccc, hue_angle, pColor_return) XcmsCIELabQueryMaxLC (
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue_angle; /* hue_angle in degrees */ XcmsFloat hue_angle, /* hue_angle in degrees */
XcmsColor *pColor_return; XcmsColor *pColor_return)
/* /*
* DESCRIPTION * DESCRIPTION
...@@ -190,7 +190,7 @@ XcmsCIELabQueryMaxLC (ccc, hue_angle, pColor_return) ...@@ -190,7 +190,7 @@ XcmsCIELabQueryMaxLC (ccc, hue_angle, pColor_return)
* XcmsFailure - Failure * XcmsFailure - Failure
* XcmsSuccess - Succeeded * XcmsSuccess - Succeeded
* *
*/ */
{ {
XcmsCCCRec myCCC; XcmsCCCRec myCCC;
...@@ -200,7 +200,7 @@ XcmsCIELabQueryMaxLC (ccc, hue_angle, pColor_return) ...@@ -200,7 +200,7 @@ XcmsCIELabQueryMaxLC (ccc, hue_angle, pColor_return)
if (ccc == NULL || pColor_return == NULL) { if (ccc == NULL || pColor_return == NULL) {
return(XcmsFailure); return(XcmsFailure);
} }
/* Use my own CCC */ /* Use my own CCC */
memcpy ((char *)&myCCC, (char *)ccc, sizeof(XcmsCCCRec)); memcpy ((char *)&myCCC, (char *)ccc, sizeof(XcmsCCCRec));
myCCC.clientWhitePt.format = XcmsUndefinedFormat; myCCC.clientWhitePt.format = XcmsUndefinedFormat;
...@@ -211,8 +211,8 @@ XcmsCIELabQueryMaxLC (ccc, hue_angle, pColor_return) ...@@ -211,8 +211,8 @@ XcmsCIELabQueryMaxLC (ccc, hue_angle, pColor_return)
} }
while (hue_angle >= 360.0) { while (hue_angle >= 360.0) {
hue_angle -= 360.0; hue_angle -= 360.0;
} }
return(_XcmsCIELabQueryMaxLCRGB (&myCCC, radians(hue_angle), pColor_return, return(_XcmsCIELabQueryMaxLCRGB (&myCCC, radians(hue_angle), pColor_return,
(XcmsRGBi *)NULL)); (XcmsRGBi *)NULL));
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -57,15 +57,14 @@ ...@@ -57,15 +57,14 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIELabWhiteShiftColors(ccc, pWhitePtFrom, pWhitePtTo, destSpecFmt, XcmsCIELabWhiteShiftColors(
pColors_in_out, nColors, pCompressed) XcmsCCC ccc,
XcmsCCC ccc; XcmsColor *pWhitePtFrom,
XcmsColor *pWhitePtFrom; XcmsColor *pWhitePtTo,
XcmsColor *pWhitePtTo; XcmsColorFormat destSpecFmt,
XcmsColorFormat destSpecFmt; XcmsColor *pColors_in_out,
XcmsColor *pColors_in_out; unsigned int nColors,
unsigned int nColors; Bool *pCompressed)
Bool *pCompressed;
/* /*
* DESCRIPTION * DESCRIPTION
* Adjust color specifications in XcmsColor structures for * Adjust color specifications in XcmsColor structures for
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -163,6 +163,23 @@ CIELuv_ParseString( ...@@ -163,6 +163,23 @@ CIELuv_ParseString(
&pColor->spec.CIELuv.L_star, &pColor->spec.CIELuv.L_star,
&pColor->spec.CIELuv.u_star, &pColor->spec.CIELuv.u_star,
&pColor->spec.CIELuv.v_star) != 3) { &pColor->spec.CIELuv.v_star) != 3) {
char *s; /* Maybe failed due to locale */
int f;
if ((s = strdup(spec))) {
for (f = 0; s[f]; ++f)
if (s[f] == '.')
s[f] = ',';
else if (s[f] == ',')
s[f] = '.';
if (sscanf(s + n + 1, "%lf/%lf/%lf",
&pColor->spec.CIELuv.L_star,
&pColor->spec.CIELuv.u_star,
&pColor->spec.CIELuv.v_star) != 3) {
free(s);
return(XcmsFailure);
}
free(s);
} else
return(XcmsFailure); return(XcmsFailure);
} }
pColor->format = XcmsCIELuvFormat; pColor->format = XcmsCIELuvFormat;
...@@ -214,11 +231,11 @@ XcmsCIELuv_ValidSpec( ...@@ -214,11 +231,11 @@ XcmsCIELuv_ValidSpec(
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIELuvToCIEuvY(ccc, pLuv_WhitePt, pColors_in_out, nColors) XcmsCIELuvToCIEuvY(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pLuv_WhitePt; XcmsColor *pLuv_WhitePt,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors)
/* /*
* DESCRIPTION * DESCRIPTION
* Converts color specifications in an array of XcmsColor * Converts color specifications in an array of XcmsColor
...@@ -284,7 +301,7 @@ XcmsCIELuvToCIEuvY(ccc, pLuv_WhitePt, pColors_in_out, nColors) ...@@ -284,7 +301,7 @@ XcmsCIELuvToCIEuvY(ccc, pLuv_WhitePt, pColors_in_out, nColors)
uvY_return.v_prime = pLuv_WhitePt->spec.CIEuvY.v_prime; uvY_return.v_prime = pLuv_WhitePt->spec.CIEuvY.v_prime;
} else { } else {
tmpVal = 13.0 * (pColor->spec.CIELuv.L_star / 100.0); tmpVal = 13.0 * (pColor->spec.CIELuv.L_star / 100.0);
uvY_return.u_prime = pColor->spec.CIELuv.u_star/tmpVal + uvY_return.u_prime = pColor->spec.CIELuv.u_star/tmpVal +
pLuv_WhitePt->spec.CIEuvY.u_prime; pLuv_WhitePt->spec.CIEuvY.u_prime;
uvY_return.v_prime = pColor->spec.CIELuv.v_star/tmpVal + uvY_return.v_prime = pColor->spec.CIELuv.v_star/tmpVal +
pLuv_WhitePt->spec.CIEuvY.v_prime; pLuv_WhitePt->spec.CIEuvY.v_prime;
...@@ -306,11 +323,11 @@ XcmsCIELuvToCIEuvY(ccc, pLuv_WhitePt, pColors_in_out, nColors) ...@@ -306,11 +323,11 @@ XcmsCIELuvToCIEuvY(ccc, pLuv_WhitePt, pColors_in_out, nColors)
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIEuvYToCIELuv(ccc, pLuv_WhitePt, pColors_in_out, nColors) XcmsCIEuvYToCIELuv(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pLuv_WhitePt; XcmsColor *pLuv_WhitePt,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors)
/* /*
* DESCRIPTION * DESCRIPTION
* Converts color specifications in an array of XcmsColor * Converts color specifications in an array of XcmsColor
...@@ -362,7 +379,7 @@ XcmsCIEuvYToCIELuv(ccc, pLuv_WhitePt, pColors_in_out, nColors) ...@@ -362,7 +379,7 @@ XcmsCIEuvYToCIELuv(ccc, pLuv_WhitePt, pColors_in_out, nColors)
} }
/* Now convert the uvY to Luv */ /* Now convert the uvY to Luv */
Luv_return.L_star = Luv_return.L_star =
(pColor->spec.CIEuvY.Y < 0.008856) (pColor->spec.CIEuvY.Y < 0.008856)
? ?
(pColor->spec.CIEuvY.Y * 903.29) (pColor->spec.CIEuvY.Y * 903.29)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -52,20 +52,20 @@ ...@@ -52,20 +52,20 @@
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsCIELuvClipuv (ccc, pColors_in_out, nColors, i, pCompressed) XcmsCIELuvClipuv (
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors,
unsigned int i; unsigned int i,
Bool *pCompressed; Bool *pCompressed)
/* /*
* DESCRIPTION * DESCRIPTION
* Reduce the Chroma for a specific hue and chroma to * Reduce the Chroma for a specific hue and chroma to
* to bring the given color into the gamut of the * to bring the given color into the gamut of the
* specified device. As required of gamut compression * specified device. As required of gamut compression
* functions, this routine returns pColor_in_out * functions, this routine returns pColor_in_out
* in XcmsCIEXYZFormat on successful completion. * in XcmsCIEXYZFormat on successful completion.
* *
* Since this routine works with the L* within * Since this routine works with the L* within
* pColor_in_out intermediate results may be returned * pColor_in_out intermediate results may be returned
* even though it may be invalid. * even though it may be invalid.
...@@ -111,7 +111,7 @@ XcmsCIELuvClipuv (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -111,7 +111,7 @@ XcmsCIELuvClipuv (ccc, pColors_in_out, nColors, i, pCompressed)
} }
} }
if (XcmsCIELuvQueryMaxC(ccc, if (XcmsCIELuvQueryMaxC(ccc,
degrees(XCMS_CIELUV_PMETRIC_HUE(pColor->spec.CIELuv.u_star, degrees(XCMS_CIELUV_PMETRIC_HUE(pColor->spec.CIELuv.u_star,
pColor->spec.CIELuv.v_star)), pColor->spec.CIELuv.v_star)),
pColor->spec.CIELuv.L_star, pColor->spec.CIELuv.L_star,
pColor) == XcmsFailure) { pColor) == XcmsFailure) {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -52,16 +52,16 @@ ...@@ -52,16 +52,16 @@
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsCIELuvClipL (ccc, pColors_in_out, nColors, i, pCompressed) XcmsCIELuvClipL (
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors,
unsigned int i; unsigned int i,
Bool *pCompressed; Bool *pCompressed)
/* /*
* DESCRIPTION * DESCRIPTION
* Return the closest L* for a specific hue and chroma. * Return the closest L* for a specific hue and chroma.
* This routine takes any color as input and outputs * This routine takes any color as input and outputs
* a CIE XYZ color. * a CIE XYZ color.
* *
* Since this routine works with the L* within * Since this routine works with the L* within
...@@ -95,7 +95,7 @@ XcmsCIELuvClipL (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -95,7 +95,7 @@ XcmsCIELuvClipL (ccc, pColors_in_out, nColors, i, pCompressed)
*/ */
pColor = pColors_in_out + i; pColor = pColors_in_out + i;
if (ccc->visual->class < StaticColor) { if (ccc->visual->class < StaticColor) {
/* /*
* GRAY ! * GRAY !
...@@ -136,7 +136,7 @@ XcmsCIELuvClipL (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -136,7 +136,7 @@ XcmsCIELuvClipL (ccc, pColors_in_out, nColors, i, pCompressed)
memcpy((char *)pColor, (char *)&Luv_max, sizeof(XcmsColor)); memcpy((char *)pColor, (char *)&Luv_max, sizeof(XcmsColor));
return (XcmsFailure); return (XcmsFailure);
} else if (pColor->spec.CIELuv.L_star < Luv_max.spec.CIELuv.L_star) { } else if (pColor->spec.CIELuv.L_star < Luv_max.spec.CIELuv.L_star) {
/* Find the minimum lightness for the given chroma. */ /* Find the minimum lightness for the given chroma. */
if (pColor->format != XcmsCIELuvFormat) { if (pColor->format != XcmsCIELuvFormat) {
if (_XcmsDIConvertColors(ccc, pColor, if (_XcmsDIConvertColors(ccc, pColor,
ScreenWhitePointOfCCC(ccc), 1, XcmsCIELuvFormat) ScreenWhitePointOfCCC(ccc), 1, XcmsCIELuvFormat)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -60,15 +60,15 @@ ...@@ -60,15 +60,15 @@
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsCIELuvClipLuv (ccc, pColors_in_out, nColors, i, pCompressed) XcmsCIELuvClipLuv (
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors,
unsigned int i; unsigned int i,
Bool *pCompressed; Bool *pCompressed)
/* /*
* DESCRIPTION * DESCRIPTION
* This routine will find the closest L* and chroma * This routine will find the closest L* and chroma
* for a specific hue. The color input is converted to * for a specific hue. The color input is converted to
* CIE L*u*v* format and returned as CIE XYZ format. * CIE L*u*v* format and returned as CIE XYZ format.
* *
...@@ -138,12 +138,12 @@ XcmsCIELuvClipLuv (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -138,12 +138,12 @@ XcmsCIELuvClipLuv (ccc, pColors_in_out, nColors, i, pCompressed)
chroma = XCMS_CIELUV_PMETRIC_CHROMA(pColor->spec.CIELuv.u_star, chroma = XCMS_CIELUV_PMETRIC_CHROMA(pColor->spec.CIELuv.u_star,
pColor->spec.CIELuv.v_star); pColor->spec.CIELuv.v_star);
memcpy((char *)&Luv_max, (char *)pColor, sizeof(XcmsColor)); memcpy((char *)&Luv_max, (char *)pColor, sizeof(XcmsColor));
if (_XcmsCIELuvQueryMaxLCRGB (&myCCC, hue, &Luv_max, &rgb_max) if (_XcmsCIELuvQueryMaxLCRGB (&myCCC, hue, &Luv_max, &rgb_max)
== XcmsFailure) { == XcmsFailure) {
return (XcmsFailure); return (XcmsFailure);
} }
maxLstar = Luv_max.spec.CIELuv.L_star; maxLstar = Luv_max.spec.CIELuv.L_star;
/* Now check and return the appropriate L* */ /* Now check and return the appropriate L* */
if (saveLstar == maxLstar) { if (saveLstar == maxLstar) {
/* When the L* input is equal to the maximum L* */ /* When the L* input is equal to the maximum L* */
...@@ -197,7 +197,7 @@ XcmsCIELuvClipLuv (ccc, pColors_in_out, nColors, i, pCompressed) ...@@ -197,7 +197,7 @@ XcmsCIELuvClipLuv (ccc, pColors_in_out, nColors, i, pCompressed)
bestLstar = pColor->spec.CIELuv.L_star; bestLstar = pColor->spec.CIELuv.L_star;
bestustar = pColor->spec.CIELuv.u_star; bestustar = pColor->spec.CIELuv.u_star;
bestvstar = pColor->spec.CIELuv.v_star; bestvstar = pColor->spec.CIELuv.v_star;
bestChroma = chroma; bestChroma = chroma;
} }
if (nI == nILast || nI == 0) { if (nI == nILast || nI == 0) {
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -60,11 +60,11 @@ ...@@ -60,11 +60,11 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return) XcmsCIELuvQueryMinL(
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue_angle; /* hue angle in degrees */ XcmsFloat hue_angle, /* hue angle in degrees */
XcmsFloat chroma; XcmsFloat chroma,
XcmsColor *pColor_return; XcmsColor *pColor_return)
/* /*
* DESCRIPTION * DESCRIPTION
* Return the maximum Lstar for a specified hue_angle and chroma. * Return the maximum Lstar for a specified hue_angle and chroma.
...@@ -106,7 +106,7 @@ XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return) ...@@ -106,7 +106,7 @@ XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return)
} }
while (hue_angle >= 360.0) { while (hue_angle >= 360.0) {
hue_angle -= 360.0; hue_angle -= 360.0;
} }
hue = radians(hue_angle); hue = radians(hue_angle);
tmp.spec.CIELuv.L_star = START_L_STAR; tmp.spec.CIELuv.L_star = START_L_STAR;
...@@ -114,7 +114,7 @@ XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return) ...@@ -114,7 +114,7 @@ XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return)
tmp.spec.CIELuv.v_star = XCMS_CIEVSTAROFHUE(hue, chroma); tmp.spec.CIELuv.v_star = XCMS_CIEVSTAROFHUE(hue, chroma);
tmp.pixel = pColor_return->pixel; tmp.pixel = pColor_return->pixel;
tmp.format = XcmsCIELuvFormat; tmp.format = XcmsCIELuvFormat;
/* Step 1: Obtain the maximum L_star and chroma for this hue. */ /* Step 1: Obtain the maximum L_star and chroma for this hue. */
if (_XcmsCIELuvQueryMaxLCRGB(&myCCC, hue, &max_lc, &rgb_saved) if (_XcmsCIELuvQueryMaxLCRGB(&myCCC, hue, &max_lc, &rgb_saved)
== XcmsFailure) { == XcmsFailure) {
...@@ -126,7 +126,7 @@ XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return) ...@@ -126,7 +126,7 @@ XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return)
if (max_chroma <= chroma) { if (max_chroma <= chroma) {
/* /*
* If the chroma is greater than the chroma for the * If the chroma is greater than the chroma for the
* maximum L/chroma point then the L_star is the * maximum L/chroma point then the L_star is the
* the L_star for the maximum L_star/chroma point. * the L_star for the maximum L_star/chroma point.
* This is an error but I return the best approximation I can. * This is an error but I return the best approximation I can.
...@@ -137,7 +137,7 @@ XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return) ...@@ -137,7 +137,7 @@ XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return)
} }
/* /*
* If the chroma is equal to the chroma for the * If the chroma is equal to the chroma for the
* maximum L_star/chroma point then the L_star is the * maximum L_star/chroma point then the L_star is the
* the L_star for the maximum L* and chroma point. * the L_star for the maximum L* and chroma point.
*/ */
...@@ -180,15 +180,15 @@ XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return) ...@@ -180,15 +180,15 @@ XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return)
/* Found It! */ /* Found It! */
memcpy ((char *) pColor_return, (char *) &tmp, sizeof (XcmsColor)); memcpy ((char *) pColor_return, (char *) &tmp, sizeof (XcmsColor));
return(XcmsSuccess); return(XcmsSuccess);
} }
nChroma += chroma - tmp_chroma; nChroma += chroma - tmp_chroma;
if (nChroma > max_chroma) { if (nChroma > max_chroma) {
nChroma = max_chroma; nChroma = max_chroma;
rFactor *= 0.5; /* selective relaxation employed */ rFactor *= 0.5; /* selective relaxation employed */
} else if (nChroma < 0.0) { } else if (nChroma < 0.0) {
if (XCMS_FABS(lastChroma - chroma) < if (XCMS_FABS(lastChroma - chroma) <
XCMS_FABS(tmp_chroma - chroma)) { XCMS_FABS(tmp_chroma - chroma)) {
memcpy ((char *)pColor_return, (char *)&prev, memcpy ((char *)pColor_return, (char *)&prev,
sizeof(XcmsColor)); sizeof(XcmsColor));
} else { } else {
memcpy ((char *)pColor_return, (char *)&tmp, memcpy ((char *)pColor_return, (char *)&tmp,
...@@ -202,7 +202,7 @@ XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return) ...@@ -202,7 +202,7 @@ XcmsCIELuvQueryMinL(ccc, hue_angle, chroma, pColor_return)
} }
if (nCount >= nMaxCount) { if (nCount >= nMaxCount) {
if (XCMS_FABS(lastChroma - chroma) < if (XCMS_FABS(lastChroma - chroma) <
XCMS_FABS(tmp_chroma - chroma)) { XCMS_FABS(tmp_chroma - chroma)) {
memcpy ((char *)pColor_return, (char *)&prev, memcpy ((char *)pColor_return, (char *)&prev,
sizeof(XcmsColor)); sizeof(XcmsColor));
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -63,11 +63,11 @@ ...@@ -63,11 +63,11 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIELuvQueryMaxC(ccc, hue_angle, L_star, pColor_return) XcmsCIELuvQueryMaxC(
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue_angle; /* hue angle in degrees */ XcmsFloat hue_angle, /* hue angle in degrees */
XcmsFloat L_star; XcmsFloat L_star,
XcmsColor *pColor_return; XcmsColor *pColor_return)
/* /*
* DESCRIPTION * DESCRIPTION
* Return the maximum chroma for a specific hue_angle and L_star. * Return the maximum chroma for a specific hue_angle and L_star.
...@@ -103,7 +103,7 @@ XcmsCIELuvQueryMaxC(ccc, hue_angle, L_star, pColor_return) ...@@ -103,7 +103,7 @@ XcmsCIELuvQueryMaxC(ccc, hue_angle, L_star, pColor_return)
/* Use my own CCC and inherit screen white Pt */ /* Use my own CCC and inherit screen white Pt */
memcpy ((char *)&myCCC, (char *)ccc, sizeof(XcmsCCCRec)); memcpy ((char *)&myCCC, (char *)ccc, sizeof(XcmsCCCRec));
myCCC.clientWhitePt.format = XcmsUndefinedFormat; myCCC.clientWhitePt.format = XcmsUndefinedFormat;
myCCC.gamutCompProc = (XcmsCompressionProc)NULL;/* no gamut comp func */ myCCC.gamutCompProc = (XcmsCompressionProc)NULL;/* no gamut comp func */
while (hue_angle < 0.0) { while (hue_angle < 0.0) {
...@@ -111,7 +111,7 @@ XcmsCIELuvQueryMaxC(ccc, hue_angle, L_star, pColor_return) ...@@ -111,7 +111,7 @@ XcmsCIELuvQueryMaxC(ccc, hue_angle, L_star, pColor_return)
} }
while (hue_angle >= 360.0) { while (hue_angle >= 360.0) {
hue_angle -= 360.0; hue_angle -= 360.0;
} }
hue = radians(hue_angle); hue = radians(hue_angle);
tmp.spec.CIELuv.L_star = L_star; tmp.spec.CIELuv.L_star = L_star;
...@@ -180,7 +180,7 @@ XcmsCIELuvQueryMaxC(ccc, hue_angle, L_star, pColor_return) ...@@ -180,7 +180,7 @@ XcmsCIELuvQueryMaxC(ccc, hue_angle, L_star, pColor_return)
return(XcmsSuccess); return(XcmsSuccess);
} }
if (nT > 0) { if (nT > 0) {
n_L_star += ((TOPL - n_L_star) * n_L_star += ((TOPL - n_L_star) *
(L_star - tmp.spec.CIELuv.L_star)) / (TOPL - L_star); (L_star - tmp.spec.CIELuv.L_star)) / (TOPL - L_star);
} else { } else {
n_L_star *= L_star / tmp.spec.CIELuv.L_star; n_L_star *= L_star / tmp.spec.CIELuv.L_star;
...@@ -191,7 +191,7 @@ XcmsCIELuvQueryMaxC(ccc, hue_angle, L_star, pColor_return) ...@@ -191,7 +191,7 @@ XcmsCIELuvQueryMaxC(ccc, hue_angle, L_star, pColor_return)
/* printf("rFactor = %lf\n", rFactor); */ /* printf("rFactor = %lf\n", rFactor); */
} }
} }
if (XCMS_FABS(last_L_star - L_star) < if (XCMS_FABS(last_L_star - L_star) <
XCMS_FABS(tmp.spec.CIELuv.L_star - L_star)) { XCMS_FABS(tmp.spec.CIELuv.L_star - L_star)) {
tmp.spec.CIELuv.u_star = lastuStar; tmp.spec.CIELuv.u_star = lastuStar;
tmp.spec.CIELuv.v_star = lastvStar; tmp.spec.CIELuv.v_star = lastvStar;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -60,11 +60,11 @@ ...@@ -60,11 +60,11 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return) XcmsCIELuvQueryMaxL(
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue_angle; /* hue angle in degrees */ XcmsFloat hue_angle, /* hue angle in degrees */
XcmsFloat chroma; XcmsFloat chroma,
XcmsColor *pColor_return; XcmsColor *pColor_return)
/* /*
* DESCRIPTION * DESCRIPTION
* Return the maximum Lstar for a specified hue_angle and chroma. * Return the maximum Lstar for a specified hue_angle and chroma.
...@@ -106,7 +106,7 @@ XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return) ...@@ -106,7 +106,7 @@ XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return)
} }
while (hue_angle >= 360.0) { while (hue_angle >= 360.0) {
hue_angle -= 360.0; hue_angle -= 360.0;
} }
hue = radians(hue_angle); hue = radians(hue_angle);
tmp.spec.CIELuv.L_star = START_L_STAR; tmp.spec.CIELuv.L_star = START_L_STAR;
...@@ -114,7 +114,7 @@ XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return) ...@@ -114,7 +114,7 @@ XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return)
tmp.spec.CIELuv.v_star = XCMS_CIEVSTAROFHUE(hue, chroma); tmp.spec.CIELuv.v_star = XCMS_CIEVSTAROFHUE(hue, chroma);
tmp.pixel = pColor_return->pixel; tmp.pixel = pColor_return->pixel;
tmp.format = XcmsCIELuvFormat; tmp.format = XcmsCIELuvFormat;
/* Step 1: Obtain the maximum L_star and chroma for this hue. */ /* Step 1: Obtain the maximum L_star and chroma for this hue. */
if (_XcmsCIELuvQueryMaxLCRGB(&myCCC, hue, &max_lc, &rgb_saved) if (_XcmsCIELuvQueryMaxLCRGB(&myCCC, hue, &max_lc, &rgb_saved)
== XcmsFailure) { == XcmsFailure) {
...@@ -126,7 +126,7 @@ XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return) ...@@ -126,7 +126,7 @@ XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return)
if (max_chroma <= chroma) { if (max_chroma <= chroma) {
/* /*
* If the chroma is greater than the chroma for the * If the chroma is greater than the chroma for the
* maximum L/chroma point then the L_star is the * maximum L/chroma point then the L_star is the
* the L_star for the maximum L_star/chroma point. * the L_star for the maximum L_star/chroma point.
* This is an error but I return the best approximation I can. * This is an error but I return the best approximation I can.
...@@ -137,7 +137,7 @@ XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return) ...@@ -137,7 +137,7 @@ XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return)
} }
/* /*
* If the chroma is equal to the chroma for the * If the chroma is equal to the chroma for the
* maximum L_star/chroma point then the L_star is the * maximum L_star/chroma point then the L_star is the
* the L_star for the maximum L* and chroma point. * the L_star for the maximum L* and chroma point.
*/ */
...@@ -180,13 +180,13 @@ XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return) ...@@ -180,13 +180,13 @@ XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return)
/* Found It! */ /* Found It! */
memcpy ((char *) pColor_return, (char *) &tmp, sizeof (XcmsColor)); memcpy ((char *) pColor_return, (char *) &tmp, sizeof (XcmsColor));
return(XcmsSuccess); return(XcmsSuccess);
} }
nChroma += chroma - tmp_chroma; nChroma += chroma - tmp_chroma;
if (nChroma > max_chroma) { if (nChroma > max_chroma) {
nChroma = max_chroma; nChroma = max_chroma;
rFactor *= 0.5; /* selective relaxation employed */ rFactor *= 0.5; /* selective relaxation employed */
} else if (nChroma < 0.0) { } else if (nChroma < 0.0) {
if (XCMS_FABS(lastChroma - chroma) < if (XCMS_FABS(lastChroma - chroma) <
XCMS_FABS(tmp_chroma - chroma)) { XCMS_FABS(tmp_chroma - chroma)) {
memcpy ((char *)pColor_return, (char *)&prev, memcpy ((char *)pColor_return, (char *)&prev,
sizeof(XcmsColor)); sizeof(XcmsColor));
...@@ -202,7 +202,7 @@ XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return) ...@@ -202,7 +202,7 @@ XcmsCIELuvQueryMaxL(ccc, hue_angle, chroma, pColor_return)
} }
if (nCount >= nMaxCount) { if (nCount >= nMaxCount) {
if (XCMS_FABS(lastChroma - chroma) < if (XCMS_FABS(lastChroma - chroma) <
XCMS_FABS(tmp_chroma - chroma)) { XCMS_FABS(tmp_chroma - chroma)) {
memcpy ((char *)pColor_return, (char *)&prev, memcpy ((char *)pColor_return, (char *)&prev,
sizeof(XcmsColor)); sizeof(XcmsColor));
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -96,7 +96,7 @@ _XcmsCIELuvQueryMaxLCRGB( ...@@ -96,7 +96,7 @@ _XcmsCIELuvQueryMaxLCRGB(
* XcmsFailure - Failure * XcmsFailure - Failure
* XcmsSuccess - Succeeded * XcmsSuccess - Succeeded
* *
*/ */
{ {
XcmsFloat nSmall, nLarge; XcmsFloat nSmall, nLarge;
XcmsColor tmp; XcmsColor tmp;
...@@ -113,15 +113,15 @@ _XcmsCIELuvQueryMaxLCRGB( ...@@ -113,15 +113,15 @@ _XcmsCIELuvQueryMaxLCRGB(
* out of bounds RGBi values in tmp when the ccc->gamutCompProc * out of bounds RGBi values in tmp when the ccc->gamutCompProc
* is NULL. * is NULL.
*/ */
if ((_XcmsConvertColorsWithWhitePt(ccc, &tmp, ScreenWhitePointOfCCC(ccc), if ((_XcmsConvertColorsWithWhitePt(ccc, &tmp, ScreenWhitePointOfCCC(ccc),
(unsigned int)1, XcmsRGBiFormat, (Bool *) NULL) (unsigned int)1, XcmsRGBiFormat, (Bool *) NULL)
== XcmsFailure) && tmp.format != XcmsRGBiFormat) { == XcmsFailure) && tmp.format != XcmsRGBiFormat) {
return (XcmsFailure); return (XcmsFailure);
} }
/* Now pick the smallest RGB */ /* Now pick the smallest RGB */
nSmall = MIN3(tmp.spec.RGBi.red, nSmall = MIN3(tmp.spec.RGBi.red,
tmp.spec.RGBi.green, tmp.spec.RGBi.green,
tmp.spec.RGBi.blue); tmp.spec.RGBi.blue);
/* Make the smallest RGB equal to zero */ /* Make the smallest RGB equal to zero */
tmp.spec.RGBi.red -= nSmall; tmp.spec.RGBi.red -= nSmall;
...@@ -129,8 +129,8 @@ _XcmsCIELuvQueryMaxLCRGB( ...@@ -129,8 +129,8 @@ _XcmsCIELuvQueryMaxLCRGB(
tmp.spec.RGBi.blue -= nSmall; tmp.spec.RGBi.blue -= nSmall;
/* Now pick the largest RGB */ /* Now pick the largest RGB */
nLarge = MAX3(tmp.spec.RGBi.red, nLarge = MAX3(tmp.spec.RGBi.red,
tmp.spec.RGBi.green, tmp.spec.RGBi.green,
tmp.spec.RGBi.blue); tmp.spec.RGBi.blue);
/* Scale the RGB values based on the largest one */ /* Scale the RGB values based on the largest one */
tmp.spec.RGBi.red /= nLarge; tmp.spec.RGBi.red /= nLarge;
...@@ -147,13 +147,13 @@ _XcmsCIELuvQueryMaxLCRGB( ...@@ -147,13 +147,13 @@ _XcmsCIELuvQueryMaxLCRGB(
/* Convert from RGBi to Luv */ /* Convert from RGBi to Luv */
if (_XcmsConvertColorsWithWhitePt(ccc, &tmp, if (_XcmsConvertColorsWithWhitePt(ccc, &tmp,
ScreenWhitePointOfCCC(ccc), 1, XcmsCIELuvFormat, (Bool *) NULL) ScreenWhitePointOfCCC(ccc), 1, XcmsCIELuvFormat, (Bool *) NULL)
== XcmsFailure) { == XcmsFailure) {
return (XcmsFailure); return (XcmsFailure);
} }
memcpy((char *)pColor_return, (char *)&tmp, sizeof(XcmsColor)); memcpy((char *)pColor_return, (char *)&tmp, sizeof(XcmsColor));
return (XcmsSuccess); return (XcmsSuccess);
} }
...@@ -170,10 +170,10 @@ _XcmsCIELuvQueryMaxLCRGB( ...@@ -170,10 +170,10 @@ _XcmsCIELuvQueryMaxLCRGB(
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIELuvQueryMaxLC (ccc, hue_angle, pColor_return) XcmsCIELuvQueryMaxLC (
XcmsCCC ccc; XcmsCCC ccc,
XcmsFloat hue_angle; /* hue angle in degrees */ XcmsFloat hue_angle, /* hue angle in degrees */
XcmsColor *pColor_return; XcmsColor *pColor_return)
/* /*
* DESCRIPTION * DESCRIPTION
...@@ -190,7 +190,7 @@ XcmsCIELuvQueryMaxLC (ccc, hue_angle, pColor_return) ...@@ -190,7 +190,7 @@ XcmsCIELuvQueryMaxLC (ccc, hue_angle, pColor_return)
* XcmsFailure - Failure * XcmsFailure - Failure
* XcmsSuccess - Succeeded * XcmsSuccess - Succeeded
* *
*/ */
{ {
XcmsCCCRec myCCC; XcmsCCCRec myCCC;
...@@ -200,7 +200,7 @@ XcmsCIELuvQueryMaxLC (ccc, hue_angle, pColor_return) ...@@ -200,7 +200,7 @@ XcmsCIELuvQueryMaxLC (ccc, hue_angle, pColor_return)
if (ccc == NULL || pColor_return == NULL) { if (ccc == NULL || pColor_return == NULL) {
return(XcmsFailure); return(XcmsFailure);
} }
/* Use my own CCC */ /* Use my own CCC */
memcpy ((char *)&myCCC, (char *)ccc, sizeof(XcmsCCCRec)); memcpy ((char *)&myCCC, (char *)ccc, sizeof(XcmsCCCRec));
myCCC.clientWhitePt.format = XcmsUndefinedFormat; myCCC.clientWhitePt.format = XcmsUndefinedFormat;
...@@ -211,8 +211,8 @@ XcmsCIELuvQueryMaxLC (ccc, hue_angle, pColor_return) ...@@ -211,8 +211,8 @@ XcmsCIELuvQueryMaxLC (ccc, hue_angle, pColor_return)
} }
while (hue_angle >= 360.0) { while (hue_angle >= 360.0) {
hue_angle -= 360.0; hue_angle -= 360.0;
} }
return(_XcmsCIELuvQueryMaxLCRGB (&myCCC, radians(hue_angle), pColor_return, return(_XcmsCIELuvQueryMaxLCRGB (&myCCC, radians(hue_angle), pColor_return,
(XcmsRGBi *)NULL)); (XcmsRGBi *)NULL));
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -54,15 +54,14 @@ ...@@ -54,15 +54,14 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIELuvWhiteShiftColors(ccc, pWhitePtFrom, pWhitePtTo, destSpecFmt, XcmsCIELuvWhiteShiftColors(
pColors_in_out, nColors, pCompressed) XcmsCCC ccc,
XcmsCCC ccc; XcmsColor *pWhitePtFrom,
XcmsColor *pWhitePtFrom; XcmsColor *pWhitePtTo,
XcmsColor *pWhitePtTo; XcmsColorFormat destSpecFmt,
XcmsColorFormat destSpecFmt; XcmsColor *pColors_in_out,
XcmsColor *pColors_in_out; unsigned int nColors,
unsigned int nColors; Bool *pCompressed)
Bool *pCompressed;
/* /*
* DESCRIPTION * DESCRIPTION
* Adjusts color specifications in an array of XcmsColor * Adjusts color specifications in an array of XcmsColor
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
*/ */
Display * Display *
XcmsDisplayOfCCC(ccc) XcmsDisplayOfCCC(
XcmsCCC ccc; XcmsCCC ccc)
/* /*
* DESCRIPTION * DESCRIPTION
* Queries the Display of the specified CCC. * Queries the Display of the specified CCC.
...@@ -78,8 +78,8 @@ XcmsDisplayOfCCC(ccc) ...@@ -78,8 +78,8 @@ XcmsDisplayOfCCC(ccc)
*/ */
Visual * Visual *
XcmsVisualOfCCC(ccc) XcmsVisualOfCCC(
XcmsCCC ccc; XcmsCCC ccc)
/* /*
* DESCRIPTION * DESCRIPTION
* Queries the Visual of the specified CCC. * Queries the Visual of the specified CCC.
...@@ -101,8 +101,8 @@ XcmsVisualOfCCC(ccc) ...@@ -101,8 +101,8 @@ XcmsVisualOfCCC(ccc)
*/ */
int int
XcmsScreenNumberOfCCC(ccc) XcmsScreenNumberOfCCC(
XcmsCCC ccc; XcmsCCC ccc)
/* /*
* DESCRIPTION * DESCRIPTION
* Queries the screen number of the specified CCC. * Queries the screen number of the specified CCC.
...@@ -124,8 +124,8 @@ XcmsScreenNumberOfCCC(ccc) ...@@ -124,8 +124,8 @@ XcmsScreenNumberOfCCC(ccc)
*/ */
XcmsColor * XcmsColor *
XcmsScreenWhitePointOfCCC(ccc) XcmsScreenWhitePointOfCCC(
XcmsCCC ccc; XcmsCCC ccc)
/* /*
* DESCRIPTION * DESCRIPTION
* Queries the screen white point of the specified CCC. * Queries the screen white point of the specified CCC.
...@@ -147,8 +147,8 @@ XcmsScreenWhitePointOfCCC(ccc) ...@@ -147,8 +147,8 @@ XcmsScreenWhitePointOfCCC(ccc)
*/ */
XcmsColor * XcmsColor *
XcmsClientWhitePointOfCCC(ccc) XcmsClientWhitePointOfCCC(
XcmsCCC ccc; XcmsCCC ccc)
/* /*
* DESCRIPTION * DESCRIPTION
* Queries the client white point of the specified CCC. * Queries the client white point of the specified CCC.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
* SYNOPSIS * SYNOPSIS
*/ */
char * char *
XcmsPrefixOfFormat(id) XcmsPrefixOfFormat(
XcmsColorFormat id; XcmsColorFormat id)
/* /*
* DESCRIPTION * DESCRIPTION
* Returns the color space prefix for the specified color * Returns the color space prefix for the specified color
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
*/ */
Status Status
XcmsQueryBlack(ccc, target_format, pColor_ret) XcmsQueryBlack(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColorFormat target_format; XcmsColorFormat target_format,
XcmsColor *pColor_ret; XcmsColor *pColor_ret)
/* /*
* DESCRIPTION * DESCRIPTION
* Returns the color specification in the target format for * Returns the color specification in the target format for
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
*/ */
Status Status
XcmsQueryBlue(ccc, target_format, pColor_ret) XcmsQueryBlue(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColorFormat target_format; XcmsColorFormat target_format,
XcmsColor *pColor_ret; XcmsColor *pColor_ret)
/* /*
* DESCRIPTION * DESCRIPTION
* Returns the color specification in the target format for * Returns the color specification in the target format for
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
*/ */
Status Status
XcmsQueryGreen(ccc, target_format, pColor_ret) XcmsQueryGreen(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColorFormat target_format; XcmsColorFormat target_format,
XcmsColor *pColor_ret; XcmsColor *pColor_ret)
/* /*
* DESCRIPTION * DESCRIPTION
* Returns the color specification in the target format for * Returns the color specification in the target format for
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
*/ */
Status Status
XcmsQueryRed(ccc, target_format, pColor_ret) XcmsQueryRed(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColorFormat target_format; XcmsColorFormat target_format,
XcmsColor *pColor_ret; XcmsColor *pColor_ret)
/* /*
* DESCRIPTION * DESCRIPTION
* Returns the color specification in the target format for * Returns the color specification in the target format for
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
*/ */
Status Status
XcmsQueryWhite(ccc, target_format, pColor_ret) XcmsQueryWhite(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColorFormat target_format; XcmsColorFormat target_format,
XcmsColor *pColor_ret; XcmsColor *pColor_ret)
/* /*
* DESCRIPTION * DESCRIPTION
* Returns the color specification in the target format for * Returns the color specification in the target format for
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -53,11 +53,11 @@ ...@@ -53,11 +53,11 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsQueryColor(dpy, colormap, pXcmsColor_in_out, result_format) XcmsQueryColor(
Display *dpy; Display *dpy,
Colormap colormap; Colormap colormap,
XcmsColor *pXcmsColor_in_out; XcmsColor *pXcmsColor_in_out,
XcmsColorFormat result_format; XcmsColorFormat result_format)
/* /*
* DESCRIPTION * DESCRIPTION
* This routine uses XQueryColor to obtain the X RGB values * This routine uses XQueryColor to obtain the X RGB values
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -52,12 +52,12 @@ ...@@ -52,12 +52,12 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsQueryColors(dpy, colormap, pXcmsColors_in_out, nColors, result_format) XcmsQueryColors(
Display *dpy; Display *dpy,
Colormap colormap; Colormap colormap,
XcmsColor *pXcmsColors_in_out; XcmsColor *pXcmsColors_in_out,
unsigned int nColors; unsigned int nColors,
XcmsColorFormat result_format; XcmsColorFormat result_format)
/* /*
* DESCRIPTION * DESCRIPTION
* This routine uses XQueryColors to obtain the X RGB values * This routine uses XQueryColors to obtain the X RGB values
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -55,9 +55,9 @@ ...@@ -55,9 +55,9 @@
*/ */
Status Status
XcmsSetWhitePoint(ccc, pColor) XcmsSetWhitePoint(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pColor; XcmsColor *pColor)
/* /*
* DESCRIPTION * DESCRIPTION
* Sets the Client White Point in the specified CCC. * Sets the Client White Point in the specified CCC.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
/* /*
* NAME * NAME
* XcmsSetColor - * XcmsSetColor -
* *
* SYNOPSIS * SYNOPSIS
*/ */
...@@ -170,7 +170,7 @@ Query: ...@@ -170,7 +170,7 @@ Query:
/* /*
* NAME * NAME
* XcmsSetColors - * XcmsSetColors -
* *
* SYNOPSIS * SYNOPSIS
*/ */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -53,10 +53,10 @@ ...@@ -53,10 +53,10 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsStoreColor(dpy, colormap, pColor_in) XcmsStoreColor(
Display *dpy; Display *dpy,
Colormap colormap; Colormap colormap,
XcmsColor *pColor_in; XcmsColor *pColor_in)
/* /*
* DESCRIPTION * DESCRIPTION
* Given a device-dependent or device-independent color * Given a device-dependent or device-independent color
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -53,13 +53,12 @@ ...@@ -53,13 +53,12 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsStoreColors(dpy, colormap, pColors_in, XcmsStoreColors(
nColors, pCompressed) Display *dpy,
Display *dpy; Colormap colormap,
Colormap colormap; XcmsColor *pColors_in,
XcmsColor *pColors_in; unsigned int nColors,
unsigned int nColors; Bool *pCompressed)
Bool *pCompressed;
/* /*
* DESCRIPTION * DESCRIPTION
* Given device-dependent or device-independent color * Given device-dependent or device-independent color
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -74,7 +74,7 @@ static unsigned short const MASK[17] = { ...@@ -74,7 +74,7 @@ static unsigned short const MASK[17] = {
/* /*
* NAME * NAME
* _XcmsRGB_to_XColor - * _XcmsRGB_to_XColor -
* *
* SYNOPSIS * SYNOPSIS
*/ */
...@@ -161,7 +161,7 @@ _XcmsResolveColor( ...@@ -161,7 +161,7 @@ _XcmsResolveColor(
* On a display with N-bit DACs, the "hardware" color is computed as: * On a display with N-bit DACs, the "hardware" color is computed as:
* *
* ((unsignedlong)(ClientValue >> (16-N)) * 0xFFFF) / ((1 << N) - 1) * ((unsignedlong)(ClientValue >> (16-N)) * 0xFFFF) / ((1 << N) - 1)
* *
* *
* RETURNS * RETURNS
* void. * void.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -142,7 +142,24 @@ CIEXYZ_ParseString( ...@@ -142,7 +142,24 @@ CIEXYZ_ParseString(
&pColor->spec.CIEXYZ.X, &pColor->spec.CIEXYZ.X,
&pColor->spec.CIEXYZ.Y, &pColor->spec.CIEXYZ.Y,
&pColor->spec.CIEXYZ.Z) != 3) { &pColor->spec.CIEXYZ.Z) != 3) {
return(XcmsFailure); char *s; /* Maybe failed due to locale */
int f;
if ((s = strdup(spec))) {
for (f = 0; s[f]; ++f)
if (s[f] == '.')
s[f] = ',';
else if (s[f] == ',')
s[f] = '.';
if (sscanf(s + n + 1, "%lf/%lf/%lf",
&pColor->spec.CIEXYZ.X,
&pColor->spec.CIEXYZ.Y,
&pColor->spec.CIEXYZ.Z) != 3) {
free(s);
return(XcmsFailure);
}
free(s);
} else
return(XcmsFailure);
} }
pColor->format = XcmsCIEXYZFormat; pColor->format = XcmsCIEXYZFormat;
pColor->pixel = 0; pColor->pixel = 0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -47,11 +47,11 @@ ...@@ -47,11 +47,11 @@
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsAllocColor(dpy, colormap, pXcmsColor_in_out, result_format) XcmsAllocColor(
Display *dpy; Display *dpy,
Colormap colormap; Colormap colormap,
XcmsColor *pXcmsColor_in_out; XcmsColor *pXcmsColor_in_out,
XcmsColorFormat result_format; XcmsColorFormat result_format)
/* /*
* DESCRIPTION * DESCRIPTION
* Given a device-dependent or device-independent color * Given a device-dependent or device-independent color
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
/* /*
* NAME * NAME
* XcmsAllocNamedColor - * XcmsAllocNamedColor -
* *
* SYNOPSIS * SYNOPSIS
*/ */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -142,7 +142,7 @@ CmapRecForColormap( ...@@ -142,7 +142,7 @@ CmapRecForColormap(
visualTemplate.screen = i; visualTemplate.screen = i;
visualList = XGetVisualInfo(dpy, VisualScreenMask, &visualTemplate, visualList = XGetVisualInfo(dpy, VisualScreenMask, &visualTemplate,
&nVisualsMatched); &nVisualsMatched);
if (nVisualsMatched == 0) { if (visualList == NULL) {
continue; continue;
} }
...@@ -232,11 +232,11 @@ CmapRecForColormap( ...@@ -232,11 +232,11 @@ CmapRecForColormap(
* SYNOPSIS * SYNOPSIS
*/ */
XcmsCmapRec * XcmsCmapRec *
_XcmsAddCmapRec(dpy, cmap, windowID, visual) _XcmsAddCmapRec(
Display *dpy; Display *dpy,
Colormap cmap; Colormap cmap,
Window windowID; Window windowID,
Visual *visual; Visual *visual)
/* /*
* DESCRIPTION * DESCRIPTION
* Create an XcmsCmapRec for the specified cmap, windowID, * Create an XcmsCmapRec for the specified cmap, windowID,
...@@ -407,10 +407,10 @@ _XcmsFreeClientCmaps( ...@@ -407,10 +407,10 @@ _XcmsFreeClientCmaps(
* *
* SYNOPSIS * SYNOPSIS
*/ */
XcmsCCC XcmsCCC
XcmsCCCOfColormap(dpy, cmap) XcmsCCCOfColormap(
Display *dpy; Display *dpy,
Colormap cmap; Colormap cmap)
/* /*
* DESCRIPTION * DESCRIPTION
* Finds the XcmsCCC associated with the specified colormap. * Finds the XcmsCCC associated with the specified colormap.
...@@ -476,10 +476,10 @@ XcmsCCCOfColormap(dpy, cmap) ...@@ -476,10 +476,10 @@ XcmsCCCOfColormap(dpy, cmap)
return(NULL); return(NULL);
} }
XcmsCCC XcmsSetCCCOfColormap(dpy, cmap, ccc) XcmsCCC XcmsSetCCCOfColormap(
Display *dpy; Display *dpy,
Colormap cmap; Colormap cmap,
XcmsCCC ccc; XcmsCCC ccc)
{ {
XcmsCCC prev_ccc = NULL; XcmsCCC prev_ccc = NULL;
XcmsCmapRec *pRec; XcmsCmapRec *pRec;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -184,7 +184,7 @@ _XcmsParseColorString( ...@@ -184,7 +184,7 @@ _XcmsParseColorString(
* DESCRIPTION * DESCRIPTION
* Assuming color_string contains a numerical string color * Assuming color_string contains a numerical string color
* specification, attempts to parse a string into an * specification, attempts to parse a string into an
* XcmsColor structure. * XcmsColor structure.
* *
* RETURNS * RETURNS
* 0 if failed; otherwise non-zero. * 0 if failed; otherwise non-zero.
...@@ -467,7 +467,7 @@ Retry: ...@@ -467,7 +467,7 @@ Retry:
pair->flag = CYCLE; pair->flag = CYCLE;
return(XcmsFailure); return(XcmsFailure);
} }
if (_XcmsParseColorString(ccc, pair->second, pColor) == XcmsSuccess) { if (_XcmsParseColorString(ccc, pair->second, pColor) == XcmsSuccess) {
/* f2 contains a numerical string specification */ /* f2 contains a numerical string specification */
return(XcmsSuccess); return(XcmsSuccess);
...@@ -706,7 +706,7 @@ LoadColornameDB(void) ...@@ -706,7 +706,7 @@ LoadColornameDB(void)
{ {
int size; int size;
FILE *stream; FILE *stream;
char *pathname; const char *pathname;
struct stat txt; struct stat txt;
int length; int length;
...@@ -732,10 +732,17 @@ LoadColornameDB(void) ...@@ -732,10 +732,17 @@ LoadColornameDB(void)
} }
if ((stream = _XFopenFile (pathname, "r")) == NULL) { if ((stream = _XFopenFile (pathname, "r")) == NULL) {
/* can't open file */
XcmsColorDbState = XcmsDbInitFailure;
return(XcmsFailure); return(XcmsFailure);
} }
stringSectionSize(stream, &nEntries, &size); if (stringSectionSize(stream, &nEntries, &size) != XcmsSuccess ||
nEntries == 0) {
(void) fclose(stream);
XcmsColorDbState = XcmsDbInitFailure;
return(XcmsFailure);
}
rewind(stream); rewind(stream);
strings = (char *) Xmalloc(size); strings = (char *) Xmalloc(size);
...@@ -806,7 +813,7 @@ _XcmsCopyISOLatin1Lowered( ...@@ -806,7 +813,7 @@ _XcmsCopyISOLatin1Lowered(
/* /*
* NAME * NAME
* _XcmsResolveColorString - * _XcmsResolveColorString -
* *
* SYNOPSIS * SYNOPSIS
*/ */
...@@ -862,7 +869,7 @@ _XcmsResolveColorString ( ...@@ -862,7 +869,7 @@ _XcmsResolveColorString (
if (result_format != XcmsUndefinedFormat if (result_format != XcmsUndefinedFormat
&& pColor_exact_return->format != result_format) { && pColor_exact_return->format != result_format) {
/* need to be converted to the target format */ /* need to be converted to the target format */
return(XcmsConvertColors(ccc, pColor_exact_return, 1, return(XcmsConvertColors(ccc, pColor_exact_return, 1,
result_format, (Bool *)NULL)); result_format, (Bool *)NULL));
} else { } else {
return(XcmsSuccess); return(XcmsSuccess);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -186,7 +186,7 @@ _XcmsInitDefaultCCCs( ...@@ -186,7 +186,7 @@ _XcmsInitDefaultCCCs(
if (!(ccc = (XcmsCCC) if (!(ccc = (XcmsCCC)
Xcalloc((unsigned)nScrn, (unsigned) sizeof(XcmsCCCRec)))) { Xcalloc((unsigned)nScrn, (unsigned) sizeof(XcmsCCCRec)))) {
return(0); return(0);
} }
dpy->cms.defaultCCCs = (XPointer)ccc; dpy->cms.defaultCCCs = (XPointer)ccc;
dpy->free_funcs->defaultCCCs = _XcmsFreeDefaultCCCs; dpy->free_funcs->defaultCCCs = _XcmsFreeDefaultCCCs;
...@@ -325,7 +325,7 @@ _XcmsInitScrnInfo( ...@@ -325,7 +325,7 @@ _XcmsInitScrnInfo(
if (!(defaultccc->pPerScrnInfo = (XcmsPerScrnInfo *) if (!(defaultccc->pPerScrnInfo = (XcmsPerScrnInfo *)
Xcalloc(1, (unsigned) sizeof(XcmsPerScrnInfo)))) { Xcalloc(1, (unsigned) sizeof(XcmsPerScrnInfo)))) {
return(0); return(0);
} }
defaultccc->pPerScrnInfo->state = XcmsInitNone; defaultccc->pPerScrnInfo->state = XcmsInitNone;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
/* /*
* NAME * NAME
* XcmsLookupColor - * XcmsLookupColor -
* *
* SYNOPSIS * SYNOPSIS
*/ */
......
...@@ -51,8 +51,7 @@ int sqrt_loopcount; ...@@ -51,8 +51,7 @@ int sqrt_loopcount;
/* for cube roots, x^3 - a = 0, x_new = x - 1/3 (x - a/x^2) */ /* for cube roots, x^3 - a = 0, x_new = x - 1/3 (x - a/x^2) */
double double
_XcmsCubeRoot(a) _XcmsCubeRoot(double a)
double a;
{ {
register double abs_a, cur_guess, delta; register double abs_a, cur_guess, delta;
...@@ -90,14 +89,13 @@ _XcmsCubeRoot(a) ...@@ -90,14 +89,13 @@ _XcmsCubeRoot(a)
#endif #endif
return cur_guess; return cur_guess;
} }
/* for square roots, x^2 - a = 0, x_new = x - 1/2 (x - a/x) */ /* for square roots, x^2 - a = 0, x_new = x - 1/2 (x - a/x) */
double double
_XcmsSquareRoot(a) _XcmsSquareRoot(double a)
double a;
{ {
register double cur_guess, delta; register double cur_guess, delta;
...@@ -135,4 +133,4 @@ _XcmsSquareRoot(a) ...@@ -135,4 +133,4 @@ _XcmsSquareRoot(a)
#endif #endif
return cur_guess; return cur_guess;
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -125,10 +125,10 @@ _XcmsGetProperty( ...@@ -125,10 +125,10 @@ _XcmsGetProperty(
unsigned long nitems_ret, after_ret; unsigned long nitems_ret, after_ret;
#endif #endif
Atom atom_ret; Atom atom_ret;
while (XGetWindowProperty (pDpy, w, property, 0, len, False, while (XGetWindowProperty (pDpy, w, property, 0, len, False,
XA_INTEGER, &atom_ret, &format_ret, XA_INTEGER, &atom_ret, &format_ret,
&nitems_ret, &after_ret, &nitems_ret, &after_ret,
(unsigned char **)&prop_ret)) { (unsigned char **)&prop_ret)) {
if (after_ret > 0) { if (after_ret > 0) {
len += nitems_ret * (format_ret >> 3); len += nitems_ret * (format_ret >> 3);
...@@ -137,7 +137,7 @@ _XcmsGetProperty( ...@@ -137,7 +137,7 @@ _XcmsGetProperty(
break; break;
} }
} }
if (format_ret == 0 || nitems_ret == 0) { if (format_ret == 0 || nitems_ret == 0) {
/* the property does not exist or is of an unexpected type */ /* the property does not exist or is of an unexpected type */
return(XcmsFailure); return(XcmsFailure);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -159,7 +159,7 @@ static double const sin_qcoeffs[] = { ...@@ -159,7 +159,7 @@ static double const sin_qcoeffs[] = {
* to the range over which the polynomial approximation * to the range over which the polynomial approximation
* is valid, and as the polynomial is evaluated using * is valid, and as the polynomial is evaluated using
* finite-precision arithmetic. * finite-precision arithmetic.
* *
* PROGRAMMER * PROGRAMMER
* *
* Fred Fish * Fred Fish
...@@ -219,7 +219,7 @@ static double const sin_qcoeffs[] = { ...@@ -219,7 +219,7 @@ static double const sin_qcoeffs[] = {
* HART satisfies this requirement, although not explicitly * HART satisfies this requirement, although not explicitly
* stated in the text. This may not be true of other * stated in the text. This may not be true of other
* approximations given in the reference. * approximations given in the reference.
* *
*/ */
double _XcmsCosine(double x) double _XcmsCosine(double x)
...@@ -438,7 +438,7 @@ static double _XcmsPolynomial( ...@@ -438,7 +438,7 @@ static double _XcmsPolynomial(
* to the range over which the polynomial approximation * to the range over which the polynomial approximation
* is valid, and as the polynomial is evaluated using * is valid, and as the polynomial is evaluated using
* finite-precision arithmetic. * finite-precision arithmetic.
* *
* PROGRAMMER * PROGRAMMER
* *
* Fred Fish * Fred Fish
...@@ -499,12 +499,11 @@ static double _XcmsPolynomial( ...@@ -499,12 +499,11 @@ static double _XcmsPolynomial(
* HART satisfies this requirement, although not explicitly * HART satisfies this requirement, although not explicitly
* stated in the text. This may not be true of other * stated in the text. This may not be true of other
* approximations given in the reference. * approximations given in the reference.
* *
*/ */
double double
_XcmsSine (x) _XcmsSine (double x)
double x;
{ {
double y; double y;
double yt2; double yt2;
...@@ -544,8 +543,7 @@ double x; ...@@ -544,8 +543,7 @@ double x;
* SYNOPSIS * SYNOPSIS
*/ */
double double
_XcmsArcTangent(x) _XcmsArcTangent(double x)
double x;
/* /*
* DESCRIPTION * DESCRIPTION
* Computes the arctangent. * Computes the arctangent.
...@@ -555,7 +553,7 @@ _XcmsArcTangent(x) ...@@ -555,7 +553,7 @@ _XcmsArcTangent(x)
* New York, NY, Harper & Row, 1970. * New York, NY, Harper & Row, 1970.
* *
* RETURNS * RETURNS
* Returns the arctangent * Returns the arctangent
*/ */
{ {
double ai, a1 = 0.0, bi, b1 = 0.0, l, d; double ai, a1 = 0.0, bi, b1 = 0.0, l, d;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of XCMS based on the TekColor Color Management System. Permission is * of XCMS based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -157,7 +157,24 @@ CIEuvY_ParseString( ...@@ -157,7 +157,24 @@ CIEuvY_ParseString(
&pColor->spec.CIEuvY.u_prime, &pColor->spec.CIEuvY.u_prime,
&pColor->spec.CIEuvY.v_prime, &pColor->spec.CIEuvY.v_prime,
&pColor->spec.CIEuvY.Y) != 3) { &pColor->spec.CIEuvY.Y) != 3) {
return(XcmsFailure); char *s; /* Maybe failed due to locale */
int f;
if ((s = strdup(spec))) {
for (f = 0; s[f]; ++f)
if (s[f] == '.')
s[f] = ',';
else if (s[f] == ',')
s[f] = '.';
if (sscanf(s + n + 1, "%lf/%lf/%lf",
&pColor->spec.CIEuvY.u_prime,
&pColor->spec.CIEuvY.v_prime,
&pColor->spec.CIEuvY.Y) != 3) {
free(s);
return(XcmsFailure);
}
free(s);
} else
return(XcmsFailure);
} }
pColor->format = XcmsCIEuvYFormat; pColor->format = XcmsCIEuvYFormat;
pColor->pixel = 0; pColor->pixel = 0;
...@@ -208,11 +225,11 @@ _XcmsCIEuvY_ValidSpec( ...@@ -208,11 +225,11 @@ _XcmsCIEuvY_ValidSpec(
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIEuvYToCIEXYZ(ccc, puvY_WhitePt, pColors_in_out, nColors) XcmsCIEuvYToCIEXYZ(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *puvY_WhitePt; XcmsColor *puvY_WhitePt,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors)
/* /*
* DESCRIPTION * DESCRIPTION
* Converts color specifications in an array of XcmsColor * Converts color specifications in an array of XcmsColor
...@@ -323,11 +340,11 @@ XcmsCIEuvYToCIEXYZ(ccc, puvY_WhitePt, pColors_in_out, nColors) ...@@ -323,11 +340,11 @@ XcmsCIEuvYToCIEXYZ(ccc, puvY_WhitePt, pColors_in_out, nColors)
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIEXYZToCIEuvY(ccc, puvY_WhitePt, pColors_in_out, nColors) XcmsCIEXYZToCIEuvY(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *puvY_WhitePt; XcmsColor *puvY_WhitePt,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors)
/* /*
* DESCRIPTION * DESCRIPTION
* Converts color specifications in an array of XcmsColor * Converts color specifications in an array of XcmsColor
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
* All Rights Reserved * All Rights Reserved
* *
* This file is a component of an X Window System-specific implementation * This file is a component of an X Window System-specific implementation
* of Xcms based on the TekColor Color Management System. Permission is * of Xcms based on the TekColor Color Management System. Permission is
* hereby granted to use, copy, modify, sell, and otherwise distribute this * hereby granted to use, copy, modify, sell, and otherwise distribute this
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
* that this copyright, permission, and disclaimer notice is reproduced in * that this copyright, permission, and disclaimer notice is reproduced in
* all copies of this software and in supporting documentation. TekColor * all copies of this software and in supporting documentation. TekColor
* is a trademark of Tektronix, Inc. * is a trademark of Tektronix, Inc.
* *
* Tektronix makes no representation about the suitability of this software * Tektronix makes no representation about the suitability of this software
* for any purpose. It is provided "as is" and with all faults. * for any purpose. It is provided "as is" and with all faults.
* *
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
...@@ -156,7 +156,24 @@ CIExyY_ParseString( ...@@ -156,7 +156,24 @@ CIExyY_ParseString(
&pColor->spec.CIExyY.x, &pColor->spec.CIExyY.x,
&pColor->spec.CIExyY.y, &pColor->spec.CIExyY.y,
&pColor->spec.CIExyY.Y) != 3) { &pColor->spec.CIExyY.Y) != 3) {
return(XcmsFailure); char *s; /* Maybe failed due to locale */
int f;
if ((s = strdup(spec))) {
for (f = 0; s[f]; ++f)
if (s[f] == '.')
s[f] = ',';
else if (s[f] == ',')
s[f] = '.';
if (sscanf(s + n + 1, "%lf/%lf/%lf",
&pColor->spec.CIExyY.x,
&pColor->spec.CIExyY.y,
&pColor->spec.CIExyY.Y) != 3) {
free(s);
return(XcmsFailure);
}
free(s);
} else
return(XcmsFailure);
} }
pColor->format = XcmsCIExyYFormat; pColor->format = XcmsCIExyYFormat;
pColor->pixel = 0; pColor->pixel = 0;
...@@ -216,11 +233,11 @@ XcmsCIExyY_ValidSpec( ...@@ -216,11 +233,11 @@ XcmsCIExyY_ValidSpec(
* SYNOPSIS * SYNOPSIS
*/ */
Status Status
XcmsCIExyYToCIEXYZ(ccc, pxyY_WhitePt, pColors_in_out, nColors) XcmsCIExyYToCIEXYZ(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pxyY_WhitePt; XcmsColor *pxyY_WhitePt,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors)
/* /*
* DESCRIPTION * DESCRIPTION
* Converts color specifications in an array of XcmsColor * Converts color specifications in an array of XcmsColor
...@@ -323,11 +340,11 @@ XcmsCIExyYToCIEXYZ(ccc, pxyY_WhitePt, pColors_in_out, nColors) ...@@ -323,11 +340,11 @@ XcmsCIExyYToCIEXYZ(ccc, pxyY_WhitePt, pColors_in_out, nColors)
*/ */
/* ARGSUSED */ /* ARGSUSED */
Status Status
XcmsCIEXYZToCIExyY(ccc, pxyY_WhitePt, pColors_in_out, nColors) XcmsCIEXYZToCIExyY(
XcmsCCC ccc; XcmsCCC ccc,
XcmsColor *pxyY_WhitePt; XcmsColor *pxyY_WhitePt,
XcmsColor *pColors_in_out; XcmsColor *pColors_in_out,
unsigned int nColors; unsigned int nColors)
/* /*
* DESCRIPTION * DESCRIPTION
* Converts color specifications in an array of XcmsColor * Converts color specifications in an array of XcmsColor
...@@ -363,7 +380,7 @@ XcmsCIEXYZToCIExyY(ccc, pxyY_WhitePt, pColors_in_out, nColors) ...@@ -363,7 +380,7 @@ XcmsCIEXYZToCIExyY(ccc, pxyY_WhitePt, pColors_in_out, nColors)
/* Now convert for XYZ to xyY */ /* Now convert for XYZ to xyY */
if ((div = pColor->spec.CIEXYZ.X + pColor->spec.CIEXYZ.Y + pColor->spec.CIEXYZ.Z) == 0.0) { if ((div = pColor->spec.CIEXYZ.X + pColor->spec.CIEXYZ.Y + pColor->spec.CIEXYZ.Z) == 0.0) {
div = EPS; div = EPS;
} }
xyY_return.x = pColor->spec.CIEXYZ.X / div; xyY_return.x = pColor->spec.CIEXYZ.X / div;
xyY_return.y = pColor->spec.CIEXYZ.Y / div; xyY_return.y = pColor->spec.CIEXYZ.Y / div;
xyY_return.Y = pColor->spec.CIEXYZ.Y; xyY_return.Y = pColor->spec.CIEXYZ.Y;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment