xref: /plan9/sys/src/cmd/gs/src/zcolor3.c (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 2002 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: zcolor3.c,v 1.2 2002/09/06 18:42:16 dan Exp $*/
18 /* Level 3 color operators */
19 #include "ghost.h"
20 #include "oper.h"
21 #include "igstate.h"
22 
23 
24 /*
25  *  <bool>   .setuseciecolor  -
26  *
27  * Set the use_cie_color parameter for the interpreter state, which
28  * corresponds to the UseCIEColor page device parameter. This parameter
29  * may be read at all language levels, but it may be set only for
30  * language level 3. The parameter is handled separately from the page
31  * device dictionary primarily for performance reasons (it may need to
32  * be checked frequently), but also to ensure proper language level
33  * specific behavior.
34  *
35  * This operator is accessible only during initialization and is called
36  * only under controlled conditions. Hence, it does not do any operand
37  * checking.
38  */
39 private int
zsetuseciecolor(i_ctx_t * i_ctx_p)40 zsetuseciecolor(i_ctx_t * i_ctx_p)
41 {
42     os_ptr  op = osp;
43 
44     istate->use_cie_color = *op;
45     pop(1);
46     return 0;
47 }
48 
49 
50 /*
51  * Initialization procedure
52  */
53 
54 const op_def    zcolor3_l3_op_defs[] = {
55     op_def_begin_ll3(),
56     { "0.setuseciecolor", zsetuseciecolor },
57     op_def_end(0)
58 };
59