[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1611-g3554f0f

[email protected] (Robin Watts)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  3554f0fc4dadebad2e816adbd7cf4a548f76de74 (commit)
       via  5280581fd0c075da7dc0632937e294a9fa3fe736 (commit)
      from  2e872508d683302b556a160004a9ca3d64e7b4f1 (commit)

----------------------------------------------------------------------
commit 3554f0fc4dadebad2e816adbd7cf4a548f76de74
Author: Robin Watts <[email protected]>
Date:   Mon Aug 26 15:28:33 2019 +0100

    Fix deep colour knockout logic.
    
    Problem seen with:
    
     tests_private/pdf/PDF_1.7_FTS/fts_25_2507.pdf.psdcmyk16.72.0

diff --git a/base/gxblend.c b/base/gxblend.c
index 8f6645e..cf9991b 100644
--- a/base/gxblend.c
+++ b/base/gxblend.c
@@ -1395,7 +1395,7 @@ art_blend_pixel_16_inline(uint16_t *gs_restrict dst, const uint16_t *gs_restrict
                 else if (b >= s)
                     dst[i] = 0xffff;
                 else
-                    dst[i] = (unsigned int)(0xffff * b + (s>>1)) / (unsigned int)s;
+                    dst[i] = ((unsigned int)(0xffff * b + (s>>1))) / s;
             }
             break;
         case BLEND_MODE_ColorBurn:
@@ -1407,7 +1407,7 @@ art_blend_pixel_16_inline(uint16_t *gs_restrict dst, const uint16_t *gs_restrict
                 else if (b >= s)
                     dst[i] = 0;
                 else
-                    dst[i] = 0xffff - (unsigned int)(0xffff * b + (s>>1)) / (unsigned int)s;
+                    dst[i] = 0xffff - ((unsigned int)(0xffff * b + (s>>1))) / s;
             }
             break;
         case BLEND_MODE_Darken:
@@ -2582,12 +2582,13 @@ art_pdf_composite_knockout_16(uint16_t *gs_restrict dst,
         for (i = 0; i < n_chan; i++) {
             int c_bl;		/* Result of blend function */
             int c_mix;		/* Blend result mixed with source color */
+            int stmp;
 
             c_s = src[i];
             c_b = dst[i];
             c_bl = blend[i];
-            tmp = a_b * (c_bl - ((int)c_s)) + 0x8000;
-            c_mix = c_s + (((tmp >> 16) + tmp) >> 16);
+            stmp = (a_b>>1) * (c_bl - ((int)c_s)) + 0x4000;
+            c_mix = c_s + (((stmp >> 16) + stmp) >> 15);
             tmp = (c_b << 16) + src_scale * (c_mix - c_b) + 0x8000;
             dst[i] = tmp >> 16;
         }

----------------------------------------------------------------------
commit 5280581fd0c075da7dc0632937e294a9fa3fe736
Author: Robin Watts <[email protected]>
Date:   Mon Aug 26 14:34:46 2019 +0100

    Squash a couple of warnings.

diff --git a/base/gdevmem.c b/base/gdevmem.c
index 9a3fe5e..7b158a0 100644
--- a/base/gdevmem.c
+++ b/base/gdevmem.c
@@ -387,7 +387,7 @@ gdev_mem_max_height(const gx_device_memory * dev, int width, ulong size,
     int height;
     ulong max_height;
     ulong data_size;
-    bool deep = device_is_deep(dev);
+    bool deep = device_is_deep((const gx_device *)dev);
 
     if (page_uses_transparency) {
         /*
diff --git a/base/gdevp14.c b/base/gdevp14.c
index d38951a..aecc354 100644
--- a/base/gdevp14.c
+++ b/base/gdevp14.c
@@ -6798,7 +6798,7 @@ c_pdf14trans_write(const gs_composite_t	* pct, byte * data, uint * psize,
     int pdf14_needed = cdev->pdf14_needed;
     int trans_group_level = cdev->pdf14_trans_group_level;
     int smask_level = cdev->pdf14_smask_level;
-    bool deep = device_is_deep(cdev);
+    bool deep = device_is_deep((gx_device *)cdev);
 
     code = dev_proc((gx_device *) cdev, get_profile)((gx_device *) cdev,
                                                      &dev_profile);


Summary of changes:
 base/gdevmem.c | 2 +-
 base/gdevp14.c | 2 +-
 base/gxblend.c | 9 +++++----
 3 files changed, 7 insertions(+), 6 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.