1 /* Copyright (C) 2001-2006 Artifex Software, Inc.
2 All Rights Reserved.
3
4 This software is provided AS-IS with no warranty, either express or
5 implied.
6
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.
12 */
13
14 /* $Id: zcolor2.c 9043 2008-08-28 22:48:19Z giles $ */
15 /* Level 2 color operators */
16 #include "ghost.h"
17 #include "string_.h"
18 #include "oper.h"
19 #include "gsmatrix.h"
20 #include "gsstruct.h"
21 #include "gxcspace.h"
22 #include "gscolor2.h"
23 #include "igstate.h"
24 #include "store.h"
25
26
27 /*
28 * - .useralternate <bool>
29 *
30 * Push true if the current color space contains a base or alternate
31 * color space and makes use of that color space (e.g.: a Separation
32 * color space for a component not supported by the process color model.
33 */
34 static int
zusealternate(i_ctx_t * i_ctx_p)35 zusealternate(i_ctx_t * i_ctx_p)
36 {
37 os_ptr op = osp;
38 const gs_color_space * pcs = gs_currentcolorspace(igs);
39
40 push(1);
41 make_bool(op, pcs->base_space != 0);
42 return 0;
43 }
44
45
46 /* ------ Initialization procedure ------ */
47
48 const op_def zcolor2_l2_op_defs[] = {
49 op_def_begin_level2(),
50 { "0.usealternate", zusealternate },
51 op_def_end(0)
52 };
53