xref: /plan9/sys/src/cmd/gs/src/gxcdevn.h (revision 593dc095aefb2a85c828727bbfa9da139a49bdf4)
1 /* Copyright (C) 1999 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: gxcdevn.h,v 1.6 2002/08/22 07:12:29 henrys Exp $ */
18 /* Internal definitions for DeviceN color spaces */
19 
20 #ifndef gxcdevn_INCLUDED
21 #  define gxcdevn_INCLUDED
22 
23 #include "gsrefct.h"
24 #include "gxcindex.h"
25 
26 /* Cache for DeviceN color.  Note that currently this is a 1-entry cache. */
27 #ifndef gs_device_n_map_DEFINED
28 #  define gs_device_n_map_DEFINED
29 typedef struct gs_device_n_map_s gs_device_n_map;
30 #endif
31 struct gs_device_n_map_s {
32     rc_header rc;
33     int (*tint_transform)(const float *in, float *out,
34                           const gs_imager_state *pis, void *data);
35     void *tint_transform_data;
36     bool cache_valid;
37     float tint[GS_CLIENT_COLOR_MAX_COMPONENTS];
38     frac conc[GX_DEVICE_COLOR_MAX_COMPONENTS];
39 };
40 #define private_st_device_n_map() /* in gscdevn.c */\
41   gs_private_st_ptrs1(st_device_n_map, gs_device_n_map, "gs_device_n_map",\
42     device_n_map_enum_ptrs, device_n_map_reloc_ptrs, tint_transform_data)
43 
44 /* Allocate and initialize a DeviceN map. */
45 int alloc_device_n_map(gs_device_n_map ** ppmap, gs_memory_t * mem,
46                        client_name_t cname);
47 
48 /* Check if we are using the alternate color space */
49 bool using_alt_color_space(const gs_state * pgs);
50 
51 #endif /* gxcdevn_INCLUDED */
52