[gs-commits] rev 11784 - trunk/ghostpdl/pcl

henrys at ghostscript.com henrys at ghostscript.com
Mon Oct 11 17:07:19 UTC 2010


Author: henrys
Date: 2010-10-11 17:07:18 +0000 (Mon, 11 Oct 2010)
New Revision: 11784

Modified:
   trunk/ghostpdl/pcl/pcindxed.c
Log:
PCL should copy the complete palette, pens (entries) outside of range
are initialized to black (component 0) in the original palette, see
pcindexed.c:504.  Also, there should never be a need to reset the
graphics library's high value in an indexed color space.  Likely this
would just mask a problem in pcl's tandem indexed color space state.
No expected differences.


Modified: trunk/ghostpdl/pcl/pcindxed.c
===================================================================
--- trunk/ghostpdl/pcl/pcindxed.c	2010-10-11 16:56:24 UTC (rev 11783)
+++ trunk/ghostpdl/pcl/pcindxed.c	2010-10-11 17:07:18 UTC (rev 11784)
@@ -188,7 +188,8 @@
     pnew->cid = pindexed->cid;
     pnew->original_cspace = pindexed->original_cspace;
     pnew->num_entries = pindexed->num_entries;
-    memcpy(pnew->palette.data, pindexed->palette.data, 3 * num_entries);
+    pnew->palette.size = pindexed->palette.size;
+    memcpy(pnew->palette.data, pindexed->palette.data, pindexed->palette.size);
     memcpy(pnew->pen_widths, pindexed->pen_widths, num_entries * sizeof(float));
     memcpy(pnew->norm, pindexed->norm, 3 * sizeof(pindexed->norm[0]));
     memcpy(pnew->Decode, pindexed->Decode, 6 * sizeof(float));
@@ -498,7 +499,8 @@
                                     cnt
                                     );
 
-    /* all other entries are black (always comp. value 0).  For simplicity we reset all of the the remaining pallete data. */
+    /* all other entries are black (always comp. value 0).  For
+       simplicity we reset all of the the remaining pallete data. */
     if (num > cnt) {
         int bytes_initialized = 3 * (start + cnt);
         int bytes_left = (3 * pcl_cs_indexed_palette_size) - bytes_initialized;
@@ -707,10 +709,6 @@
         return code;
     pindexed = *ppindexed;
     pindexed->num_entries = new_num;
-    /* syncronize pcl's copy of the palette with the graphics
-       library's color index.  The need for parallel tables is
-       dubious. */
-    pindexed->pcspace->params.indexed.hival = new_num - 1;
     pindexed->cid.bits_per_index = bits;
 
     /* check if the Decode array must be updated */



More information about the gs-commits mailing list