1
/* Copyright (C) 2001-2006 Artifex Software, Inc.
4
This software is provided AS-IS with no warranty, either express or
7
This software is distributed under license and may not be copied, modified
8
or distributed except as expressly authorized under the terms of that
9
license. Refer to licensing information at http://www.artifex.com/
10
or contact Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134,
11
San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
13
/* $Id: gdevp14.h 8585 2008-03-03 16:01:12Z leonardo $ */
14
/* Definitions and interface for PDF 1.4 rendering device */
16
#ifndef gdevp14_INCLUDED
17
# define gdevp14_INCLUDED
25
PDF14_DeviceCMYKspot = 3,
26
PDF14_DeviceCustom = 4
27
} pdf14_default_colorspace_t;
29
typedef struct pdf14_buf_s pdf14_buf;
30
typedef struct pdf14_ctx_s pdf14_ctx;
39
gs_blend_mode_t blend_mode;
45
/* Note: the traditional GS name for rowstride is "raster" */
47
/* Data is stored in planar format. Order of planes is: pixel values,
48
alpha, shape if present, alpha_g if present. */
52
int n_chan; /* number of pixel planes including alpha */
53
int n_planes; /* total number of planes including alpha, shape, alpha_g */
57
pdf14_buf *maskbuf; /* Save pdf14_ctx_s::maksbuf. */
71
#ifndef gs_devn_params_DEFINED
72
# define gs_devn_params_DEFINED
73
typedef struct gs_devn_params_s gs_devn_params;
76
#ifndef gs_imager_state_DEFINED
77
# define gs_imager_state_DEFINED
78
typedef struct gs_imager_state_s gs_imager_state;
81
#ifndef gx_device_DEFINED
82
# define gx_device_DEFINED
83
typedef struct gx_device_s gx_device;
86
#ifndef gs_pdf14trans_params_DEFINED
87
# define gs_pdf14trans_params_DEFINED
88
typedef struct gs_pdf14trans_params_s gs_pdf14trans_params_t;
91
typedef struct pdf14_device_s pdf14_device;
94
* This structure contains procedures for processing routine which differ
95
* between the different blending color spaces.
99
* Unpack a device color. This routine is similar to the device's
100
* decode_color procedure except for two things. The procedure produces
101
* 1 byte values instead of gx_color_values (2 bytes) and the output
102
* values are inverted for subtractive color spaces (like CMYK).
103
* A separate procedure is used instead of the decode_color to minimize
106
void (* unpack_color)(int num_comp, gx_color_index color,
107
pdf14_device * p14dev, byte * out);
109
* This procedure sends the final rasterized transparency data to the
110
* output device as an image.
112
int (* put_image)(gx_device * dev,
113
gs_imager_state * pis, gx_device * target);
116
typedef pdf14_procs_s pdf14_procs_t;
119
* Define the default post-clist (clist reader) PDF 1.4 compositing device.
120
* We actually use the same structure for both the clist writer and reader
121
* devices. However we use separate names to identify the routines for each
124
typedef struct pdf14_device_s {
125
gx_device_forward_common;
126
gs_devn_params devn_params; /* Must follow gx_device_forward_common */
127
const pdf14_procs_t * pdf14_procs; /* Must follow devn_params. */
128
const pdf14_nonseparable_blending_procs_t * blend_procs; /* Must follow pdf14_procs */
133
float alpha; /* alpha = opacity * shape */
134
gs_blend_mode_t blend_mode;
136
gx_device * pclist_device;
137
const gx_color_map_procs *(*save_get_cmap_procs)(const gs_imager_state *,
139
gx_device_color_info saved_target_color_info;
140
dev_proc_encode_color(*saved_target_encode_color);
141
dev_proc_decode_color(*saved_target_decode_color);
142
dev_proc_get_color_mapping_procs(*saved_target_get_color_mapping_procs);
143
dev_proc_get_color_comp_index(*saved_target_get_color_comp_index);
144
dev_proc_encode_color(*my_encode_color);
145
dev_proc_decode_color(*my_decode_color);
146
dev_proc_get_color_mapping_procs(*my_get_color_mapping_procs);
147
dev_proc_get_color_comp_index(*my_get_color_comp_index);
151
* Define the default pre-clist (clist writer) PDF 1.4 compositing device.
152
* We actually use the same structure for both the clist writer and reader
153
* devices. However we use separate names to identify the routines for each
156
typedef struct pdf14_device_s pdf14_clist_device;
159
* Send a PDF 1.4 transparency compositor action to the specified device.
161
int send_pdf14trans(gs_imager_state * pis, gx_device * dev,
162
gx_device * * pcdev, gs_pdf14trans_params_t * pparams, gs_memory_t * mem);
165
* This procedure will save information from the PDF 1.4 clist writing
166
* clist compositior device. This is information about the compressed
167
* color list info which is needed for the support of spot colors in
168
* PDF 1.4 compositing. This info needs to be passed to the PDF 1.4
169
* clist reading compositor. However this device is not created until
170
* the clist is read. To get this info to that device, we have to
171
* temporarily store that info in the output device. This routine saves
172
* that info in the output device.
175
pdf14_put_devn_params(gx_device * pdev, gs_devn_params * pdevn_params,
176
gs_param_list * plist);
178
#endif /* gdevp14_INCLUDED */