Fix for 687883 and 687980r
"Dan Coby" <[email protected]> Fri, 22 Apr 2005 15:02:05 -0700
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <[email protected]> |
Fir for 687883 tiff32nc device and PDF transparency and for 687980
image missing with psdcmyk driver.
DETAILS:
The absence of the images was caused by an error in the handling of PDF 1.4
transparency soft masks (SMask). The mask data is monochrome. However it
is saved (like all PDF 1.4 transparency related colors) in the blending
color space. Currently the process color model of the output device is
being used for the PDF 1.4 blending space.
The fix consists of inverting the image mask data when a subtractive
blending color space is being used.
Dan
Index: src/gdevp14.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevp14.c,v
retrieving revision 1.27
diff -r1.27 gdevp14.c
506,507c506,515
< if (mask_alpha == 255)
< mask = mask_ptr[x]; /* todo: rgba->mask */
---
> /*
> * The mask data is really monochrome. Thus for additive (RGB)
> * we use the R channel for alpha since R = G = B. For
> * subtractive (CMYK) we use the K channel.
> */
> if (mask_alpha == 255) {
> /* todo: rgba->mask */
> mask = additive ? mask_ptr[x]
> : 255 - mask_ptr[x + 3 * mask_planestride];
> }
511c519,522
< int t2 = (mask_ptr[x] - mask_bg_alpha) * mask_alpha + 0x80;
---
> int t2 = additive ? mask_ptr[x]
> : 255 - mask_ptr[x + 3 * mask_planestride];
>
> t2 = (t2 - mask_bg_alpha) * mask_alpha + 0x80;