[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1609-g2e87250
[email protected] (Robin Watts)
| Newsgroups | gmane.comp.printing.ghostscript.cvs |
|---|---|
| Message-ID | <[email protected]> |
The ghostpdl branch, master has been updated
via 2e872508d683302b556a160004a9ca3d64e7b4f1 (commit)
from 1fe43c3ba4423631129925d789c936b9e461d1d6 (commit)
----------------------------------------------------------------------
commit 2e872508d683302b556a160004a9ca3d64e7b4f1
Author: Robin Watts <[email protected]>
Date: Mon Aug 26 14:01:39 2019 +0100
Fix SoftLight blending in deep color transparency.
As seen with:
gs -sDEVICE=psdcmyk16 -r72 -dMaxBitmap=80000000 -o out.psd
tests_private/pdf/PDF_1.7_FTS/fts_09_0919.pdf
diff --git a/base/gxblend.c b/base/gxblend.c
index 6756613..8f6645e 100644
--- a/base/gxblend.c
+++ b/base/gxblend.c
@@ -1360,9 +1360,12 @@ art_blend_pixel_16_inline(uint16_t *gs_restrict dst, const uint16_t *gs_restrict
for (i = 0; i < n_chan; i++) {
b = backdrop[i];
s = src[i];
- if (s <= 0x8000) {
- int b2 = b + (b>>15);
- dst[i] = b - (((0xffff - (s<<1)) * b2 * (0x10000 - b2))>>16);
+ if (s < 0x8000) {
+ unsigned int b2 = ((unsigned int)(b * (b + (b>>15))))>>16;
+ b2 = b - b2;
+ b2 += b2>>15;
+ t = ((0xffff - (s << 1)) * b2) + 0x8000;
+ dst[i] = b - (t >> 16);
} else {
#define art_blend_soft_light_16(B) (art_blend_soft_light_8[(B)>>8]*0x101)
t = ((s << 1) - 0xffff) * art_blend_soft_light_16(b) + 0x8000;
Summary of changes:
base/gxblend.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)