diff options
-rw-r--r-- | base/gdevdevn.c | 4 | ||||
-rw-r--r-- | base/gdevdflt.c | 2 | ||||
-rw-r--r-- | base/gdevnfwd.c | 4 | ||||
-rw-r--r-- | base/gdevp14.c | 12 | ||||
-rw-r--r-- | base/gdevsclass.c | 4 | ||||
-rw-r--r-- | base/gscdevn.c | 2 | ||||
-rw-r--r-- | base/gscsepr.c | 2 | ||||
-rw-r--r-- | base/gsequivc.c | 10 | ||||
-rw-r--r-- | base/gsequivc.h | 3 | ||||
-rw-r--r-- | base/gsicc_manage.c | 2 | ||||
-rw-r--r-- | base/gxdevcli.h | 2 | ||||
-rw-r--r-- | devices/gdevdsp.c | 4 | ||||
-rw-r--r-- | devices/gdevtsep.c | 4 |
13 files changed, 29 insertions, 26 deletions
diff --git a/base/gdevdevn.c b/base/gdevdevn.c index f67912768..5e85fd7a1 100644 --- a/base/gdevdevn.c +++ b/base/gdevdevn.c @@ -1185,11 +1185,11 @@ gx_devn_prn_ret_devn_params_const(const gx_device * dev) * Device proc for updating the equivalent CMYK color for spot colors. */ int -gx_devn_prn_update_spot_equivalent_colors(gx_device *dev, const gs_gstate * pgs) +gx_devn_prn_update_spot_equivalent_colors(gx_device *dev, const gs_gstate * pgs, const gs_color_space *pcs) { gx_devn_prn_device *pdev = (gx_devn_prn_device *)dev; - return update_spot_equivalent_cmyk_colors(dev, pgs, &pdev->devn_params, + return update_spot_equivalent_cmyk_colors(dev, pgs, pcs, &pdev->devn_params, &pdev->equiv_cmyk_colors); } diff --git a/base/gdevdflt.c b/base/gdevdflt.c index 71d8c1c7f..638b66eab 100644 --- a/base/gdevdflt.c +++ b/base/gdevdflt.c @@ -1027,7 +1027,7 @@ gx_default_include_color_space(gx_device *pdev, gs_color_space *cspace, * src/gsequivc.c. */ int -gx_default_update_spot_equivalent_colors(gx_device *pdev, const gs_gstate * pgs) +gx_default_update_spot_equivalent_colors(gx_device *pdev, const gs_gstate * pgs, const gs_color_space *pcs) { return 0; } diff --git a/base/gdevnfwd.c b/base/gdevnfwd.c index f761750bc..948bfa09e 100644 --- a/base/gdevnfwd.c +++ b/base/gdevnfwd.c @@ -809,14 +809,14 @@ gx_forward_fill_linear_color_triangle(gx_device *dev, const gs_fill_attributes * } int -gx_forward_update_spot_equivalent_colors(gx_device *dev, const gs_gstate * pgs) +gx_forward_update_spot_equivalent_colors(gx_device *dev, const gs_gstate * pgs, const gs_color_space *pcs) { gx_device_forward * const fdev = (gx_device_forward *)dev; gx_device *tdev = fdev->target; int code = 0; if (tdev != NULL) - code = dev_proc(tdev, update_spot_equivalent_colors)(tdev, pgs); + code = dev_proc(tdev, update_spot_equivalent_colors)(tdev, pgs, pcs); return code; } diff --git a/base/gdevp14.c b/base/gdevp14.c index d7992bc42..41b16e2a8 100644 --- a/base/gdevp14.c +++ b/base/gdevp14.c @@ -10214,33 +10214,31 @@ pdf14_accum_get_color_mapping_procs(const gx_device * dev, const gx_device **map * Device proc for updating the equivalent CMYK color for spot colors. */ static int -pdf14_accum_update_spot_equivalent_colors(gx_device * dev, const gs_gstate * pgs) +pdf14_accum_update_spot_equivalent_colors(gx_device * dev, const gs_gstate * pgs, const gs_color_space *pcs) { gx_device_pdf14_accum *pdev = (gx_device_pdf14_accum *)dev; gx_device *tdev = ((pdf14_device *)(pdev->save_p14dev))->target; - int code = update_spot_equivalent_cmyk_colors(dev, pgs, &pdev->devn_params, + int code = update_spot_equivalent_cmyk_colors(dev, pgs, pcs, &pdev->devn_params, &pdev->equiv_cmyk_colors); if (code >= 0 && tdev != NULL) - code = dev_proc(tdev, update_spot_equivalent_colors)(tdev, pgs); + code = dev_proc(tdev, update_spot_equivalent_colors)(tdev, pgs, pcs); return code; } /* Used when doing overprint simulation and have spot colors */ static int -pdf14_update_spot_equivalent_colors(gx_device *dev, const gs_gstate *pgs) +pdf14_update_spot_equivalent_colors(gx_device *dev, const gs_gstate *pgs, const gs_color_space *pcs) { pdf14_device *pdev = (pdf14_device *)dev; - const gs_color_space *pcs; int code; /* Make sure we are not All or None */ - pcs = gs_currentcolorspace_inline(pgs); if (pcs != NULL && pcs->type->index == gs_color_space_index_Separation && pcs->params.separation.sep_type != SEP_OTHER) return 0; - code = update_spot_equivalent_cmyk_colors(dev, pgs, &pdev->devn_params, + code = update_spot_equivalent_cmyk_colors(dev, pgs, pcs, &pdev->devn_params, &pdev->op_pequiv_cmyk_colors); return code; } diff --git a/base/gdevsclass.c b/base/gdevsclass.c index aec268939..2f757b769 100644 --- a/base/gdevsclass.c +++ b/base/gdevsclass.c @@ -596,10 +596,10 @@ int default_subclass_fill_linear_color_triangle(gx_device *dev, const gs_fill_at return gx_default_fill_linear_color_triangle(dev, fa, p0, p1, p2, c0, c1, c2); } -int default_subclass_update_spot_equivalent_colors(gx_device *dev, const gs_gstate * pgs) +int default_subclass_update_spot_equivalent_colors(gx_device *dev, const gs_gstate * pgs, const gs_color_space *pcs) { if (dev->child) - return dev_proc(dev->child, update_spot_equivalent_colors)(dev->child, pgs); + return dev_proc(dev->child, update_spot_equivalent_colors)(dev->child, pgs, pcs); return 0; } diff --git a/base/gscdevn.c b/base/gscdevn.c index 41febb7f9..a7a933505 100644 --- a/base/gscdevn.c +++ b/base/gscdevn.c @@ -747,7 +747,7 @@ gx_install_DeviceN(gs_color_space * pcs, gs_gstate * pgs) if (code >= 0) { if (dev_proc(pgs->device, update_spot_equivalent_colors)) code = dev_proc(pgs->device, update_spot_equivalent_colors) - (pgs->device, pgs); + (pgs->device, pgs, pcs); } return code; } diff --git a/base/gscsepr.c b/base/gscsepr.c index 104001065..ce7c55373 100644 --- a/base/gscsepr.c +++ b/base/gscsepr.c @@ -172,7 +172,7 @@ gx_install_Separation(gs_color_space * pcs, gs_gstate * pgs) */ if (dev_proc(pgs->device, update_spot_equivalent_colors)) code = dev_proc(pgs->device, update_spot_equivalent_colors) - (pgs->device, pgs); + (pgs->device, pgs, pcs); } return code; } diff --git a/base/gsequivc.c b/base/gsequivc.c index e2b9c33dd..d56d4b533 100644 --- a/base/gsequivc.c +++ b/base/gsequivc.c @@ -283,10 +283,10 @@ static bool check_all_colors_known(int num_spot, /* If possible, update the equivalent CMYK color for a spot color */ int -update_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_gstate * pgs, +update_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_gstate * pgs, const gs_color_space * pcs_in, gs_devn_params * pdevn_params, equivalent_cmyk_color_params * pparams) { - const gs_color_space * pcs; + gs_color_space * pcs = pcs_in; cmm_dev_profile_t *dev_profile; int code; @@ -303,12 +303,16 @@ update_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_gstate * pgs, pparams->all_color_info_valid = true; return 0; } + + /* If the caller apssed in NULL for the colour space, use the current colour space */ + if (pcs_in == NULL) + pcs = gs_currentcolorspace_inline(pgs); + /* * Verify that the given color space is a Separation or a DeviceN color * space. If so then when check if the color space contains a separation * color for which we need a CMYK equivalent. */ - pcs = gs_currentcolorspace_inline(pgs); if (pcs != NULL) { if (pcs->type->index == gs_color_space_index_Separation) { update_Separation_spot_equivalent_cmyk_colors(pdev, pgs, pcs, diff --git a/base/gsequivc.h b/base/gsequivc.h index 0ea3ead44..d5501b2df 100644 --- a/base/gsequivc.h +++ b/base/gsequivc.h @@ -61,7 +61,8 @@ typedef struct equivalent_cmyk_color_params_s { * If possible, update the equivalent CMYK color for spot colors. */ int update_spot_equivalent_cmyk_colors(gx_device * pdev, - const gs_gstate * pgs, gs_devn_params * pdevn_params, + const gs_gstate * pgs, const gs_color_space * pcs, + gs_devn_params * pdevn_params, equivalent_cmyk_color_params * pparams); /* diff --git a/base/gsicc_manage.c b/base/gsicc_manage.c index 0842628d8..9ea1e3512 100644 --- a/base/gsicc_manage.c +++ b/base/gsicc_manage.c @@ -1546,7 +1546,7 @@ gsicc_set_devicen_equiv_colors(gx_device *dev, const gs_gstate * pgs, return gs_throw(gs_error_VMerror, "Insufficient memory for devn equiv colors"); pcspace->cmm_icc_profile_data = profile; temp_state.color[0].color_space = pcspace; - return dev_proc(dev, update_spot_equivalent_colors)(dev, &temp_state); + return dev_proc(dev, update_spot_equivalent_colors)(dev, &temp_state, pcspace); } #define DEFAULT_ICC_PROCESS "Cyan, Magenta, Yellow, Black," diff --git a/base/gxdevcli.h b/base/gxdevcli.h index 9364349c0..2476ea338 100644 --- a/base/gxdevcli.h +++ b/base/gxdevcli.h @@ -1295,7 +1295,7 @@ typedef struct gs_fill_attributes_s { * start of src/gsequivc.c. */ #define dev_t_proc_update_spot_equivalent_colors(proc, dev_t)\ - int proc(dev_t *dev, const gs_gstate * pgs) + int proc(dev_t *dev, const gs_gstate * pgs, const gs_color_space *pcs) #define dev_proc_update_spot_equivalent_colors(proc)\ dev_t_proc_update_spot_equivalent_colors(proc, gx_device) diff --git a/devices/gdevdsp.c b/devices/gdevdsp.c index d772ccfdc..b6349ad73 100644 --- a/devices/gdevdsp.c +++ b/devices/gdevdsp.c @@ -1276,12 +1276,12 @@ display_separation_decode_color(gx_device * dev, gx_color_index color, * Device proc for updating the equivalent CMYK color for spot colors. */ static int -display_update_spot_equivalent_colors(gx_device * dev, const gs_gstate * pgs) +display_update_spot_equivalent_colors(gx_device * dev, const gs_gstate * pgs, const gs_color_space *pcs) { gx_device_display * ddev = (gx_device_display *)dev; if ((ddev->nFormat & DISPLAY_COLORS_MASK) == DISPLAY_COLORS_SEPARATION) - update_spot_equivalent_cmyk_colors(dev, pgs, + update_spot_equivalent_cmyk_colors(dev, pgs, pcs, &ddev->devn_params, &ddev->equiv_cmyk_colors); return 0; } diff --git a/devices/gdevtsep.c b/devices/gdevtsep.c index 10d3b6335..657a3c870 100644 --- a/devices/gdevtsep.c +++ b/devices/gdevtsep.c @@ -956,11 +956,11 @@ tiffsep_decode_color(gx_device * dev, gx_color_index color, gx_color_value * out * Device proc for updating the equivalent CMYK color for spot colors. */ static int -tiffsep_update_spot_equivalent_colors(gx_device * dev, const gs_gstate * pgs) +tiffsep_update_spot_equivalent_colors(gx_device * dev, const gs_gstate * pgs, const gs_color_space *pcs) { tiffsep_device * pdev = (tiffsep_device *)dev; - update_spot_equivalent_cmyk_colors(dev, pgs, + update_spot_equivalent_cmyk_colors(dev, pgs, pcs, &pdev->devn_params, &pdev->equiv_cmyk_colors); return 0; } |