~ubuntu-branches/ubuntu/jaunty/ghostscript/jaunty-updates

« back to all changes in this revision

Viewing changes to src/gdevp14.h

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2009-01-20 16:40:45 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20090120164045-lnfhi0n30o5lwhwa
Tags: 8.64.dfsg.1~svn9377-0ubuntu1
* New upstream release (SVN rev 9377)
   o Fixes many bugs concerning PDF rendering, to make the PDF printing
     workflow correctly working.
   o Fixes long-standing bugs in many drivers, like input paper tray and
     duplex options not working for the built-in PCL 4, 5, 5c, 5e, and
     6/XL drivers, PDF input not working for bjc600, bjc800, and cups
     output devices, several options not working and uninitialized
     memory with cups output device.
   o Merged nearly all patches of the Ubuntu and Debian packages upstream.
   o Fixes LP: #317810, LP: #314439, LP: #314018.
* debian/patches/03_libpaper_support.dpatch,
  debian/patches/11_gs-cjk_font_glyph_handling_fix.dpatch,
  debian/patches/12_gs-cjk_vertical_writing_metrics_fix.dpatch,
  debian/patches/13_gs-cjk_cjkps_examples.dpatch,
  debian/patches/20_bbox_segv_fix.dpatch,
  debian/patches/21_brother_7x0_gdi_fix.dpatch,
  debian/patches/22_epsn_margin_workaround.dpatch,
  debian/patches/24_gs_man_fix.dpatch,
  debian/patches/25_toolbin_insecure_tmp_usage_fix.dpatch,
  debian/patches/26_assorted_script_fixes.dpatch,
  debian/patches/29_gs_css_fix.dpatch,
  debian/patches/30_ps2pdf_man_improvement.dpatch,
  debian/patches/31_fix-gc-sigbus.dpatch,
  debian/patches/34_ftbfs-on-hurd-fix.dpatch,
  debian/patches/35_disable_libcairo.dpatch,
  debian/patches/38_pxl-duplex.dpatch,
  debian/patches/39_pxl-resolution.dpatch,
  debian/patches/42_gs-init-ps-delaybind-fix.dpatch,
  debian/patches/45_bjc600-bjc800-pdf-input.dpatch,
  debian/patches/48_cups-output-device-pdf-duplex-uninitialized-memory-fix.dpatch,
  debian/patches/50_lips4-floating-point-exception.dpatch,
  debian/patches/52_cups-device-logging.dpatch,
  debian/patches/55_pcl-input-slot-fix.dpatch,
  debian/patches/57_pxl-input-slot-fix.dpatch,
  debian/patches/60_pxl-cups-driver-pdf.dpatch,
  debian/patches/62_onebitcmyk-pdf.dpatch,
  debian/patches/65_too-big-temp-files-1.dpatch,
  debian/patches/67_too-big-temp-files-2.dpatch,
  debian/patches/70_take-into-account-data-in-stream-buffer-before-refill.dpatch:
  Removed, applied upstream.
* debian/patches/01_docdir_fix_for_debian.dpatch,
  debian/patches/02_gs_man_fix_debian.dpatch,
  debian/patches/01_docdir-fix-for-debian.dpatch,
  debian/patches/02_docdir-fix-for-debian.dpatch: Renamed patches to
  make merging with Debian easier.
* debian/patches/32_improve-handling-of-media-size-changes-from-gv.dpatch, 
  debian/patches/33_bad-params-to-xinitimage-on-large-bitmaps.dpatch:
  regenerated for new source directory structure.
* debian/rules: Corrected paths to remove cidfmap (it is in Resource/Init/
  in GS 8.64) and to install headers (source paths are psi/ and base/ now).
* debian/rules: Remove all fontmaps, as DeFoMa replaces them.
* debian/local/pdftoraster/pdftoraster.c,
  debian/local/pdftoraster/pdftoraster.convs, debian/rules: Removed
  added pdftoraster filter and use the one which comes with Ghostscript.
* debian/ghostscript.links: s/8.63/8.64/

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2001-2006 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, 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.
12
 
*/
13
 
/* $Id: gdevp14.h 8585 2008-03-03 16:01:12Z leonardo $ */
14
 
/* Definitions and interface for PDF 1.4 rendering device */
15
 
 
16
 
#ifndef gdevp14_INCLUDED
17
 
#  define gdevp14_INCLUDED
18
 
 
19
 
#include "gxcmap.h"
20
 
 
21
 
typedef enum {
22
 
    PDF14_DeviceGray = 0,
23
 
    PDF14_DeviceRGB = 1,
24
 
    PDF14_DeviceCMYK = 2,
25
 
    PDF14_DeviceCMYKspot = 3,
26
 
    PDF14_DeviceCustom = 4
27
 
} pdf14_default_colorspace_t;
28
 
 
29
 
typedef struct pdf14_buf_s pdf14_buf;
30
 
typedef struct pdf14_ctx_s pdf14_ctx;
31
 
 
32
 
struct pdf14_buf_s {
33
 
    pdf14_buf *saved;
34
 
 
35
 
    bool isolated;
36
 
    bool knockout;
37
 
    byte alpha;
38
 
    byte shape;
39
 
    gs_blend_mode_t blend_mode;
40
 
 
41
 
    bool has_alpha_g;
42
 
    bool has_shape;
43
 
 
44
 
    gs_int_rect rect;
45
 
    /* Note: the traditional GS name for rowstride is "raster" */
46
 
 
47
 
    /* Data is stored in planar format. Order of planes is: pixel values,
48
 
       alpha, shape if present, alpha_g if present. */
49
 
 
50
 
    int rowstride;
51
 
    int planestride;
52
 
    int n_chan; /* number of pixel planes including alpha */
53
 
    int n_planes; /* total number of planes including alpha, shape, alpha_g */
54
 
    byte *data;
55
 
    byte *transfer_fn;
56
 
    gs_int_rect bbox;
57
 
    pdf14_buf *maskbuf; /* Save pdf14_ctx_s::maksbuf. */
58
 
    bool idle;
59
 
    uint mask_id;
60
 
};
61
 
 
62
 
struct pdf14_ctx_s {
63
 
    pdf14_buf *stack;
64
 
    pdf14_buf *maskbuf;
65
 
    gs_memory_t *memory;
66
 
    gs_int_rect rect;
67
 
    bool additive;
68
 
    int n_chan;
69
 
};
70
 
 
71
 
#ifndef gs_devn_params_DEFINED
72
 
#  define gs_devn_params_DEFINED
73
 
typedef struct gs_devn_params_s gs_devn_params;
74
 
#endif
75
 
 
76
 
#ifndef gs_imager_state_DEFINED
77
 
#  define gs_imager_state_DEFINED
78
 
typedef struct gs_imager_state_s gs_imager_state;
79
 
#endif
80
 
 
81
 
#ifndef gx_device_DEFINED
82
 
#  define gx_device_DEFINED
83
 
typedef struct gx_device_s gx_device;
84
 
#endif
85
 
 
86
 
#ifndef gs_pdf14trans_params_DEFINED
87
 
#  define gs_pdf14trans_params_DEFINED
88
 
typedef struct gs_pdf14trans_params_s gs_pdf14trans_params_t;
89
 
#endif
90
 
 
91
 
typedef struct pdf14_device_s pdf14_device;
92
 
 
93
 
/*
94
 
 * This structure contains procedures for processing routine which differ
95
 
 * between the different blending color spaces.
96
 
 */
97
 
typedef struct {
98
 
    /*
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
104
 
     * execution time.
105
 
     */
106
 
    void (* unpack_color)(int num_comp, gx_color_index color,
107
 
                                pdf14_device * p14dev, byte * out);
108
 
    /*
109
 
     * This procedure sends the final rasterized transparency data to the
110
 
     * output device as an image.
111
 
     */
112
 
    int (* put_image)(gx_device * dev,
113
 
                    gs_imager_state * pis, gx_device * target);
114
 
} pdf14_procs_s;
115
 
 
116
 
typedef pdf14_procs_s pdf14_procs_t;
117
 
 
118
 
/*
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
122
 
 * device.
123
 
 */
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 */
129
 
 
130
 
    pdf14_ctx *ctx;
131
 
    float opacity;
132
 
    float shape;
133
 
    float alpha; /* alpha = opacity * shape */
134
 
    gs_blend_mode_t blend_mode;
135
 
    bool text_knockout;
136
 
    gx_device * pclist_device;
137
 
    const gx_color_map_procs *(*save_get_cmap_procs)(const gs_imager_state *,
138
 
                                                     const gx_device *);
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);
148
 
} pdf14_device_t;
149
 
 
150
 
/*
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
154
 
 * device.
155
 
 */
156
 
typedef struct pdf14_device_s pdf14_clist_device;
157
 
 
158
 
/*
159
 
 * Send a PDF 1.4 transparency compositor action to the specified device.
160
 
 */
161
 
int send_pdf14trans(gs_imager_state * pis, gx_device * dev,
162
 
    gx_device * * pcdev, gs_pdf14trans_params_t * pparams, gs_memory_t * mem);
163
 
 
164
 
/*
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.
173
 
 */
174
 
int
175
 
pdf14_put_devn_params(gx_device * pdev, gs_devn_params * pdevn_params,
176
 
                                        gs_param_list * plist);
177
 
 
178
 
#endif /* gdevp14_INCLUDED */