1 /* Copyright (C) 2001-2012 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,
8    modified or distributed except as expressly authorized under the terms
9    of the license contained in the file LICENSE in this distribution.
10 
11    Refer to licensing information at http://www.artifex.com or contact
12    Artifex Software, Inc.,  7 Mt. Lassen Drive - Suite A-134, San Rafael,
13    CA  94903, U.S.A., +1(415)492-9861, for further information.
14 */
15 
16 
17 /* Internal definitions for DeviceN color spaces */
18 
19 #ifndef gxcdevn_INCLUDED
20 #  define gxcdevn_INCLUDED
21 
22 #include "gsrefct.h"
23 #include "gxcindex.h"
24 
25 /* Cache for DeviceN color.  Note that currently this is a 1-entry cache. */
26 #ifndef gs_device_n_map_DEFINED
27 #  define gs_device_n_map_DEFINED
28 typedef struct gs_device_n_map_s gs_device_n_map;
29 #endif
30 struct gs_device_n_map_s {
31     rc_header rc;
32     int (*tint_transform)(const float *in, float *out,
33                           const gs_imager_state *pis, void *data);
34     void *tint_transform_data;
35     bool cache_valid;
36     float tint[GS_CLIENT_COLOR_MAX_COMPONENTS];
37     frac conc[GX_DEVICE_COLOR_MAX_COMPONENTS];
38 };
39 #define private_st_device_n_map() /* in gscdevn.c */\
40   gs_private_st_ptrs1(st_device_n_map, gs_device_n_map, "gs_device_n_map",\
41     device_n_map_enum_ptrs, device_n_map_reloc_ptrs, tint_transform_data)
42 
43 /* Allocate and initialize a DeviceN map. */
44 int alloc_device_n_map(gs_device_n_map ** ppmap, gs_memory_t * mem,
45                        client_name_t cname);
46 
47 #ifndef gs_device_n_attributes_DEFINED
48 #  define gs_device_n_attributes_DEFINED
49 typedef struct gs_device_n_attributes_s gs_device_n_attributes;
50 #endif
51 struct gs_device_n_attributes_s {
52     rc_header rc;
53     gs_separation_name colorant_name;
54     gs_color_space *cspace;
55     struct gs_device_n_attributes_s * next;	/* Linked list */
56 };
57 #define private_st_device_n_attributes() /* in gscdevn.c */\
58   gs_private_st_ptrs2(st_device_n_attributes, gs_device_n_attributes, "gs_device_n_attributes",\
59     device_n_attributes_enum_ptrs, device_n_attributes_reloc_ptrs, cspace, next)
60 
61 /* Check if we are using the alternate color space */
62 bool using_alt_color_space(const gs_state * pgs);
63 
64 #endif /* gxcdevn_INCLUDED */
65