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

« back to all changes in this revision

Viewing changes to src/gdevxcmp.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: gdevxcmp.h 8022 2007-06-05 22:23:38Z giles $ */
15
 
/* X driver color mapping structure */
16
 
 
17
 
#ifndef gdevxcmp_INCLUDED
18
 
#  define gdevxcmp_INCLUDED
19
 
 
20
 
/*
21
 
 * The structure defined in this file is used in only one place, in the
22
 
 * gx_device_X structure defined in gdevx.h.  We define it as a separate
23
 
 * structure because its function is logically separate from the rest of the
24
 
 * X driver, and because this function (color mapping / management) accounts
25
 
 * for the single largest piece of the driver.
26
 
 */
27
 
 
28
 
/* Define pixel value to RGB mapping */
29
 
typedef struct x11_rgb_s {
30
 
    gx_color_value rgb[3];
31
 
    bool defined;
32
 
} x11_rgb_t;
33
 
 
34
 
/* Define dynamic color hash table structure */
35
 
typedef struct x11_color_s x11_color_t;
36
 
struct x11_color_s {
37
 
    XColor color;
38
 
    x11_color_t *next;
39
 
};
40
 
 
41
 
/*
42
 
 * Define X color values.  Fortuitously, these are the same as Ghostscript
43
 
 * color values; in gdevxcmp.c, we are pretty sloppy about aliasing the
44
 
 * two.
45
 
 */
46
 
typedef ushort X_color_value;
47
 
#define X_max_color_value 0xffff
48
 
 
49
 
#if HaveStdCMap  /* Standard colormap stuff is only in X11R4 and later. */
50
 
 
51
 
/* Define the structure for values computed from a standard cmap component. */
52
 
typedef struct x11_cmap_values_s {
53
 
    int cv_shift;       /* 16 - log2(max_value + 1) */
54
 
    X_color_value nearest[64]; /* [i] = i * 0xffff / max_value */
55
 
    int pixel_shift;    /* log2(mult) */
56
 
} x11_cmap_values_t;
57
 
 
58
 
#endif
59
 
 
60
 
typedef struct x11_cman_s {
61
 
 
62
 
    /*
63
 
     * num_rgb is the number of possible R/G/B values, i.e.,
64
 
     * 1 << the bits_per_rgb of the X visual.
65
 
     */
66
 
    int num_rgb;
67
 
 
68
 
    /*
69
 
     * color_mask is a mask that selects the high-order N bits of an
70
 
     * X color value, where N may be the mask width for TrueColor or
71
 
     * StaticGray and is bits_per_rgb for the other visual classes.
72
 
     *
73
 
     * match_mask is the mask used for comparing colors.  It may have
74
 
     * fewer bits than color_mask if the device is not using halftones.
75
 
     */
76
 
    struct cmm_ {
77
 
        X_color_value red, green, blue;
78
 
    } color_mask, match_mask;
79
 
 
80
 
#if HaveStdCMap  /* Standard colormap stuff is only in X11R4 and later. */
81
 
 
82
 
    struct {
83
 
 
84
 
        /*
85
 
         * map is the X standard colormap for the display and screen,
86
 
         * if one is available.
87
 
         */
88
 
        XStandardColormap *map;
89
 
 
90
 
        /*
91
 
         * When possible, we precompute shift values and tables that replace
92
 
         * some multiplies and divides.
93
 
         */
94
 
        bool fast;
95
 
        x11_cmap_values_t red, green, blue;
96
 
 
97
 
        /*
98
 
         * If free_map is true, we allocated the map ourselves (to
99
 
         * represent a TrueColor or Static Gray visual), and must free it
100
 
         * when closing the device.
101
 
         */
102
 
        bool free_map;
103
 
 
104
 
    } std_cmap;
105
 
 
106
 
#endif /* HaveStdCmap */
107
 
 
108
 
    /*
109
 
     * color_to_rgb is a reverse map from pixel values to RGB values.  It
110
 
     * only maps pixels values up to 255: pixel values above this must go
111
 
     * through the standard colormap or query the server.
112
 
     */
113
 
    struct cmc_ {
114
 
        int size;               /* min(1 << depth, 256) */
115
 
        x11_rgb_t *values;      /* [color_to_rgb.size] */
116
 
    } color_to_rgb;
117
 
 
118
 
    /*
119
 
     * For systems with writable colormaps and no suitable standard
120
 
     * colormap, dither_ramp is a preallocated ramp or cube used for
121
 
     * dithering.
122
 
     */
123
 
#define CUBE_INDEX(r,g,b) (((r) * xdev->color_info.dither_colors + (g)) * \
124
 
                                  xdev->color_info.dither_colors + (b))
125
 
    x_pixel *dither_ramp;       /* [color_info.dither_colors^3] if color,
126
 
                                   [color_info.dither_grays] if gray */
127
 
 
128
 
    /*
129
 
     * For systems with writable colormaps, dynamic.colors is a chained
130
 
     * hash table that maps RGB values (masked with color_mask) to
131
 
     * pixel values.  Entries are added dynamically.
132
 
     */
133
 
    struct cmd_ {
134
 
        int size;
135
 
        x11_color_t **colors;   /* [size] */
136
 
        int shift;              /* 16 - log2(size) */
137
 
        int used;
138
 
        int max_used;
139
 
    } dynamic;
140
 
 
141
 
} x11_cman_t;
142
 
 
143
 
#endif /* gdevxcmp_INCLUDED */