tiff_set_icc_color_fields(gx_device_printer *pdev)
{
    gx_device_tiff *tfdev = (gx_device_tiff *)pdev;

    TIFFSetField(tfdev->tif, TIFFTAG_BITSPERSAMPLE, 8);
    switch (tfdev->icclink->num_output)
    {
    case 1:
        tiff_set_gray_fields(pdev, tfdev->tif, 8, tfdev->Compression,
            tfdev->MaxStripSize);
        break;
    case 3:
        tiff_set_rgb_fields(tfdev);
        break;
    case 4:
        tiff_set_cmyk_fields(pdev, tfdev->tif,
            pdev->color_info.depth / pdev->color_info.num_components,
            tfdev->Compression, tfdev->MaxStripSize);
        break;
    default:
        return gs_error_undefined;
    }
    return 0;
}
tiff_set_icc_color_fields(gx_device_printer *pdev)
{
    gx_device_tiff *tfdev = (gx_device_tiff *)pdev;

    TIFFSetField(tfdev->tif, TIFFTAG_BITSPERSAMPLE, 8);
    switch (tfdev->icclink->num_output)
    {
    case 1:
        tiff_set_gray_fields(pdev, tfdev->tif, 8, tfdev->Compression,
            tfdev->MaxStripSize);
        break;
    case 3:
        tiff_set_rgb_fields(tfdev);
        break;
    case 4:
        tiff_set_cmyk_fields(pdev, tfdev->tif,
            pdev->color_info.depth / pdev->color_info.num_components,
            tfdev->Compression, tfdev->MaxStripSize);
        break;
    default:
        return gs_error_undefined;
    }
    return 0;
}