const gx_cm_color_map_procs*
fwd_get_target_cmap_procs(gx_device * dev)
{
    const gx_cm_color_map_procs *pprocs;
    gx_device_forward * const fdev = (gx_device_forward *)dev;
    gx_device * const tdev = fdev->target;

    pprocs = dev_proc(tdev, get_color_mapping_procs(tdev));
    while (pprocs == &FwdDevice_cm_map_procs) {
        pprocs = fwd_get_target_cmap_procs(tdev);
    }
    return pprocs;
}
Exemple #2
0
/*
 * We need to forward the color mapping to the target device.
 */
static void
fwd_map_cmyk_cs(gx_device * dev, frac c, frac m, frac y, frac k, frac out[])
{
    gx_device_forward * const fdev = (gx_device_forward *)dev;
    gx_device * const tdev = fdev->target;
    const gx_cm_color_map_procs * pprocs;

    /* Verify that all of the pointers and procs are set */
    /* If not then use a default routine.  This case should be an error */
    if (tdev == 0 || dev_proc(tdev, get_color_mapping_procs) == 0 ||
          (pprocs = dev_proc(tdev, get_color_mapping_procs(tdev))) == 0 ||
          pprocs->map_cmyk == 0)
        cmyk_cs_to_cmyk_cm(tdev, c, m, y, k, out);   /* if all else fails */
    else
        pprocs->map_cmyk(tdev, c, m, y, k, out);
}
Exemple #3
0
/*
 * We need to forward the color mapping to the target device.
 */
static void
fwd_map_rgb_cs(gx_device * dev, const gs_imager_state *pis,
				   frac r, frac g, frac b, frac out[])
{
    gx_device_forward * const fdev = (gx_device_forward *)dev;
    gx_device * const tdev = fdev->target;
    const gx_cm_color_map_procs * pprocs;

    /* Verify that all of the pointers and procs are set */
    /* If not then use a default routine.  This case should be an error */
    if (tdev == 0 || dev_proc(tdev, get_color_mapping_procs) == 0 ||
          (pprocs = dev_proc(tdev, get_color_mapping_procs(tdev))) == 0 ||
          pprocs->map_rgb == 0)
        rgb_cs_to_rgb_cm(tdev, pis, r, g, b, out);   /* if all else fails */
    else
        pprocs->map_rgb(tdev, pis, r, g, b, out);
}