[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1628-g5569e2b

[email protected] (Robin Watts)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  5569e2b2057a25ff1fe0b2b5106e71f2b5142f5c (commit)
       via  51dbfc90fdc681f4500b498cec52056fb0d2224b (commit)
      from  1e48a71a99beb5870edadf0754e2c3bcf6a86f87 (commit)

----------------------------------------------------------------------
commit 5569e2b2057a25ff1fe0b2b5106e71f2b5142f5c
Author: Robin Watts <[email protected]>
Date:   Sat Aug 31 12:45:47 2019 +0100

    Update overprint hl_color code to cope with 16bit devices too.

diff --git a/base/gsovrc.c b/base/gsovrc.c
index a7b88c0..ad75b58 100644
--- a/base/gsovrc.c
+++ b/base/gsovrc.c
@@ -1057,7 +1057,7 @@ overprint_copy_planes(gx_device * dev, const byte * data, int data_x, int raster
 }
 
 /* Currently we really should only be here if the target device is planar
-   AND it supports devn colors AND is 8 bit. */
+   AND it supports devn colors AND is 8 or 16 bit. */
 static int
 overprint_fill_rectangle_hl_color(gx_device *dev,
     const gs_fixed_rect *rect, const gs_gstate *pgs,
@@ -1078,6 +1078,7 @@ overprint_fill_rectangle_hl_color(gx_device *dev,
     gx_color_index          comps = opdev->drawn_comps;
     gx_color_index          mask;
     int                     shift;
+    int                     deep;
 
     if (tdev == 0)
         return 0;
@@ -1094,6 +1095,7 @@ overprint_fill_rectangle_hl_color(gx_device *dev,
     byte_depth = depth / num_comps;
     mask = ((gx_color_index)1 << byte_depth) - 1;
     shift = 16 - byte_depth;
+    deep = byte_depth == 16;
 
     /* allocate a buffer for the returned data */
     raster = bitmap_raster(w * byte_depth);
@@ -1142,7 +1144,7 @@ overprint_fill_rectangle_hl_color(gx_device *dev,
             if ((comps & 0x01) == 1) {
                 /* Not sure if a loop or a memset is better here */
                 memset(gb_params.data[k],
-                        ((pdcolor->colors.devn.values[k]) >> shift & mask), w);
+                        ((pdcolor->colors.devn.values[k]) >> shift & mask), w<<deep);
             }
             comps >>= 1;
         }

----------------------------------------------------------------------
commit 51dbfc90fdc681f4500b498cec52056fb0d2224b
Author: Robin Watts <[email protected]>
Date:   Sat Aug 31 12:16:40 2019 +0100

    Fix deep color transparency overprint.
    
    The component copy loop at the end of the blend could fail to copy
    enough entries.

diff --git a/base/gxblend.c b/base/gxblend.c
index 9b6f9f2..59d0dea 100644
--- a/base/gxblend.c
+++ b/base/gxblend.c
@@ -1486,7 +1486,7 @@ art_blend_pixel_16_inline(uint16_t *gs_restrict dst, const uint16_t *gs_restrict
                     /* Otherwise we have B(cb, cs)= cs if cs is specified in
                      * the current color space all other color should get cb.
                      * Essentially the standard overprint case. */
-                    for (i = 0, comps = drawn_comps; comps != 0; ++i, comps >>= 1) {
+                    for (i = 0, comps = drawn_comps; i < n_chan; ++i, comps >>= 1) {
                         if ((comps & 0x1) != 0) {
                             dst[i] = src[i];
                         } else {


Summary of changes:
 base/gsovrc.c  | 6 ++++--
 base/gxblend.c | 2 +-
 2 files changed, 5 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.