[gs-commits] ghostpdl branch, gs9.28-temp-for-testing, updated. gs9.28-temp-for-testing-tag-4-g802b23e

[email protected] (Robin Watts)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, gs9.28-temp-for-testing has been updated
       via  802b23e38b229936d56c28a4c00cf55cf7a42d3a (commit)
      from  00372c15c7a16b82998a21cef2fa3ad78904f2d7 (commit)

----------------------------------------------------------------------
commit 802b23e38b229936d56c28a4c00cf55cf7a42d3a
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(-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.