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

[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  d80a7eacb629029828ccb79b8bee03a0b471b8c1 (commit)
       via  1199113e458fd63702a270783124dd9832732d84 (commit)
      from  6564a3f4c8155cfb9e3cbe4c6d4f1b09758a20b0 (commit)

----------------------------------------------------------------------
commit d80a7eacb629029828ccb79b8bee03a0b471b8c1
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 1199113e458fd63702a270783124dd9832732d84
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.