Author: mvrhel
Date: 2010-02-10 20:50:16 +0000 (Wed, 10 Feb 2010)
New Revision: 10738
Modified:
branches/icc_work/base/devs.mak
branches/icc_work/base/gdevpdfc.c
Log:
Change in pdfwrite to use equivalent ICC profile member variable color space for PS CIE color spaces when compatibility is 1.3 or higher.
Modified: branches/icc_work/base/devs.mak
===================================================================
--- branches/icc_work/base/devs.mak 2010-02-10 20:27:33 UTC (rev 10737)
+++ branches/icc_work/base/devs.mak 2010-02-10 20:50:16 UTC (rev 10738)
@@ -872,7 +872,7 @@
$(GLOBJ)gdevpdfc.$(OBJ) : $(GLSRC)gdevpdfc.c $(GXERR) $(math__h) $(memory__h)\
$(gdevpdfc_h) $(gdevpdfg_h) $(gdevpdfo_h) $(gdevpdfx_h)\
$(gscie_h) $(gscindex_h) $(gscspace_h) $(gscdevn_h) $(gscsepr_h) $(gsicc_h)\
- $(sstring_h) $(stream_h) $(strimpl_h) $(gxcspace_h) $(gxcdevn_h)
+ $(sstring_h) $(stream_h) $(strimpl_h) $(gxcspace_h) $(gxcdevn_h) $(gscspace_h)
$(GLCC) $(GLO_)gdevpdfc.$(OBJ) $(C_) $(GLSRC)gdevpdfc.c
$(GLOBJ)gdevpdfd.$(OBJ) : $(GLSRC)gdevpdfd.c $(math__h) $(memory__h)\
Modified: branches/icc_work/base/gdevpdfc.c
===================================================================
--- branches/icc_work/base/gdevpdfc.c 2010-02-10 20:27:33 UTC (rev 10737)
+++ branches/icc_work/base/gdevpdfc.c 2010-02-10 20:50:16 UTC (rev 10738)
@@ -32,6 +32,7 @@
#include "sstring.h"
#include "gxcspace.h"
#include "gxcdevn.h"
+#include "gscspace.h"
/*
* PDF doesn't have general CIEBased color spaces. However, it provides
@@ -527,11 +528,12 @@
int
pdf_color_space_named(gx_device_pdf *pdev, cos_value_t *pvalue,
const gs_range_t **ppranges,
- const gs_color_space *pcs,
+ const gs_color_space *pcs_in,
const pdf_color_space_names_t *pcsn,
bool by_name, const byte *res_name, int name_length)
{
- gs_color_space_index csi = gs_color_space_get_index(pcs);
+ const gs_color_space *pcs;
+ gs_color_space_index csi;
cos_array_t *pca;
cos_dict_t *pcd;
cos_value_t v;
@@ -543,6 +545,19 @@
pdf_resource_t *pres = NULL;
int code;
+ /* If color space is CIE based and we have compatibility then go ahead and use the ICC alternative */
+ if ((pdev->CompatibilityLevel < 1.3) || !gs_color_space_is_PSCIE(pcs_in) ) {
+ pcs = pcs_in;
+ } else {
+ if (pcs_in->icc_equivalent != NULL) {
+ pcs = pcs_in->icc_equivalent;
+ } else {
+ /* Need to create the equivalent object */
+ gs_colorspace_set_icc_equivalent(pcs_in, pdev->memory);
+ pcs = pcs_in->icc_equivalent;
+ }
+ }
+ csi = gs_color_space_get_index(pcs);
if (ppranges)
*ppranges = 0; /* default */
switch (csi) {