예제 #1
0
static int
gx_remap_concrete_DeviceN(const frac * pconc, const gs_color_space * pcs,
	gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
			  gs_color_select_t select)
{
#ifdef DEBUG
    /* 
     * Verify that the color space and imager state info match.
     */
    if (pcs->id != pis->color_component_map.cspace_id)
	dprintf("gx_remap_concrete_DeviceN: color space id mismatch");
#endif

#if ENABLE_CUSTOM_COLOR_CALLBACK
    if (pis->custom_color_callback) {
	int code = gx_remap_concrete_custom_color_DeviceN(pconc, pcs, pdc,
						       	pis, dev, select);
	if (code >= 0)
	    return code;
    }
#endif
    if (pis->color_component_map.use_alt_cspace) {
        const gs_color_space *pacs = pcs->base_space;

	return (*pacs->type->remap_concrete_color)
				(pconc, pacs, pdc, pis, dev, select);
    }
    else {
	gx_remap_concrete_devicen(pconc, pdc, pis, dev, select);
	return 0;
    }
}
예제 #2
0
static int
gx_remap_concrete_DeviceN(const frac * pconc, const gs_color_space * pcs,
        gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
                          gs_color_select_t select)
{
    int code;

#ifdef DEBUG
    /*
     * Verify that the color space and imager state info match.
     */
    if (pcs->id != pis->color_component_map.cspace_id)
        dmprintf(pis->memory, "gx_remap_concrete_DeviceN: color space id mismatch");
#endif
    if (pis->color_component_map.use_alt_cspace) {
        const gs_color_space *pacs = pcs->base_space;

        return (*pacs->type->remap_concrete_color)
                                (pconc, pacs, pdc, pis, dev, select);
    }
    else {
    /* If we are going DeviceN out to real sep device that understands these,
       and if the destination profile is DeviceN, we print the colors directly. 
       Make sure to disable the DeviceN profile color map so that is does not
       get used in gx_remap_concrete_devicen.  We probably should pass something
       through here but it is a pain due to the change in the proc. */
        cmm_dev_profile_t *dev_profile;
        bool temp_val;

        code = dev_proc(dev, get_profile)(dev, &dev_profile);
        if (dev_profile->spotnames != NULL) {
            temp_val = dev_profile->spotnames->equiv_cmyk_set;
            dev_profile->spotnames->equiv_cmyk_set = false;
            gx_remap_concrete_devicen(pconc, pdc, pis, dev, select);
            dev_profile->spotnames->equiv_cmyk_set = temp_val;
        } else {
            gx_remap_concrete_devicen(pconc, pdc, pis, dev, select);
        }
        return 0;
    }
}
예제 #3
0
static int
gx_remap_concrete_DeviceN(const frac * pconc, const gs_color_space * pcs,
        gx_device_color * pdc, const gs_imager_state * pis, gx_device * dev,
                          gs_color_select_t select)
{
#ifdef DEBUG
    /*
     * Verify that the color space and imager state info match.
     */
    if (pcs->id != pis->color_component_map.cspace_id)
        dprintf("gx_remap_concrete_DeviceN: color space id mismatch");
#endif
    if (pis->color_component_map.use_alt_cspace) {
        const gs_color_space *pacs = pcs->base_space;

        return (*pacs->type->remap_concrete_color)
                                (pconc, pacs, pdc, pis, dev, select);
    }
    else {
        gx_remap_concrete_devicen(pconc, pdc, pis, dev, select);
        return 0;
    }
}
예제 #4
0
static int
gx_remap_concrete_icc_devicen(const frac * pconc, const gs_color_space * pcs,
        gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
                          gs_color_select_t select)
{
    /* Check if this is a device with a DeviceN ICC profile.  In this case,
       we need to do some special stuff */
    cmm_dev_profile_t *dev_profile;
    int code;

    code = dev_proc(dev, get_profile)(dev, &dev_profile);
    if (dev_profile->spotnames != NULL  &&
        !dev_profile->spotnames->equiv_cmyk_set) {
        /* This means that someone has specified a DeviceN (Ncolor)
           ICC destination profile for this device and we still need to set
           up the equivalent CMYK colors for the spot colors that are present.
           This allows us to have some sort of composite viewing of the spot
           colors as they would colorimetrically appear. */
        code = gsicc_set_devicen_equiv_colors(dev, pgs, dev_profile->device_profile[0]);
        dev_profile->spotnames->equiv_cmyk_set = true;
    }
    gx_remap_concrete_devicen(pconc, pdc, pgs, dev, select);
    return code;
}