~ubuntu-branches/ubuntu/hardy/ghostscript/hardy

« back to all changes in this revision

Viewing changes to src/gdevpcx.c

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2007-11-22 12:17:43 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071122121743-cd70s3ypq0r243mp
Tags: 8.61.dfsg.1-0ubtuntu1
* New upstream release
  o Final 8.61 release
* debian/patches/09_ijs_krgb_support.dpatch: Adapted to upstream changes.
* debian/rules: Updated CUPS-related variables for "make install" calls.
* debian/rules: Remove /usr/include/ghostscript from the ghostscript
  package, they go into lings-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12
12
*/
13
13
 
14
 
/* $Id: gdevpcx.c 8022 2007-06-05 22:23:38Z giles $ */
 
14
/* $Id: gdevpcx.c 8250 2007-09-25 13:31:24Z giles $ */
15
15
/* PCX file format drivers */
16
16
#include "gdevprn.h"
17
17
#include "gdevpccm.h"
30
30
 
31
31
/* Monochrome. */
32
32
 
33
 
private dev_proc_print_page(pcxmono_print_page);
 
33
static dev_proc_print_page(pcxmono_print_page);
34
34
 
35
35
/* Use the default RGB->color map, so we get black=0, white=1. */
36
 
private const gx_device_procs pcxmono_procs =
 
36
static const gx_device_procs pcxmono_procs =
37
37
prn_color_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
38
38
                gx_default_map_rgb_color, gx_default_map_color_rgb);
39
39
const gx_device_printer gs_pcxmono_device =
45
45
 
46
46
/* Chunky 8-bit gray scale. */
47
47
 
48
 
private dev_proc_print_page(pcx256_print_page);
 
48
static dev_proc_print_page(pcx256_print_page);
49
49
 
50
 
private const gx_device_procs pcxgray_procs =
 
50
static const gx_device_procs pcxgray_procs =
51
51
prn_color_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
52
52
              gx_default_gray_map_rgb_color, gx_default_gray_map_color_rgb);
53
53
const gx_device_printer gs_pcxgray_device =
60
60
 
61
61
/* 4-bit planar (EGA/VGA-style) color. */
62
62
 
63
 
private dev_proc_print_page(pcx16_print_page);
 
63
static dev_proc_print_page(pcx16_print_page);
64
64
 
65
 
private const gx_device_procs pcx16_procs =
 
65
static const gx_device_procs pcx16_procs =
66
66
prn_color_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
67
67
                pc_4bit_map_rgb_color, pc_4bit_map_color_rgb);
68
68
const gx_device_printer gs_pcx16_device =
76
76
/* Chunky 8-bit (SuperVGA-style) color. */
77
77
/* (Uses a fixed palette of 3,3,2 bits.) */
78
78
 
79
 
private const gx_device_procs pcx256_procs =
 
79
static const gx_device_procs pcx256_procs =
80
80
prn_color_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
81
81
                pc_8bit_map_rgb_color, pc_8bit_map_color_rgb);
82
82
const gx_device_printer gs_pcx256_device =
89
89
 
90
90
/* 24-bit color, 3 8-bit planes. */
91
91
 
92
 
private dev_proc_print_page(pcx24b_print_page);
 
92
static dev_proc_print_page(pcx24b_print_page);
93
93
 
94
 
private const gx_device_procs pcx24b_procs =
 
94
static const gx_device_procs pcx24b_procs =
95
95
prn_color_procs(gdev_prn_open, gdev_prn_output_page, gdev_prn_close,
96
96
                gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb);
97
97
const gx_device_printer gs_pcx24b_device =
103
103
 
104
104
/* 4-bit chunky CMYK color. */
105
105
 
106
 
private dev_proc_print_page(pcxcmyk_print_page);
 
106
static dev_proc_print_page(pcxcmyk_print_page);
107
107
 
108
 
private const gx_device_procs pcxcmyk_procs =
 
108
static const gx_device_procs pcxcmyk_procs =
109
109
{
110
110
    gdev_prn_open,
111
111
    NULL,                       /* get_initial_matrix */
171
171
} pcx_header;
172
172
 
173
173
/* Define the prototype header. */
174
 
private const pcx_header pcx_header_prototype =
 
174
static const pcx_header pcx_header_prototype =
175
175
{
176
176
    10,                         /* manuf */
177
177
    0,                          /* version (variable) */
207
207
#define dcx_max_pages 1023
208
208
 
209
209
/* Forward declarations */
210
 
private void pcx_write_rle(const byte *, const byte *, int, FILE *);
211
 
private int pcx_write_page(gx_device_printer *, FILE *, pcx_header *, bool);
 
210
static void pcx_write_rle(const byte *, const byte *, int, FILE *);
 
211
static int pcx_write_page(gx_device_printer *, FILE *, pcx_header *, bool);
212
212
 
213
213
/* Write a monochrome PCX page. */
214
 
private int
 
214
static int
215
215
pcxmono_print_page(gx_device_printer * pdev, FILE * file)
216
216
{
217
217
    pcx_header header;
234
234
    0x55, 0x55, 0x55, 0x55, 0x55, 0xff, 0x55, 0xff, 0x55, 0x55, 0xff, 0xff,
235
235
    0xff, 0x55, 0x55, 0xff, 0x55, 0xff, 0xff, 0xff, 0x55, 0xff, 0xff, 0xff
236
236
};
237
 
private int
 
237
static int
238
238
pcx16_print_page(gx_device_printer * pdev, FILE * file)
239
239
{
240
240
    pcx_header header;
250
250
}
251
251
 
252
252
/* Write a "new" PCX page. */
253
 
private int
 
253
static int
254
254
pcx256_print_page(gx_device_printer * pdev, FILE * file)
255
255
{
256
256
    pcx_header header;
272
272
}
273
273
 
274
274
/* Write a 24-bit color PCX page. */
275
 
private int
 
275
static int
276
276
pcx24b_print_page(gx_device_printer * pdev, FILE * file)
277
277
{
278
278
    pcx_header header;
293
293
    0x00, 0xff, 0xff, 0x00, 0x0f, 0x0f, 0x00, 0xff, 0x00, 0x00, 0x0f, 0x00,
294
294
    0x00, 0x00, 0xff, 0x00, 0x00, 0x0f, 0x1f, 0x1f, 0x1f, 0x0f, 0x0f, 0x0f,
295
295
};
296
 
private int
 
296
static int
297
297
pcxcmyk_print_page(gx_device_printer * pdev, FILE * file)
298
298
{
299
299
    pcx_header header;
311
311
/* Write out a page in PCX format. */
312
312
/* This routine is used for all formats. */
313
313
/* The caller has set header->bpp, nplanes, and palette. */
314
 
private int
 
314
static int
315
315
pcx_write_page(gx_device_printer * pdev, FILE * file, pcx_header * phdr,
316
316
               bool planar)
317
317
{
420
420
/* ------ Internal routines ------ */
421
421
 
422
422
/* Write one line in PCX run-length-encoded format. */
423
 
private void
 
423
static void
424
424
pcx_write_rle(const byte * from, const byte * end, int step, FILE * file)
425
425
{                               /*
426
426
                                 * The PCX format theoretically allows encoding runs of 63