3 * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
6 * This file is a component of an X Window System-specific implementation
7 * of Xcms based on the TekColor Color Management System. Permission is
8 * hereby granted to use, copy, modify, sell, and otherwise distribute this
9 * software and its documentation for any purpose and without fee, provided
10 * that this copyright, permission, and disclaimer notice is reproduced in
11 * all copies of this software and in supporting documentation. TekColor
12 * is a trademark of Tektronix, Inc.
14 * Tektronix makes no representation about the suitability of this software
15 * for any purpose. It is provided "as is" and with all faults.
17 * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
18 * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
19 * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
20 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
21 * RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF
22 * CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
23 * CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE.
30 * Source for XcmsStoreColors
43 /************************************************************************
47 ************************************************************************/
51 * XcmsStoreColors - Store Colors
59 XcmsColor *pColors_in,
64 * Given device-dependent or device-independent color
65 * specifications, this routine will convert them to X RGB
66 * values then use it in a call to XStoreColors.
69 * XcmsFailure if failed;
70 * XcmsSuccess if it succeeded without gamut compression;
71 * XcmsSuccessWithCompression if it succeeded with gamut
74 * Since XStoreColors has no return value, this routine
75 * does not return color specifications of the colors actually
80 XcmsColor *pColors_tmp;
84 * Make copy of array of color specifications so we don't
85 * overwrite the contents.
88 pColors_tmp = (XcmsColor *) Xmalloc(nColors * sizeof(XcmsColor));
90 pColors_tmp = &Color1;
92 memcpy((char *)pColors_tmp, (char *)pColors_in,
93 nColors * sizeof(XcmsColor));
96 * Call routine to store colors using the copied color structures
98 retval = _XcmsSetGetColors (XStoreColors, dpy, colormap,
99 pColors_tmp, nColors, XcmsRGBFormat, pCompressed);
102 * Free copies as needed.
105 Xfree((char *)pColors_tmp);
109 * Ah, finally return.