ports/print/ghostscript9/files/patch-epag__gdevepag.c
Hiroki Sato cef5efef69 Add print/ghostscript9, an interpreter of PostScript and PDF page
description languages.  Changes from 8.x series include:

- This release includes a move to an ICC-based color rendering
  workflow. The design allows easy integration of 3rd party color
  management modules (CMMs) and management of DeviceN and spot source
  colors with ICC profiles as well as with non-ICC proprietary
  methods. The default CMM is the well known littleCMS.  Postscript
  color objects and non-ICC CIE-based PDF color spaces are converted
  to equivalent ICC profiles enabling complete color management for
  all color spaces by an ICC-based CMM. New command line options
  enable the specification of gray, rgb and cmyk default ICC profiles
  as well as output device ICC profiles. The new work flow provides
  performance improvements in the rendering of images, shadings and
  transparencies. In addition, the color conversions are designed to
  work efficiently in multithreaded display list (c-list) rendering
  through the use of a shared link cache. Finally, proper ICC based
  rendering now occurs for ALL XPS objects including Named colors,
  N-Channel colors and images with internally embedded ICC profiles.

- The second major change in this release is that glyph rendering for
  all font types except Type 3 is now handled by Freetype (via a much
  improved and enhanced Font API). The most obvious benefit of this is
  a complete, and proven implementation of the TrueType byte code
  interpreter (now unencumbered by patents).

- Another major change is that the Postscript interpreter's graphics
  state now stores two separate colour space settings for stroking and
  filling, to better support the stroke and fill colours required by
  the PDF interpreter.

- Support for optional content has been added to the PDF interpreter.

- This release also includes a number of improvements to the pdfwrite
  device to improve reliability and quality with PCL and XPS
  input. Many improvements to the support of JPX images in PDF files,
  PDF annotation rendering and the usual number of general bug and
  robustness fixes.

- For security reasons, Ghostscript no longer searches the current
  directory by default. Use -P option to revert to old behavior.

- For monochrome devices, there is a new halftone technique for
  sampled image data. The existing technique is very efficient (and is
  is still used) for large areas of color, such as an area fill, but
  encountered performance problems dealing with sampled image data
  where a given colour value only covered a few pixels at a time. The
  new approach applies the halftone threshold array directly to the
  image samples.

- A new, robust CFF parser implemented in C (replacing the previous
  Poscript one)

- tiffscaled device - this renders internally as tiffgray, but then
 downsamples by an integer scale factor (specified by
 -dDownScaleFactor=n) and error diffuses to 1bpp output. The
 tiffscaled device also implements limited minimum feature size
 functionality; by setting -dMinFeatureSize to 1, 2 or 3, the device
 output is guaranteed to generate minimum dot sizes as multiples of
 the final resolution, useful for devices that offer finer position
 control than dot size control.

- Add DSC compatible output in ps2write.
2011-05-23 20:58:46 +00:00

217 lines
6.8 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--- epag/gdevepag.c.orig Sat Jul 8 13:33:09 2000
+++ epag/gdevepag.c Sat Nov 24 15:25:11 2007
@@ -102,30 +102,30 @@
} EpagBubble;
/* The device descriptors */
-private dev_proc_open_device(epag_open);
-private dev_proc_close_device(epag_close);
-private dev_proc_print_page(epag_print_page);
-private void epag_printer_initialize(gx_device_printer *pdev, FILE *fp,int);
-private dev_proc_print_page(epag_print_page);
-private dev_proc_get_params(epag_get_params);
-private dev_proc_put_params(epag_put_params);
-private void epag_paper_set(gx_device_printer *pdev, FILE *fp);
-private void epag_bubble_flush_all(EpagPageCont *cont);
-private void epag_page_cont_init(gx_device_printer *pdev,FILE *fp,EpagPageCont *cont);
-private void epag_page_close(EpagPageCont *cont);
-private int epag_read_image(EpagPageCont *cont);
-private void epag_process_line(EpagPageCont *cont);
-private int epag_is_black(EpagPageCont *cont, int bx);
-private void epag_rect_add(EpagPageCont *cont,int start,int end);
-private void epag_bubble_gen(EpagPageCont *cont,
+static dev_proc_open_device(epag_open);
+static dev_proc_close_device(epag_close);
+static dev_proc_print_page(epag_print_page);
+static void epag_printer_initialize(gx_device_printer *pdev, FILE *fp,int);
+static dev_proc_print_page(epag_print_page);
+static dev_proc_get_params(epag_get_params);
+static dev_proc_put_params(epag_put_params);
+static void epag_paper_set(gx_device_printer *pdev, FILE *fp);
+static void epag_bubble_flush_all(EpagPageCont *cont);
+static void epag_page_cont_init(gx_device_printer *pdev,FILE *fp,EpagPageCont *cont);
+static void epag_page_close(EpagPageCont *cont);
+static int epag_read_image(EpagPageCont *cont);
+static void epag_process_line(EpagPageCont *cont);
+static int epag_is_black(EpagPageCont *cont, int bx);
+static void epag_rect_add(EpagPageCont *cont,int start,int end);
+static void epag_bubble_gen(EpagPageCont *cont,
int x0, int x1, int y0, int y1);
-private void epag_bubble_flush(EpagPageCont *cont,EpagBubble *bbl);
-private void epag_bubble_image_out(EpagPageCont *cont,EpagBubble *bbl);
+static void epag_bubble_flush(EpagPageCont *cont,EpagBubble *bbl);
+static void epag_bubble_image_out(EpagPageCont *cont,EpagBubble *bbl);
/*
* <20>ǥХ<C7A5><D0A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
-private gx_device_procs prn_epag_procs =
+static gx_device_procs prn_epag_procs =
prn_params_procs(epag_open, gdev_prn_output_page, epag_close,
epag_get_params, epag_put_params);
gx_device_printer far_data gs_epag_device =
@@ -140,13 +140,13 @@
static char *epson_remote_start = "\033\001@EJL \r\n";
/* Open the printer, adjusting the margins if necessary. */
-private int
+static int
epag_open(gx_device *pdev)
{
return gdev_prn_open(pdev);
}
-private int
+static int
epag_close(gx_device *pdev)
{
gdev_prn_open_printer(pdev, 1);
@@ -163,7 +163,7 @@
return gdev_prn_close(pdev);
}
-private int
+static int
epag_print_page(gx_device_printer *pdev, FILE *fp)
{
EpagPageCont cont;
@@ -205,7 +205,7 @@
GS, '2', 'a', 'b', 'P', /* <20><><EFBFBD><EFBFBD><E1A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E5B2BC> */
};
-private void
+static void
epag_printer_initialize(gx_device_printer *pdev, FILE *fp, int copies)
{
double xDpi,yDpi;
@@ -260,7 +260,7 @@
fprintf(fp,"%c%dcoO",GS, copies < 256 ? copies : 255);
}
-private int
+static int
epag_get_params(gx_device *pdev, gs_param_list *plist)
{
int code;
@@ -286,7 +286,7 @@
}
/* Put properties. */
-private int
+static int
epag_put_params(gx_device *pdev, gs_param_list *plist)
{
param_read_int(plist, "cRowBuf", &epag_cont.cRowBuf);
@@ -380,7 +380,7 @@
/*
* epag_bubble_flush_all: <20>ĤäƤ<C3A4><C6A4><EFBFBD> bubble<6C><65><EFBFBD><EFBFBD><EFBFBD>ƽ<EFBFBD><C6BD>Ϥ<EFBFBD><CFA4>
*/
-private void epag_bubble_flush_all(EpagPageCont *cont)
+static void epag_bubble_flush_all(EpagPageCont *cont)
{
int i;
@@ -392,7 +392,7 @@
/*
* epag_page_cont_init: EpagPageCont<6E>ν<EFBFBD><CEBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хåե<C3A5><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
-private void epag_page_cont_init(gx_device_printer *pdev,FILE *fp,
+static void epag_page_cont_init(gx_device_printer *pdev,FILE *fp,
EpagPageCont *cont)
{
int bpl;
@@ -417,15 +417,15 @@
cont->maxY = epag_cont.cRowBuf / cont->bh * cont->bh ;
if(cont->maxY < cont->bh) cont->maxY = cont->bh;
- cont->bp = gs_malloc(bpl , cont->maxY, "epag_skip_blank_init(bp)");
- cont->bp2 = gs_malloc(bpl*3/2+1 , cont->maxY, "epag_skip_blank_init(bp2)");
+ cont->bp = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bpl , cont->maxY, "epag_skip_blank_init(bp)");
+ cont->bp2 = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), bpl*3/2+1 , cont->maxY, "epag_skip_blank_init(bp2)");
cont->h = cont->r = 0;
- cont->bubbleTbl=gs_malloc(sizeof(EpagBubble *),cont->maxBx,"bubbleTbl");
+ cont->bubbleTbl = (byte *)gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), sizeof(EpagBubble *),cont->maxBx,"bubbleTbl");
for(i=0;i<cont->maxBx;i++)
cont->bubbleTbl[i] = NULL;
- cont->bubbleBuffer=gs_malloc(sizeof(EpagBubble),cont->maxBx,"bubbleBuffer");
+ cont->bubbleBuffer=gs_malloc(gs_lib_ctx_get_non_gc_memory_t(), sizeof(EpagBubble),cont->maxBx,"bubbleBuffer");
bbtbl = (EpagBubble *)cont->bubbleBuffer;
for(i=0;i<cont->maxBx-1;i++)
bbtbl[i].next = &bbtbl[i+1];
@@ -433,15 +433,15 @@
cont->freeBubbleList = &bbtbl[0];
}
-private void
+static void
epag_page_close(EpagPageCont *cont)
{
- gs_free(cont->bp, bpl, cont->maxY, "epag_skip_blank_init(bp)");
- gs_free(cont->bp2, bpl*3/2+1, cont->maxY, "epag_skip_blank_init(bp2)");
- gs_free(cont->bubbleBuffer, sizeof(EpagBubble), cont->maxBx,"bubbleBuffer");
+ gs_free(gs_lib_ctx_get_non_gc_memory_t(), cont->bp, bpl, cont->maxY, "epag_skip_blank_init(bp)");
+ gs_free(gs_lib_ctx_get_non_gc_memory_t(), cont->bp2, bpl*3/2+1, cont->maxY, "epag_skip_blank_init(bp2)");
+ gs_free(gs_lib_ctx_get_non_gc_memory_t(), cont->bubbleBuffer, sizeof(EpagBubble), cont->maxBx,"bubbleBuffer");
}
-private int
+static int
epag_read_image(EpagPageCont *cont)
{
int bh = cont->bh;
@@ -473,7 +473,7 @@
/*
* bh<62><68>ʬ<EFBFBD>Υ<CEA5><E9A5B9><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
-private void
+static void
epag_process_line(EpagPageCont *cont)
{
int bh = cont->bh;
@@ -502,7 +502,7 @@
else epag_rect_add(cont, 0, cont->maxBx-1);
}
-private int
+static int
epag_is_black(EpagPageCont *cont, int bx)
{
int bh = cont->bh;
@@ -520,7 +520,7 @@
return 0;
}
-private void
+static void
epag_rect_add(EpagPageCont *cont,int start,int end)
{
int x0 = start * cont->bw;
@@ -544,7 +544,7 @@
}
}
-private void
+static void
epag_bubble_gen(EpagPageCont *cont, int x0, int x1, int y0, int y1)
{
EpagBubble *bbl;
@@ -569,7 +569,7 @@
}
}
-private void epag_bubble_flush(EpagPageCont *cont,EpagBubble *bbl)
+static void epag_bubble_flush(EpagPageCont *cont,EpagBubble *bbl)
{
int bx,bx0,bx1;
@@ -588,7 +588,7 @@
/* <20><><EFBFBD><EFBFBD><E1A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
-private void
+static void
epag_bubble_image_out(EpagPageCont *cont,EpagBubble *bbl)
{
FILE *fp = cont->fp;