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

« back to all changes in this revision

Viewing changes to base/gshtx.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: gshtx.h 8022 2007-06-05 22:23:38Z giles $ */
 
15
/* High-level interface to stand-alone halftone/transfer objects */
 
16
 
 
17
#ifndef gshtx_INCLUDED
 
18
#  define gshtx_INCLUDED
 
19
 
 
20
#include "gsmemory.h"
 
21
#include "gsht1.h"
 
22
#include "gxtmap.h"
 
23
#include "gscspace.h"
 
24
 
 
25
/*
 
26
 * The stand-alone halftone structures are opaque, and are placed in an opaque
 
27
 * graphic state. 
 
28
 */
 
29
 
 
30
/* Alias type names */
 
31
#define gs_ht gs_halftone
 
32
#define gs_spot_ht gs_spot_halftone
 
33
#define gs_threshold_ht gs_threshold_halftone
 
34
#define gs_ht_component gs_halftone_component
 
35
#define gs_multiple_ht gs_multiple_halftone
 
36
/* Alias GC descriptors */
 
37
#define st_gs_ht st_halftone
 
38
#define st_ht_comp_element st_ht_component_element
 
39
/* Alias member names */
 
40
#define ht_spot spot
 
41
#define ht_threshold threshold
 
42
#define ht_multiple multiple
 
43
 
 
44
#ifndef gs_state_DEFINED
 
45
#  define gs_state_DEFINED
 
46
typedef struct gs_state_s gs_state;
 
47
 
 
48
#endif
 
49
 
 
50
/*
 
51
 * A "closure" form of gs_mapping_proc. This allows the procedure to access
 
52
 * client data for the purpose of filling in the transfer information.
 
53
 *
 
54
 * As with PostScript transfer functions, the operand will be in the range
 
55
 * [0, 1], and the result should be in the same range.
 
56
 */
 
57
typedef gs_mapping_closure_proc_t gs_ht_transfer_proc;  /* see gxtmap.h */
 
58
 
 
59
/*
 
60
 * Constructor, destructor, assign, and copy routines for a gs_ht
 
61
 * structure, and to install them in the graphic state.
 
62
 *
 
63
 * Notes:
 
64
 *
 
65
 *    Construction of a gs_ht halftone requires two steps: creating the
 
66
 *    overall halftone, and creating each of the components. Client data
 
67
 *    must be provided for each of the latter steps.
 
68
 *
 
69
 *    The type field of gs_ht halftones will always be ht_type_multiple;
 
70
 *    if only one component is required, this halftone will always be given
 
71
 *    the component name "Default".
 
72
 *
 
73
 *    The type fields of the gs_ht_component structures pointed to by the
 
74
 *    gs_multiple_ht structure will have the value ht_type_spot or
 
75
 *    ht_type_threshold; the constructor routines will not build any
 
76
 *    other types.
 
77
 *
 
78
 *    Individual component halftones of a gs_ht structure must always be
 
79
 *    provided with transfer functions.
 
80
 *
 
81
 *    Releasing the gs_ht structure will NOT release the client data 
 
82
 *    (the client must do that directly).
 
83
 */
 
84
 
 
85
extern int gs_ht_build(gs_ht ** ppht, uint num_comps, gs_memory_t * pmem);
 
86
 
 
87
extern int gs_ht_set_spot_comp(
 
88
                                     gs_ht * pht,
 
89
                                     int component_index,
 
90
                                     floatp freq,
 
91
                                     floatp angle,
 
92
                                     float (*spot_func) (floatp, floatp),
 
93
                                     bool accurate,
 
94
                                     gs_ht_transfer_proc transfer,
 
95
                                     const void *client_data
 
96
                               );
 
97
 
 
98
extern int gs_ht_set_threshold_comp(
 
99
                                          gs_ht * pht,
 
100
                                          int component_index,
 
101
                                          int width,
 
102
                                          int height,
 
103
                                          const gs_const_string * thresholds,
 
104
                                          gs_ht_transfer_proc transfer,
 
105
                                          const void *client_data
 
106
                                    );
 
107
 
 
108
/*
 
109
 * This procedure specifies a (possibly non-monotonic) halftone of size
 
110
 * width x height with num_levels different levels (including white, always
 
111
 * all 0s, but excluding black, always all 1s).  Each mask is in the form of
 
112
 * a gs_bitmap, except that there is no row padding -- the 'raster' is
 
113
 * ceil(width / 8).
 
114
 *
 
115
 * Note that the client is responsible for releasing the mask data.
 
116
 */
 
117
extern int gs_ht_set_mask_comp(
 
118
                                     gs_ht * pht,
 
119
                                     int component_index,
 
120
                                     int width,
 
121
                                     int height,
 
122
                                     int num_levels,
 
123
                                     const byte * masks,        /* width x height x num_levels */
 
124
                                     gs_ht_transfer_proc transfer,
 
125
                                     const void *client_data
 
126
                               );
 
127
 
 
128
extern void gs_ht_reference(gs_ht * pht);
 
129
extern void gs_ht_release(gs_ht * pht);
 
130
 
 
131
#define gs_ht_assign(pto, pfrom)    \
 
132
    BEGIN                           \
 
133
        gs_ht_reference(pfrom);     \
 
134
        if (pto != 0)               \
 
135
            gs_ht_release(pto);     \
 
136
        pto = pfrom;                \
 
137
    END
 
138
 
 
139
#define gs_ht_init_ptr(pto, pfrom)          \
 
140
    BEGIN gs_ht_reference(pfrom); pto = pfrom; END
 
141
 
 
142
extern int gs_ht_install(gs_state * pgs, gs_ht * pht);
 
143
 
 
144
#endif /* gshtx_INCLUDED */