1
/* Copyright (C) 2001-2006 Artifex Software, Inc.
4
This software is provided AS-IS with no warranty, either express or
7
This software is distributed under license and may not be copied, modified
8
or distributed except as expressly authorized under the terms of that
9
license. Refer to licensing information at http://www.artifex.com/
10
or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
11
San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
14
/* $Id: gscssub.h 8022 2007-06-05 22:23:38Z giles $ */
15
/* Client interface to color space substitution */
17
#ifndef gscssub_INCLUDED
18
# define gscssub_INCLUDED
23
* Color space substitution at the library level is similar to, but not
24
* identical to, the operation of UseCIEColor in the PostScript language.
25
* When the Boolean UseCIEColor parameter of the current device is false,
26
* everything operates as normal. When UseCIEColor is true, the following
27
* procedures may substitute another color space for the implied one:
29
* gs_setgray, gs_setrgbcolor, gs_sethsbcolor, gs_setcmykcolor
30
* gs_current_Device{Gray,RGB,CMYK}_space
32
* Unlike the PostScript facility, the substitution *is* visible to
33
* gs_currentcolorspace, and does *not* affect gs_setcolorspace, or the
34
* ColorSpace members of images or shadings. However, the following
35
* procedures recognize when substitution has occurred and return the
36
* value(s) appropriate for the pre-substitution space:
38
* gs_currentgray, gs_currentrgbcolor, gs_currenthsbcolor,
41
* Thus gs_{current,set}{gray,{rgb,hsb,cmyk}color} are always mutually
42
* consistent, concealing any substitution, and gs_{current,set}{colorspace}
43
* are mutually consistent, reflecting any substitution.
44
* gs_{current,set}color are consistent with the other color accessors,
45
* since color space substitution doesn't affect color values.
47
* As in PostScript, color space substitutions are not affected by
48
* (ordinary) grestore or by setgstate. Graphics states created by gsave or
49
* gstate, or overwritten by currentgstate or copygstate, share
50
* substitutions with the state from which they were copied.
53
/* If pcs is NULL, it means undo any substitution. */
54
int gs_setsubstitutecolorspace(gs_state *pgs, gs_color_space_index csi,
55
const gs_color_space *pcs);
56
const gs_color_space *
57
gs_currentsubstitutecolorspace(const gs_state *pgs,
58
gs_color_space_index csi);
61
* The following procedures are primarily for internal use, to provide
62
* fast access to specific color spaces.
64
const gs_color_space *gs_current_DeviceGray_space(const gs_state *pgs);
65
const gs_color_space *gs_current_DeviceRGB_space(const gs_state *pgs);
66
const gs_color_space *gs_current_DeviceCMYK_space(const gs_state *pgs);
68
#endif /* gscssub_INCLUDED */