1 /* Copyright (C) 1992, 2000, 2001 Aladdin Enterprises. All rights reserved.
2
3 This software is provided AS-IS with no warranty, either express or
4 implied.
5
6 This software is distributed under license and may not be copied,
7 modified or distributed except as expressly authorized under the terms
8 of the license contained in the file LICENSE in this distribution.
9
10 For more information about licensing, please refer to
11 http://www.ghostscript.com/licensing/. For information on
12 commercial licensing, go to http://www.artifex.com/licensing/ or
13 contact Artifex Software, Inc., 101 Lucas Valley Road #110,
14 San Rafael, CA 94903, U.S.A., +1(415)492-9861.
15 */
16
17 /* $Id: zcolor2.c,v 1.10 2002/08/22 07:12:29 henrys Exp $ */
18 /* Level 2 color operators */
19 #include "ghost.h"
20 #include "string_.h"
21 #include "oper.h"
22 #include "gsmatrix.h"
23 #include "gsstruct.h"
24 #include "gxcspace.h"
25 #include "gscolor2.h"
26 #include "igstate.h"
27 #include "store.h"
28
29
30 /*
31 * - .useralternate <bool>
32 *
33 * Push true if the current color space contains a base or alternate
34 * color space and makes use of that color space (e.g.: a Separation
35 * color space for a component not supported by the process color model.
36 */
37 private int
zusealternate(i_ctx_t * i_ctx_p)38 zusealternate(i_ctx_t * i_ctx_p)
39 {
40 os_ptr op = osp;
41 const gs_color_space * pcs = gs_currentcolorspace(igs);
42
43 push(1);
44 make_bool(op, cs_base_space(pcs) != 0);
45 return 0;
46 }
47
48
49 /* ------ Initialization procedure ------ */
50
51 const op_def zcolor2_l2_op_defs[] = {
52 op_def_begin_level2(),
53 { "0.usealternate", zusealternate },
54 op_def_end(0)
55 };
56