1 /* Copyright (C) 2001-2019 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.,  1305 Grant Avenue - Suite 200, Novato,
13    CA 94945, U.S.A., +1(415)492-9861, for further information.
14 */
15 
16 
17 /* Definitions for trapping parameters and zones */
18 
19 #ifndef gstrap_INCLUDED
20 #  define gstrap_INCLUDED
21 
22 #include "gsparam.h"
23 #include "gspath.h"
24 
25 /* ---------------- Types and structures ---------------- */
26 
27 /* Define the placement of image traps. */
28 typedef enum {
29     tp_Center,
30     tp_Choke,
31     tp_Spread,
32     tp_Normal
33 } gs_trap_placement_t;
34 
35 #define gs_trap_placement_names\
36   "Center", "Choke", "Spread", "Normal"
37 
38 /* Define a trapping parameter set. */
39 typedef struct gs_trap_params_s {
40     float BlackColorLimit;	/* 0-1 */
41     float BlackDensityLimit;	/* > 0 */
42     float BlackWidth;		/* > 0 */
43     /* ColorantZoneDetails; */
44     bool Enabled;
45     /* HalftoneName; */
46     bool ImageInternalTrapping;
47     bool ImagemaskTrapping;
48     int ImageResolution;
49     bool ImageToObjectTrapping;
50     gs_trap_placement_t ImageTrapPlacement;
51     float SlidingTrapLimit;	/* 0-1 */
52     float StepLimit;		/* 0-1 */
53     float TrapColorScaling;	/* 0-1 */
54     float TrapWidth;		/* > 0 */
55 } gs_trap_params_t;
56 
57 /* Define a trapping zone.  ****** SUBJECT TO CHANGE ****** */
58 typedef struct gs_trap_zone_s {
59     gs_trap_params_t params;
60     gx_path *zone;
61 } gs_trap_zone_t;
62 
63 /* ---------------- Procedures ---------------- */
64 
65 int gs_settrapparams(gs_trap_params_t * params, gs_param_list * list);
66 
67 #endif /* gstrap_INCLUDED */
68