[gs-cvs] rev 8147 - trunk/gs/src

ray at ghostscript.com ray at ghostscript.com
Fri Jul 27 13:14:36 PDT 2007


Author: ray
Date: 2007-07-27 13:14:35 -0700 (Fri, 27 Jul 2007)
New Revision: 8147

Modified:
   trunk/gs/src/gxipixel.c
Log:
Apply a long pending patch that only affects an ancient 'alphaimage'
operator (Next display PostScript extension). Bug #592160.

DETAILS:

The bug report didn't include a test file, but reading the spec on
this operator found at:

http://objc.toodarkpark.net/AppKit/Functions/PSOperators.html

it seems that the number of components provided does not account
for the alpha channel. The relevant excerpt is:

Synopsis: pixelswide pixelshigh bits/sample matrix datasrc0 [...datasrcn] multiproc ncolors alphaimage -

Renders an image whose samples include an alpha component. This
operator is similar to the standard colorimage operator. However,
note the following:

    * When supplying the data components, alpha is always given
      last-either as the last data source (datasrcn) if the data
      is given in separate vectors, or as the last element in a
      set of interleaved data.

    * The ncolors operand doesn't account for alpha -- the
      value of ncolors is the number of color components only.

This final note is the justification for the patch.


Modified: trunk/gs/src/gxipixel.c
===================================================================
--- trunk/gs/src/gxipixel.c	2007-07-27 04:27:36 UTC (rev 8146)
+++ trunk/gs/src/gxipixel.c	2007-07-27 20:14:35 UTC (rev 8147)
@@ -231,7 +231,7 @@
     gx_image_enum_common_init((gx_image_enum_common_t *)penum,
 			      (const gs_data_image_t *)pim,
 			      &image1_enum_procs, dev,
-			      (masked ? 1 : cs_num_components(pcs)),
+			      (masked ? 1 : (penum->alpha ? cs_num_components(pcs)+1 : cs_num_components(pcs))),
 			      format);
     if (penum->rect.w == width && penum->rect.h == height) {
 	x_extent = row_extent;



More information about the gs-cvs mailing list