1 /* Copyright (C) 1992, 2000 artofcode LLC.  All rights reserved.
2 
3   This program is free software; you can redistribute it and/or modify it
4   under the terms of the GNU General Public License as published by the
5   Free Software Foundation; either version 2 of the License, or (at your
6   option) any later version.
7 
8   This program is distributed in the hope that it will be useful, but
9   WITHOUT ANY WARRANTY; without even the implied warranty of
10   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11   General Public License for more details.
12 
13   You should have received a copy of the GNU General Public License along
14   with this program; if not, write to the Free Software Foundation, Inc.,
15   59 Temple Place, Suite 330, Boston, MA, 02111-1307.
16 
17 */
18 
19 /*$Id: gscsepr.h,v 1.4.6.1.2.1 2003/01/17 00:49:02 giles Exp $ */
20 /* Client interface to Separation color */
21 
22 #ifndef gscsepr_INCLUDED
23 #  define gscsepr_INCLUDED
24 
25 #include "gscspace.h"
26 
27 /* Graphics state */
28 bool gs_currentoverprint(P1(const gs_state *));
29 void gs_setoverprint(P2(gs_state *, bool));
30 /* Overprint mode is a PDF feature, but we include it here. */
31 int gs_currentoverprintmode(P1(const gs_state *));
32 int gs_setoverprintmode(P2(gs_state *, int));
33 
34 /*
35  * Separation color spaces.
36  *
37  * The API for creating Separation color space objects exposes the fact that
38  * they normally cache the results of sampling the tint_transform procedure,
39  * and use the cache to convert colors when necessary.  When a language
40  * interpreter sets up a Separation space, it may either provide a
41  * tint_tranform procedure that will be called each time (specifying the
42  * cache size as 0), or it may fill in the cache directly and provide a
43  * dummy procedure.
44  *
45  * By default, the tint transformation procedure will simple return the
46  * entries in the cache. If this function is called when the cache size is
47  * 0, all color components in the alternative color space will be set to 0.
48  */
49 extern int gs_cspace_build_Separation(P5(
50 					 gs_color_space ** ppcspace,
51 					 gs_separation_name sname,
52 					 const gs_color_space * palt_cspace,
53 					 int cache_size,
54 					 gs_memory_t * pmem
55 					 ));
56 
57 /* Get the cached value array for a Separation color space. */
58 /* VMS limits procedure names to 31 characters. */
59 extern float *gs_cspace_get_sepr_value_array(P1(
60 						const gs_color_space * pcspace
61 						));
62 /* BACKWARD COMPATIBILITY */
63 #define gs_cspace_get_separation_value_array gs_cspace_get_sepr_value_array
64 
65 /* Set the tint transformation procedure for a Separation color space. */
66 /* VMS limits procedure names to 31 characters, and some systems only */
67 /* compare the first 23 characters. */
68 extern int gs_cspace_set_sepr_proc(P2(
69 				      gs_color_space * pcspace,
70 			int (*proc)(P3(const gs_separation_params *,
71 				       floatp,
72 				       float *
73 				       ))
74 				      ));
75 /* BACKWARD COMPATIBILITY */
76 #define gs_cspace_set_tint_xform_proc gs_cspace_set_sepr_proc
77 #define gs_cspace_set_tint_transform_proc gs_cspace_set_tint_xform_proc
78 
79 /* Set the Separation tint transformation procedure to a Function. */
80 #ifndef gs_function_DEFINED
81 typedef struct gs_function_s gs_function_t;
82 #  define gs_function_DEFINED
83 #endif
84 int gs_cspace_set_sepr_function(P2(const gs_color_space *pcspace,
85 				   gs_function_t *pfn));
86 
87 /*
88  * If the Separation tint transformation procedure is a Function,
89  * return the function object, otherwise return 0.
90  */
91 gs_function_t *gs_cspace_get_sepr_function(P1(const gs_color_space *pcspace));
92 
93 #endif /* gscsepr_INCLUDED */
94