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

« back to all changes in this revision

Viewing changes to src/gxbitfmt.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: gxbitfmt.h 8022 2007-06-05 22:23:38Z giles $ */
15
 
/* Definitions for bitmap storage formats */
16
 
 
17
 
#ifndef gxbitfmt_INCLUDED
18
 
#  define gxbitfmt_INCLUDED
19
 
 
20
 
/*
21
 
 * Several operations, such as the get_bits_rectangle driver procedure, can
22
 
 * take and/or produce data in a flexible variety of formats; the ability to
23
 
 * describe how bitmap data is stored is useful in other contexts as well.
24
 
 * We define bitmap storage formats using a bit mask: this allows a
25
 
 * procedure to ask for, or offer to provide, data in more than one format.
26
 
 */
27
 
 
28
 
typedef ulong gx_bitmap_format_t;
29
 
 
30
 
    /*
31
 
     * Define the supported color space alternatives.
32
 
     */
33
 
 
34
 
#define GB_COLORS_NATIVE (1L<<0)  /* native representation (DevicePixel) */
35
 
#define GB_COLORS_GRAY   (1L<<1)  /* DeviceGray */
36
 
#define GB_COLORS_RGB    (1L<<2)  /* DeviceRGB */
37
 
#define GB_COLORS_CMYK   (1L<<3)  /* DeviceCMYK */
38
 
 
39
 
#define GB_COLORS_STANDARD_ALL\
40
 
  (GB_COLORS_GRAY | GB_COLORS_RGB | GB_COLORS_CMYK)
41
 
#define GB_COLORS_ALL\
42
 
  (GB_COLORS_NATIVE | GB_COLORS_STANDARD_ALL)
43
 
#define GB_COLORS_NAMES\
44
 
  "colors_native", "colors_Gray", "colors_RGB", "colors_CMYK"
45
 
 
46
 
    /*
47
 
     * Define whether alpha information is included.  For GB_COLORS_NATIVE,
48
 
     * all values other than GB_ALPHA_NONE are equivalent.
49
 
     */
50
 
 
51
 
#define GB_ALPHA_NONE  (1L<<4)  /* no alpha */
52
 
#define GB_ALPHA_FIRST (1L<<5)  /* include alpha as first component */
53
 
#define GB_ALPHA_LAST  (1L<<6)  /* include alpha as last component */
54
 
  /*unused*/           /*(1L<<7)*/
55
 
 
56
 
#define GB_ALPHA_ALL\
57
 
  (GB_ALPHA_NONE | GB_ALPHA_FIRST | GB_ALPHA_LAST)
58
 
#define GB_ALPHA_NAMES\
59
 
  "alpha_none", "alpha_first", "alpha_last", "?alpha_unused?"
60
 
 
61
 
    /*
62
 
     * Define the supported depths per component for GB_COLORS_STANDARD.
63
 
     * For GB_COLORS_NATIVE with planar packing, it is the client's
64
 
     * responsibility to know how the device divides up the bits of the
65
 
     * pixel.
66
 
     */
67
 
 
68
 
#define GB_DEPTH_1  (1L<<8)
69
 
#define GB_DEPTH_2  (1L<<9)
70
 
#define GB_DEPTH_4  (1L<<10)
71
 
#define GB_DEPTH_8  (1L<<11)
72
 
#define GB_DEPTH_12 (1L<<12)
73
 
#define GB_DEPTH_16 (1L<<13)
74
 
  /*unused1*/       /*(1L<<14)*/
75
 
  /*unused2*/       /*(1L<<15)*/
76
 
 
77
 
#define GB_DEPTH_ALL\
78
 
  (GB_DEPTH_1 | GB_DEPTH_2 | GB_DEPTH_4 | GB_DEPTH_8 |\
79
 
   GB_DEPTH_12 | GB_DEPTH_16)
80
 
#define GB_DEPTH_NAMES\
81
 
  "depth_1", "depth_2", "depth_4", "depth_8",\
82
 
  "depth_12", "depth_16", "?depth_unused1?", "?depth_unused2?"
83
 
 
84
 
/* Find the maximum depth of an options mask. */
85
 
#define GB_OPTIONS_MAX_DEPTH(opt)\
86
 
"\
87
 
\000\001\002\002\004\004\004\004\010\010\010\010\010\010\010\010\
88
 
\014\014\014\014\014\014\014\014\014\014\014\014\014\014\014\014\
89
 
\020\020\020\020\020\020\020\020\020\020\020\020\020\020\020\020\
90
 
\020\020\020\020\020\020\020\020\020\020\020\020\020\020\020\020\
91
 
"[((opt) >> 8) & 0x3f]
92
 
/* Find the depth of an options mask with exactly 1 bit set. */
93
 
#define GB_OPTIONS_DEPTH(opt)\
94
 
  ((((opt) >> 8) & 0xf) |\
95
 
   "\000\000\014\020"[((opt) >> 12) & 3])
96
 
 
97
 
    /*
98
 
     * Define the supported packing formats.  Currently, GB_PACKING_PLANAR is
99
 
     * only partially supported, and GB_PACKING_BIT_PLANAR is hardly supported
100
 
     * at all.
101
 
     */
102
 
 
103
 
#define GB_PACKING_CHUNKY     (1L<<16)
104
 
#define GB_PACKING_PLANAR     (1L<<17)  /* 1 plane per component */
105
 
#define GB_PACKING_BIT_PLANAR (1L<<18)  /* 1 plane per bit */
106
 
 
107
 
#define GB_PACKING_ALL\
108
 
  (GB_PACKING_CHUNKY | GB_PACKING_PLANAR | GB_PACKING_BIT_PLANAR)
109
 
#define GB_PACKING_NAMES\
110
 
  "packing_chunky", "packing_planar", "packing_bit_planar"
111
 
 
112
 
    /*
113
 
     * Define whether to return a subset of the planes.  With planar packing
114
 
     * formats, if this is set, only those planes that had non-zero data
115
 
     * pointers originally will be returned (either by copying or by
116
 
     * pointer).  With chunky packing, if this is set, only an undefined
117
 
     * subset of the returned bits may be valid.
118
 
     */
119
 
 
120
 
#define GB_SELECT_PLANES  (1L<<19)
121
 
#define GB_SELECT_ALL\
122
 
  (GB_SELECT_PLANES)
123
 
#define GB_SELECT_NAMES\
124
 
  "select_planes"
125
 
 
126
 
    /*
127
 
     * Define the possible methods of returning data.
128
 
     */
129
 
 
130
 
#define GB_RETURN_COPY    (1L<<20)  /* copy to client's buffer */
131
 
#define GB_RETURN_POINTER (1L<<21)  /* return pointers to data */
132
 
 
133
 
#define GB_RETURN_ALL\
134
 
  (GB_RETURN_COPY | GB_RETURN_POINTER)
135
 
#define GB_RETURN_NAMES\
136
 
  "return_copy", "return_pointer"
137
 
 
138
 
    /*
139
 
     * Define the allowable alignments.  This is only relevant for
140
 
     * GB_RETURN_POINTER: for GB_RETURN_COPY, any alignment is
141
 
     * acceptable.
142
 
     */
143
 
 
144
 
#define GB_ALIGN_STANDARD (1L<<22)  /* require standard bitmap alignment */
145
 
#define GB_ALIGN_ANY      (1L<<23)  /* any alignment is acceptable */
146
 
 
147
 
#define GB_ALIGN_ALL\
148
 
  (GB_ALIGN_ANY | GB_ALIGN_STANDARD)
149
 
#define GB_ALIGN_NAMES\
150
 
  "align_standard", "align_any"
151
 
 
152
 
    /*
153
 
     * Define the allowable X offsets.  GB_OFFSET_ANY is only relevant for
154
 
     * GB_RETURN_POINTER: for GB_RETURN_COPY, clients must specify
155
 
     * the offset so they know how much space to allocate.
156
 
     */
157
 
 
158
 
#define GB_OFFSET_0         (1L<<24)  /* no offsetting */
159
 
#define GB_OFFSET_SPECIFIED (1L<<25)  /* client-specified offset */
160
 
#define GB_OFFSET_ANY       (1L<<26)  /* any offset is acceptable */
161
 
                                /* (for GB_RETURN_POINTER only) */
162
 
  /*unused*/                /*(1L<<27)*/
163
 
 
164
 
#define GB_OFFSET_ALL\
165
 
  (GB_OFFSET_0 | GB_OFFSET_SPECIFIED | GB_OFFSET_ANY)
166
 
#define GB_OFFSET_NAMES\
167
 
  "offset_0", "offset_specified", "offset_any", "?offset_unused?"
168
 
 
169
 
    /*
170
 
     * Define the allowable rasters.  GB_RASTER_ANY is only relevant for
171
 
     * GB_RETURN_POINTER, for the same reason as GB_OFFSET_ANY.
172
 
     * Note also that if GB_ALIGN_STANDARD and GB_RASTER_SPECIFIED are
173
 
     * both chosen and more than one scan line is being transferred,
174
 
     * the raster value must also be aligned (i.e., 0 mod align_bitmap_mod).
175
 
     * Implementors are not required to check this.
176
 
     */
177
 
 
178
 
    /*
179
 
     * Standard raster is bitmap_raster(dev->width) for return_ptr,
180
 
     * bitmap_raster(x_offset + width) for return_copy,
181
 
     * padding per alignment.
182
 
     */
183
 
#define GB_RASTER_STANDARD  (1L<<28)
184
 
#define GB_RASTER_SPECIFIED (1L<<29)  /* any client-specified raster */
185
 
#define GB_RASTER_ANY       (1L<<30)  /* any raster is acceptable (for */
186
 
                                /* GB_RETURN_POINTER only) */
187
 
 
188
 
#define GB_RASTER_ALL\
189
 
  (GB_RASTER_STANDARD | GB_RASTER_SPECIFIED | GB_RASTER_ANY)
190
 
#define GB_RASTER_NAMES\
191
 
  "raster_standard", "raster_specified", "raster_any"
192
 
 
193
 
    /*
194
 
     * Return halftoned raster.  (This requires a custom get_bit_rectangle
195
 
     * device procedure.  See the wtsimdi device.  Most devices ignore this
196
 
     * bit.
197
 
     */
198
 
#define GB_HALFTONED (1L<<31)
199
 
#define GB_HALFTONED_NAMES\
200
 
  "halftoned_no", "halftoned_yes"
201
 
 
202
 
/* Define names for debugging printout. */
203
 
#define GX_BITMAP_FORMAT_NAMES\
204
 
  GB_COLORS_NAMES, GB_ALPHA_NAMES, GB_DEPTH_NAMES, GB_PACKING_NAMES,\
205
 
  GB_SELECT_NAMES, GB_RETURN_NAMES, GB_ALIGN_NAMES, GB_OFFSET_NAMES,\
206
 
  GB_RASTER_NAMES, GB_HALFTONE_NAMES
207
 
 
208
 
#endif /* gxbitfmt_INCLUDED */