summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2009-10-29 02:07:58 +0000
committerRay Johnston <ray.johnston@artifex.com>2009-10-29 02:07:58 +0000
commit4c78545ef2c1d9f8b9fff9708d514c4c95e626d2 (patch)
tree3ebf6142c89ab1e5c413ed04374e15a673b3bfc2
parented277bde45e174e00ed7b1b9375bdb410b901afd (diff)
Fix for clist setcolor when compressed color encoding is used which is the
default build case for the tiffsep and psdcmyk and others . Bug 690851. DETAILS: The compressed color encoding always uses 64 bit (sizeof(gx_color_index)). The (num_components * 8) is not the correct depth (number of bits) for color encoding in the clist. This patch detects (at run time) that compressed color encoding is using by examining the 'my_encode_color' procedure since there is no direct way to determine if compressed color encoding is being used. EXPECTED DIFFERENCES: None (until we test with a 'sep' device such as psdcmyk or tiffsep) since only these devices use (in the current default build) compressed color encoding. The Bug690206.pdf file exhibited the problem with tiffsep and psdcmyk in clist mode. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@10240 a1074d23-0009-0410-80fe-cf8c14f379e6
-rw-r--r--gs/base/gdevp14.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/gs/base/gdevp14.c b/gs/base/gdevp14.c
index c6dc1c073..bfc25599f 100644
--- a/gs/base/gdevp14.c
+++ b/gs/base/gdevp14.c
@@ -232,11 +232,17 @@ static const gx_device_procs pdf14_CMYK_procs =
gx_default_DevCMYK_get_color_comp_index,
pdf14_encode_color, pdf14_decode_color);
+#if USE_COMPRESSED_ENCODING
static const gx_device_procs pdf14_CMYKspot_procs =
pdf14_dev_procs(pdf14_cmykspot_get_color_mapping_procs,
pdf14_cmykspot_get_color_comp_index,
- pdf14_compressed_encode_color,
- pdf14_compressed_decode_color);
+ pdf14_compressed_encode_color, pdf14_compressed_decode_color);
+#else
+static const gx_device_procs pdf14_CMYKspot_procs =
+ pdf14_dev_procs(pdf14_cmykspot_get_color_mapping_procs,
+ pdf14_cmykspot_get_color_comp_index,
+ pdf14_encode_color, pdf14_decode_color);
+#endif
static const gx_device_procs pdf14_custom_procs =
pdf14_dev_procs(gx_forward_get_color_mapping_procs,
@@ -5896,15 +5902,19 @@ c_pdf14trans_clist_write_update(const gs_composite_t * pcte, gx_device * dev,
* our PDF 1.4 blend operations.
*/
- /* Also if the bit depth is not 8 per channel we need to adjust
- as all the pdf14 compositing code is for 8 bits per channel. The
- clist writer device uses this information to make sure the proper
- bit depth is written */
-
- if (cdev->clist_color_info.num_components * 8 != cdev->clist_color_info.depth)
+ /*
+ * Also if the bit depth is not 8 per channel we need to adjust
+ * as all the pdf14 compositing code is for 8 bits per channel. The
+ * clist writer device uses this information to make sure the proper
+ * bit depth is written. If we are using compressed color enconding,
+ * the color is written in a gx_color_index even for more than 8
+ * components.
+ */
+ p14dev = (pdf14_clist_device *)(*pcdev);
+ if (cdev->clist_color_info.num_components * 8 != cdev->clist_color_info.depth &&
+ p14dev->my_encode_color != pdf14_compressed_encode_color)
cdev->clist_color_info.depth = cdev->clist_color_info.num_components * 8;
- p14dev = (pdf14_clist_device *)(*pcdev);
p14dev->saved_target_color_info = dev->color_info;
dev->color_info = (*pcdev)->color_info;
p14dev->saved_target_encode_color = dev->procs.encode_color;