1
/* $Xorg: StCols.c,v 1.3 2000/08/17 19:44:56 cpqbld Exp $ */
4
* Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
7
* This file is a component of an X Window System-specific implementation
8
* of Xcms based on the TekColor Color Management System. Permission is
9
* hereby granted to use, copy, modify, sell, and otherwise distribute this
10
* software and its documentation for any purpose and without fee, provided
11
* that this copyright, permission, and disclaimer notice is reproduced in
12
* all copies of this software and in supporting documentation. TekColor
13
* is a trademark of Tektronix, Inc.
15
* Tektronix makes no representation about the suitability of this software
16
* for any purpose. It is provided "as is" and with all faults.
18
* TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE,
19
* INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20
* PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY
21
* SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
22
* RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF
23
* CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
24
* CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE.
31
* Source for XcmsStoreColors
35
/* $XFree86: xc/lib/X11/StCols.c,v 1.3 2001/01/17 19:41:44 dawes Exp $ */
43
extern Status _XcmsSetGetColors();
46
/************************************************************************
50
************************************************************************/
54
* XcmsStoreColors - Store Colors
59
XcmsStoreColors(dpy, colormap, pColors_in,
63
XcmsColor *pColors_in;
68
* Given device-dependent or device-independent color
69
* specifications, this routine will convert them to X RGB
70
* values then use it in a call to XStoreColors.
73
* XcmsFailure if failed;
74
* XcmsSuccess if it succeeded without gamut compression;
75
* XcmsSuccessWithCompression if it succeeded with gamut
78
* Since XStoreColors has no return value, this routine
79
* does not return color specifications of the colors actually
84
XcmsColor *pColors_tmp;
88
* Make copy of array of color specifications so we don't
89
* overwrite the contents.
92
pColors_tmp = (XcmsColor *) Xmalloc(nColors * sizeof(XcmsColor));
94
pColors_tmp = &Color1;
96
memcpy((char *)pColors_tmp, (char *)pColors_in,
97
nColors * sizeof(XcmsColor));
100
* Call routine to store colors using the copied color structures
102
retval = _XcmsSetGetColors (XStoreColors, dpy, colormap,
103
pColors_tmp, nColors, XcmsRGBFormat, pCompressed);
106
* Free copies as needed.
109
Xfree((char *)pColors_tmp);
113
* Ah, finally return.