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

« back to all changes in this revision

Viewing changes to base/gxcomp.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
 
 
14
/* $Id: gxcomp.h 8585 2008-03-03 16:01:12Z leonardo $ */
 
15
/* Definitions for implementing compositing functions */
 
16
 
 
17
#ifndef gxcomp_INCLUDED
 
18
#  define gxcomp_INCLUDED
 
19
 
 
20
#include "gscompt.h"
 
21
#include "gsrefct.h"
 
22
#include "gxbitfmt.h"
 
23
 
 
24
/*
 
25
 * Because compositor information is passed through the command list,
 
26
 * individual compositors must be identified by some means that is
 
27
 * independent of address space. The address of the compositor method
 
28
 * array, gs_composite_type_t (see below), cannot be used, as it is
 
29
 * meaningful only within a single address space.
 
30
 *
 
31
 * In addition, it is desirable the keep the compositor identifier
 
32
 * size as small as possible, as this identifier must be passed through
 
33
 * the command list for all bands whenever the compositor is invoked.
 
34
 * Fortunately, compositor invocation is not so frequent as to warrant
 
35
 * byte-sharing techniques, which most likely would store the identifier
 
36
 * in some unused bits of a command code byte. Hence, the smallest
 
37
 * reasonable size for the identifier is one byte. This allows for up
 
38
 * to 255 compositors, which should be ample (as of this writing, there
 
39
 * are only two compositors, only one of which can be passed through
 
40
 * the command list).
 
41
 *
 
42
 * The following list is intended to enumerate all compositors. We
 
43
 * use definitions rather than an encoding to ensure a one-byte size.
 
44
 */
 
45
#define GX_COMPOSITOR_ALPHA        0x01   /* DPS/Next alpha compositor */
 
46
#define GX_COMPOSITOR_OVERPRINT    0x02   /* overprint/overprintmode compositor */
 
47
#define GX_COMPOSITOR_PDF14_TRANS  0x03   /* PDF 1.4 transparency compositor */
 
48
 
 
49
 
 
50
/*
 
51
 * Define the abstract superclass for all compositing function types.
 
52
 */
 
53
                                                   /*typedef struct gs_composite_s gs_composite_t; *//* in gscompt.h */
 
54
 
 
55
#ifndef gs_imager_state_DEFINED
 
56
#  define gs_imager_state_DEFINED
 
57
typedef struct gs_imager_state_s gs_imager_state;
 
58
#endif
 
59
 
 
60
#ifndef gx_device_DEFINED
 
61
#  define gx_device_DEFINED
 
62
typedef struct gx_device_s gx_device;
 
63
#endif
 
64
 
 
65
#ifndef gx_device_clist_writer_DEFINED
 
66
#define gx_device_clist_writer_DEFINED
 
67
typedef struct gx_device_clist_writer_s gx_device_clist_writer;
 
68
#endif
 
69
 
 
70
typedef struct gs_composite_type_procs_s {
 
71
 
 
72
    /*
 
73
     * Create the default compositor for a compositing function.
 
74
     */
 
75
#define composite_create_default_compositor_proc(proc)\
 
76
  int proc(const gs_composite_t *pcte, gx_device **pcdev,\
 
77
    gx_device *dev, gs_imager_state *pis, gs_memory_t *mem)
 
78
    composite_create_default_compositor_proc((*create_default_compositor));
 
79
 
 
80
    /*
 
81
     * Test whether this function is equal to another one.
 
82
     */
 
83
#define composite_equal_proc(proc)\
 
84
  bool proc(const gs_composite_t *pcte, const gs_composite_t *pcte2)
 
85
    composite_equal_proc((*equal));
 
86
 
 
87
    /*
 
88
     * Convert the representation of this function to a string
 
89
     * for writing in a command list.  *psize is the amount of space
 
90
     * available.  If it is large enough, the procedure sets *psize
 
91
     * to the amount used and returns 0; if it is not large enough,
 
92
     * the procedure sets *psize to the amount needed and returns a
 
93
     * rangecheck error; in the case of any other error, *psize is
 
94
     * not changed.
 
95
     */
 
96
#define composite_write_proc(proc)\
 
97
  int proc(const gs_composite_t *pcte, byte *data, uint *psize, gx_device_clist_writer *cdev)
 
98
    composite_write_proc((*write));
 
99
 
 
100
    /*
 
101
     * Convert the string representation of a function back to
 
102
     * a structure, allocating the structure. Return the number of
 
103
     * bytes read, or < 0 in the event of an error.
 
104
     */
 
105
#define composite_read_proc(proc)\
 
106
  int proc(gs_composite_t **ppcte, const byte *data, uint size,\
 
107
    gs_memory_t *mem)
 
108
    composite_read_proc((*read));
 
109
 
 
110
    /*
 
111
     * Adjust CTM before applying the compositor. Used with banding.
 
112
     */
 
113
#define composite_adjust_ctm_proc(proc)\
 
114
  int proc(gs_composite_t *pcte, int x0, int y0, gs_imager_state *pis)
 
115
    composite_adjust_ctm_proc((*adjust_ctm));
 
116
 
 
117
    /*
 
118
     * Checks whether a next compositor operation closes this one.
 
119
     * Must set the 2nd argument with a pointer to the opening compositor operation.
 
120
     * Return coides : <0 - error, 0 - not closing,
 
121
     * 1 - closing with annihilation, 2 - execute immediately, 
 
122
     * 3 - closing and replacing, 4 - replace one, 5 - drop queue.
 
123
     */
 
124
#define composite_is_closing_proc(proc)\
 
125
  int proc(const gs_composite_t *this, gs_composite_t **pcte, gx_device *dev)
 
126
    composite_is_closing_proc((*is_closing));
 
127
 
 
128
    /*
 
129
     * Checks whether a next operation is friendly to the compositor
 
130
     * so that it may commutate with the compositor operation.
 
131
     */
 
132
#define composite_is_friendly_proc(proc)\
 
133
  bool proc(const gs_composite_t *this, byte cmd0, byte cmd1)
 
134
    composite_is_friendly_proc((*is_friendly));
 
135
 
 
136
    /*
 
137
     * Update the clist write device when a compositor device is created.
 
138
     */
 
139
#define composite_clist_write_update(proc)\
 
140
  int proc(const gs_composite_t * pcte, gx_device * dev, gx_device ** pcdev,\
 
141
                        gs_imager_state * pis, gs_memory_t * mem)
 
142
    composite_clist_write_update((*clist_compositor_write_update));
 
143
 
 
144
    /*
 
145
     * Update the clist read device when a compositor device is created.
 
146
     */
 
147
#define composite_clist_read_update(proc)\
 
148
  int proc(gs_composite_t * pcte, gx_device * cdev, gx_device * tdev,\
 
149
                        gs_imager_state * pis, gs_memory_t * mem)
 
150
    composite_clist_read_update((*clist_compositor_read_update));
 
151
 
 
152
    /*
 
153
     * Get compositor cropping.
 
154
     */
 
155
#define composite_get_cropping_proc(proc)\
 
156
  int proc(const gs_composite_t * pcte, int *ry, int *rheight)
 
157
    composite_get_cropping_proc((*get_cropping));
 
158
 
 
159
} gs_composite_type_procs_t;
 
160
 
 
161
typedef struct gs_composite_type_s {
 
162
    byte comp_id;   /* to identify compositor passed through command list */
 
163
    gs_composite_type_procs_t procs;
 
164
} gs_composite_type_t;
 
165
 
 
166
/*
 
167
 * Default implementation for creating a compositor for clist writing.
 
168
 * The default does nothing.
 
169
 */
 
170
composite_clist_write_update(gx_default_composite_clist_write_update);
 
171
 
 
172
/* Default handler for adjusting a compositor's CTM. */
 
173
composite_adjust_ctm_proc(gx_default_composite_adjust_ctm);
 
174
 
 
175
/* Default check for closing compositor. */
 
176
composite_is_closing_proc(gx_default_composite_is_closing);
 
177
 
 
178
/* Default check for a friendly command to a compositor. */
 
179
composite_is_friendly_proc(gx_default_composite_is_friendly);
 
180
 
 
181
/*
 
182
 * Default implementation for adjusting the clist reader when a compositor
 
183
 * device is added.  The default does nothing.
 
184
 */
 
185
composite_clist_read_update(gx_default_composite_clist_read_update);
 
186
 
 
187
/*
 
188
 * Default implementation for get_cropping doesn't return a cropping.
 
189
 */
 
190
composite_get_cropping_proc(gx_default_composite_get_cropping);
 
191
 
 
192
/*
 
193
 * Compositing objects are reference-counted, because graphics states will
 
194
 * eventually reference them.  Note that the common part has no
 
195
 * garbage-collectible pointers and is never actually instantiated, so no
 
196
 * structure type is needed for it.
 
197
 */
 
198
#define gs_composite_common\
 
199
        const gs_composite_type_t *type;\
 
200
        gs_id id;               /* see gscompt.h */\
 
201
        bool idle;              /* Doesn't paint anything. */\
 
202
        struct gs_composite_s *prev, *next /* Queue links for clist_playback_band. */ 
 
203
 
 
204
struct gs_composite_s {
 
205
    gs_composite_common;
 
206
};
 
207
 
 
208
/* Replace a procedure with a macro. */
 
209
#define gs_composite_id(pcte) ((pcte)->id)
 
210
 
 
211
#endif /* gxcomp_INCLUDED */