diff options
author | Michael Vrhel <michael.vrhel@artifex.com> | 2012-09-24 23:15:43 -0700 |
---|---|---|
committer | Michael Vrhel <michael.vrhel@artifex.com> | 2012-09-26 23:06:43 -0700 |
commit | 408cbb83103ba9cf6996eeebaa02995cd9f535ad (patch) | |
tree | 22a3519b2ea62e969f0e547966e7bf61b47681d9 | |
parent | 1770ca69b258c571565d9a6fc7bb9fb0ebd539e4 (diff) |
Addition of support for allowing control over the use of black point compensation in color management
Black point compensation is a new extended graphic state entry in the extended graphic
state with PDF 2.0 . This change adds it to the graphic state. This update also allows
the same type of override control for black point that we currently have for the
rendering intent. This includes specification of its use by source object type with
the use of -sSourceObjectICC for source RGB and CMYK graphic, images and text objects.
Alternatively, control can be achieved for the whole document via object type
by specification -dBlackPtComp=0/1. Alternatively, you can specify control
on an object based method using -dGraphBlackPt=0/1
-dImageBlackPtComp=0/1 -dTextBlackPtComp=0/1. All of these
will require the setting of -dOverrideBP to ensure that the document content does not
interfere with the command line setting. Note that these are not true/false settings
but integer values like the rendering intent. This is to allow the easy expansion
to other black point compensation options as described by Bug 692223.
-rw-r--r-- | gs/Resource/Init/gs_lev2.ps | 2 | ||||
-rw-r--r-- | gs/base/gdevp14.c | 45 | ||||
-rw-r--r-- | gs/base/gscms.h | 28 | ||||
-rw-r--r-- | gs/base/gscsepr.c | 2 | ||||
-rw-r--r-- | gs/base/gscspace.c | 3 | ||||
-rw-r--r-- | gs/base/gsdparam.c | 117 | ||||
-rw-r--r-- | gs/base/gsequivc.c | 3 | ||||
-rw-r--r-- | gs/base/gsicc.c | 6 | ||||
-rw-r--r-- | gs/base/gsicc_cache.c | 33 | ||||
-rw-r--r-- | gs/base/gsicc_lcms2.c | 22 | ||||
-rw-r--r-- | gs/base/gsicc_manage.c | 94 | ||||
-rw-r--r-- | gs/base/gsicc_manage.h | 18 | ||||
-rw-r--r-- | gs/base/gsstate.c | 13 | ||||
-rw-r--r-- | gs/base/gsstate.h | 3 | ||||
-rw-r--r-- | gs/base/gstrans.c | 3 | ||||
-rw-r--r-- | gs/base/gxclimag.c | 34 | ||||
-rw-r--r-- | gs/base/gxcmap.c | 20 | ||||
-rw-r--r-- | gs/base/gxi12bit.c | 2 | ||||
-rw-r--r-- | gs/base/gxicolor.c | 2 | ||||
-rw-r--r-- | gs/base/gximono.c | 2 | ||||
-rw-r--r-- | gs/base/gxiscale.c | 2 | ||||
-rw-r--r-- | gs/base/gxistate.h | 3 | ||||
-rw-r--r-- | gs/base/gxshade.c | 2 | ||||
-rw-r--r-- | gs/psi/zcolor3.c | 27 | ||||
-rw-r--r-- | gs/psi/zusparam.c | 16 | ||||
-rw-r--r-- | gs/toolbin/color/src_color/objsrc_profiles_example.txt | 12 | ||||
-rw-r--r-- | xps/xpsgradient.c | 2 |
27 files changed, 417 insertions, 99 deletions
diff --git a/gs/Resource/Init/gs_lev2.ps b/gs/Resource/Init/gs_lev2.ps index baef96a49..5f6a12514 100644 --- a/gs/Resource/Init/gs_lev2.ps +++ b/gs/Resource/Init/gs_lev2.ps | |||
@@ -672,7 +672,7 @@ currentuserparams /WaitTimeout known | |||
672 | 672 | ||
673 | mark % collect dict key value pairs for anything set in systemdict (command line options) | 673 | mark % collect dict key value pairs for anything set in systemdict (command line options) |
674 | [ /DefaultRGBProfile /DefaultGrayProfile /DefaultCMYKProfile /DeviceNProfile | 674 | [ /DefaultRGBProfile /DefaultGrayProfile /DefaultCMYKProfile /DeviceNProfile |
675 | /NamedProfile /SourceObjectICC /OverrideICC /OverrideRI | 675 | /NamedProfile /SourceObjectICC /OverrideICC /OverrideRI /OverrideBP |
676 | ] | 676 | ] |
677 | { dup //systemdict exch .knownget not { | 677 | { dup //systemdict exch .knownget not { |
678 | pop % discard keys not in systemdict | 678 | pop % discard keys not in systemdict |
diff --git a/gs/base/gdevp14.c b/gs/base/gdevp14.c index ddc6d55e8..6be554d3a 100644 --- a/gs/base/gdevp14.c +++ b/gs/base/gdevp14.c | |||
@@ -901,7 +901,7 @@ pdf14_pop_transparency_group(gs_imager_state *pis, pdf14_ctx *ctx, | |||
901 | curr_icc_profile != NULL) { | 901 | curr_icc_profile != NULL) { |
902 | /* Use the ICC color management for buffer color conversion */ | 902 | /* Use the ICC color management for buffer color conversion */ |
903 | /* Define the rendering intents */ | 903 | /* Define the rendering intents */ |
904 | rendering_params.black_point_comp = BP_ON; | 904 | rendering_params.black_point_comp = gsBLACKPTCOMP_ON; |
905 | rendering_params.graphics_type_tag = GS_IMAGE_TAG; | 905 | rendering_params.graphics_type_tag = GS_IMAGE_TAG; |
906 | rendering_params.rendering_intent = gsPERCEPTUAL; | 906 | rendering_params.rendering_intent = gsPERCEPTUAL; |
907 | /* Request the ICC link for the transform that we will need to use */ | 907 | /* Request the ICC link for the transform that we will need to use */ |
@@ -1136,12 +1136,13 @@ pdf14_pop_transparency_mask(pdf14_ctx *ctx, gs_imager_state *pis, gx_device *dev | |||
1136 | gsicc_rendering_param_t rendering_params; | 1136 | gsicc_rendering_param_t rendering_params; |
1137 | gsicc_link_t *icc_link; | 1137 | gsicc_link_t *icc_link; |
1138 | gsicc_rendering_intents_t rendering_intent; | 1138 | gsicc_rendering_intents_t rendering_intent; |
1139 | gsicc_blackptcomp_t blackptcomp; | ||
1139 | int code; | 1140 | int code; |
1140 | cmm_dev_profile_t *dev_profile; | 1141 | cmm_dev_profile_t *dev_profile; |
1141 | 1142 | ||
1142 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 1143 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
1143 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &src_profile, | 1144 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &src_profile, |
1144 | &rendering_intent); | 1145 | &rendering_intent, &blackptcomp); |
1145 | ctx->smask_depth -= 1; | 1146 | ctx->smask_depth -= 1; |
1146 | /* icc_match == -1 means old non-icc code. | 1147 | /* icc_match == -1 means old non-icc code. |
1147 | icc_match == 0 means use icc code | 1148 | icc_match == 0 means use icc code |
@@ -1269,7 +1270,7 @@ pdf14_pop_transparency_mask(pdf14_ctx *ctx, gs_imager_state *pis, gx_device *dev | |||
1269 | } else { | 1270 | } else { |
1270 | /* ICC case where we use the CMM */ | 1271 | /* ICC case where we use the CMM */ |
1271 | /* Request the ICC link for the transform that we will need to use */ | 1272 | /* Request the ICC link for the transform that we will need to use */ |
1272 | rendering_params.black_point_comp = BP_OFF; | 1273 | rendering_params.black_point_comp = gsBLACKPTCOMP_OFF; |
1273 | rendering_params.graphics_type_tag = GS_IMAGE_TAG; | 1274 | rendering_params.graphics_type_tag = GS_IMAGE_TAG; |
1274 | rendering_params.rendering_intent = gsPERCEPTUAL; | 1275 | rendering_params.rendering_intent = gsPERCEPTUAL; |
1275 | icc_link = gsicc_get_link_profile(pis, dev, des_profile, | 1276 | icc_link = gsicc_get_link_profile(pis, dev, des_profile, |
@@ -1549,6 +1550,7 @@ pdf14_put_image(gx_device * dev, gs_imager_state * pis, gx_device * target) | |||
1549 | bool data_blended = false; | 1550 | bool data_blended = false; |
1550 | int num_rows_left; | 1551 | int num_rows_left; |
1551 | gsicc_rendering_intents_t rendering_intent; | 1552 | gsicc_rendering_intents_t rendering_intent; |
1553 | gsicc_blackptcomp_t blackptcomp; | ||
1552 | cmm_dev_profile_t *dev_profile; | 1554 | cmm_dev_profile_t *dev_profile; |
1553 | 1555 | ||
1554 | if_debug0m('v', dev->memory, "[v]pdf14_put_image\n"); | 1556 | if_debug0m('v', dev->memory, "[v]pdf14_put_image\n"); |
@@ -1634,7 +1636,8 @@ pdf14_put_image(gx_device * dev, gs_imager_state * pis, gx_device * target) | |||
1634 | and the target will be CIELAB */ | 1636 | and the target will be CIELAB */ |
1635 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 1637 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
1636 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, | 1638 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, |
1637 | &(pcs->cmm_icc_profile_data), &rendering_intent); | 1639 | &(pcs->cmm_icc_profile_data), &rendering_intent, |
1640 | &blackptcomp); | ||
1638 | /* pcs takes a reference to the profile data it just retrieved. */ | 1641 | /* pcs takes a reference to the profile data it just retrieved. */ |
1639 | rc_increment(pcs->cmm_icc_profile_data); | 1642 | rc_increment(pcs->cmm_icc_profile_data); |
1640 | gscms_set_icc_range(&(pcs->cmm_icc_profile_data)); | 1643 | gscms_set_icc_range(&(pcs->cmm_icc_profile_data)); |
@@ -3397,13 +3400,14 @@ pdf14_begin_transparency_group(gx_device *dev, | |||
3397 | cmm_profile_t *curr_profile; | 3400 | cmm_profile_t *curr_profile; |
3398 | cmm_profile_t *group_profile; | 3401 | cmm_profile_t *group_profile; |
3399 | gsicc_rendering_intents_t rendering_intent; | 3402 | gsicc_rendering_intents_t rendering_intent; |
3403 | gsicc_blackptcomp_t blackptcomp; | ||
3400 | cmm_dev_profile_t *dev_profile; | 3404 | cmm_dev_profile_t *dev_profile; |
3401 | 3405 | ||
3402 | sep_target = (strcmp(pdev->dname, "pdf14cmykspot") == 0) || | 3406 | sep_target = (strcmp(pdev->dname, "pdf14cmykspot") == 0) || |
3403 | (dev_proc(dev, dev_spec_op)(dev, gxdso_supports_devn, NULL, 0)); | 3407 | (dev_proc(dev, dev_spec_op)(dev, gxdso_supports_devn, NULL, 0)); |
3404 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 3408 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
3405 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &group_profile, | 3409 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &group_profile, |
3406 | &rendering_intent); | 3410 | &rendering_intent, &blackptcomp); |
3407 | /* If the target device supports separations, then | 3411 | /* If the target device supports separations, then |
3408 | we should should NOT create the group. The exception to this | 3412 | we should should NOT create the group. The exception to this |
3409 | rule would be if we just popped a transparency mask */ | 3413 | rule would be if we just popped a transparency mask */ |
@@ -3496,11 +3500,12 @@ pdf14_end_transparency_group(gx_device *dev, | |||
3496 | pdf14_parent_color_t *parent_color; | 3500 | pdf14_parent_color_t *parent_color; |
3497 | cmm_profile_t *group_profile; | 3501 | cmm_profile_t *group_profile; |
3498 | gsicc_rendering_intents_t rendering_intent; | 3502 | gsicc_rendering_intents_t rendering_intent; |
3503 | gsicc_blackptcomp_t blackptcomp; | ||
3499 | cmm_dev_profile_t *dev_profile; | 3504 | cmm_dev_profile_t *dev_profile; |
3500 | 3505 | ||
3501 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 3506 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
3502 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &group_profile, | 3507 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &group_profile, |
3503 | &rendering_intent); | 3508 | &rendering_intent, &blackptcomp); |
3504 | if_debug0m('v', dev->memory, "[v]pdf14_end_transparency_group\n"); | 3509 | if_debug0m('v', dev->memory, "[v]pdf14_end_transparency_group\n"); |
3505 | vd_get_dc('c'); | 3510 | vd_get_dc('c'); |
3506 | vd_set_shift(0, 0); | 3511 | vd_set_shift(0, 0); |
@@ -3573,6 +3578,7 @@ pdf14_update_device_color_procs(gx_device *dev, | |||
3573 | int k; | 3578 | int k; |
3574 | bool has_tags = dev->graphics_type_tag & GS_DEVICE_ENCODES_TAGS; | 3579 | bool has_tags = dev->graphics_type_tag & GS_DEVICE_ENCODES_TAGS; |
3575 | gsicc_rendering_intents_t rendering_intent; | 3580 | gsicc_rendering_intents_t rendering_intent; |
3581 | gsicc_blackptcomp_t blackptcomp; | ||
3576 | int code; | 3582 | int code; |
3577 | cmm_dev_profile_t *dev_profile; | 3583 | cmm_dev_profile_t *dev_profile; |
3578 | 3584 | ||
@@ -3725,7 +3731,7 @@ pdf14_update_device_color_procs(gx_device *dev, | |||
3725 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 3731 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
3726 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, | 3732 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, |
3727 | &(parent_color_info->icc_profile), | 3733 | &(parent_color_info->icc_profile), |
3728 | &rendering_intent); | 3734 | &rendering_intent, &blackptcomp); |
3729 | } | 3735 | } |
3730 | /* Set new information */ | 3736 | /* Set new information */ |
3731 | /* If we are in a soft mask and we are using compressed color | 3737 | /* If we are in a soft mask and we are using compressed color |
@@ -3795,6 +3801,7 @@ pdf14_update_device_color_procs_push_c(gx_device *dev, | |||
3795 | bool has_tags = dev->graphics_type_tag & GS_DEVICE_ENCODES_TAGS; | 3801 | bool has_tags = dev->graphics_type_tag & GS_DEVICE_ENCODES_TAGS; |
3796 | cmm_profile_t *icc_profile_dev; | 3802 | cmm_profile_t *icc_profile_dev; |
3797 | gsicc_rendering_intents_t rendering_intent; | 3803 | gsicc_rendering_intents_t rendering_intent; |
3804 | gsicc_blackptcomp_t blackptcomp; | ||
3798 | int code; | 3805 | int code; |
3799 | cmm_dev_profile_t *dev_profile; | 3806 | cmm_dev_profile_t *dev_profile; |
3800 | 3807 | ||
@@ -3868,7 +3875,7 @@ pdf14_update_device_color_procs_push_c(gx_device *dev, | |||
3868 | /* Check if the profile is different. */ | 3875 | /* Check if the profile is different. */ |
3869 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 3876 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
3870 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile_dev, | 3877 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile_dev, |
3871 | &rendering_intent); | 3878 | &rendering_intent, &blackptcomp); |
3872 | if (icc_profile_dev->hashcode != icc_profile->hashcode) { | 3879 | if (icc_profile_dev->hashcode != icc_profile->hashcode) { |
3873 | update_color_info = true; | 3880 | update_color_info = true; |
3874 | new_num_comps = icc_profile->num_comps; | 3881 | new_num_comps = icc_profile->num_comps; |
@@ -4046,12 +4053,13 @@ pdf14_push_parent_color(gx_device *dev, const gs_imager_state *pis) | |||
4046 | pdf14_parent_color_t *new_parent_color; | 4053 | pdf14_parent_color_t *new_parent_color; |
4047 | cmm_profile_t *icc_profile; | 4054 | cmm_profile_t *icc_profile; |
4048 | gsicc_rendering_intents_t rendering_intent; | 4055 | gsicc_rendering_intents_t rendering_intent; |
4056 | gsicc_blackptcomp_t blackptcomp; | ||
4049 | int code; | 4057 | int code; |
4050 | cmm_dev_profile_t *dev_profile; | 4058 | cmm_dev_profile_t *dev_profile; |
4051 | 4059 | ||
4052 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 4060 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
4053 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile, | 4061 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile, |
4054 | &rendering_intent); | 4062 | &rendering_intent, &blackptcomp); |
4055 | if_debug0m('v', dev->memory, "[v]pdf14_push_parent_color\n"); | 4063 | if_debug0m('v', dev->memory, "[v]pdf14_push_parent_color\n"); |
4056 | /* Allocate a new one */ | 4064 | /* Allocate a new one */ |
4057 | new_parent_color = gs_alloc_struct(dev->memory, pdf14_parent_color_t, | 4065 | new_parent_color = gs_alloc_struct(dev->memory, pdf14_parent_color_t, |
@@ -5011,11 +5019,12 @@ gs_pdf14_device_push(gs_memory_t *mem, gs_imager_state * pis, | |||
5011 | bool has_tags = target->graphics_type_tag & GS_DEVICE_ENCODES_TAGS; | 5019 | bool has_tags = target->graphics_type_tag & GS_DEVICE_ENCODES_TAGS; |
5012 | cmm_profile_t *icc_profile; | 5020 | cmm_profile_t *icc_profile; |
5013 | gsicc_rendering_intents_t rendering_intent; | 5021 | gsicc_rendering_intents_t rendering_intent; |
5022 | gsicc_blackptcomp_t blackptcomp; | ||
5014 | cmm_dev_profile_t *dev_profile; | 5023 | cmm_dev_profile_t *dev_profile; |
5015 | 5024 | ||
5016 | code = dev_proc(target, get_profile)(target, &dev_profile); | 5025 | code = dev_proc(target, get_profile)(target, &dev_profile); |
5017 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile, | 5026 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile, |
5018 | &rendering_intent); | 5027 | &rendering_intent, &blackptcomp); |
5019 | if_debug0m('v', mem, "[v]gs_pdf14_device_push\n"); | 5028 | if_debug0m('v', mem, "[v]gs_pdf14_device_push\n"); |
5020 | code = get_pdf14_device_proto(target, &dev_proto, | 5029 | code = get_pdf14_device_proto(target, &dev_proto, |
5021 | &temp_dev_proto, pis, pdf14pct); | 5030 | &temp_dev_proto, pis, pdf14pct); |
@@ -5153,12 +5162,13 @@ c_pdf14trans_write(const gs_composite_t * pct, byte * data, uint * psize, | |||
5153 | int64_t hashcode = 0; | 5162 | int64_t hashcode = 0; |
5154 | cmm_profile_t *icc_profile; | 5163 | cmm_profile_t *icc_profile; |
5155 | gsicc_rendering_intents_t rendering_intent; | 5164 | gsicc_rendering_intents_t rendering_intent; |
5165 | gsicc_blackptcomp_t blackptcomp; | ||
5156 | cmm_dev_profile_t *dev_profile; | 5166 | cmm_dev_profile_t *dev_profile; |
5157 | 5167 | ||
5158 | code = dev_proc((gx_device *) cdev, get_profile)((gx_device *) cdev, | 5168 | code = dev_proc((gx_device *) cdev, get_profile)((gx_device *) cdev, |
5159 | &dev_profile); | 5169 | &dev_profile); |
5160 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile, | 5170 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile, |
5161 | &rendering_intent); | 5171 | &rendering_intent, &blackptcomp); |
5162 | *pbuf++ = opcode; /* 1 byte */ | 5172 | *pbuf++ = opcode; /* 1 byte */ |
5163 | switch (opcode) { | 5173 | switch (opcode) { |
5164 | default: /* Should not occur. */ | 5174 | default: /* Should not occur. */ |
@@ -6090,11 +6100,12 @@ pdf14_create_clist_device(gs_memory_t *mem, gs_imager_state * pis, | |||
6090 | bool has_tags = target->graphics_type_tag & GS_DEVICE_ENCODES_TAGS; | 6100 | bool has_tags = target->graphics_type_tag & GS_DEVICE_ENCODES_TAGS; |
6091 | cmm_profile_t *target_profile; | 6101 | cmm_profile_t *target_profile; |
6092 | gsicc_rendering_intents_t rendering_intent; | 6102 | gsicc_rendering_intents_t rendering_intent; |
6103 | gsicc_blackptcomp_t blackptcomp; | ||
6093 | cmm_dev_profile_t *dev_profile; | 6104 | cmm_dev_profile_t *dev_profile; |
6094 | 6105 | ||
6095 | code = dev_proc(target, get_profile)(target, &dev_profile); | 6106 | code = dev_proc(target, get_profile)(target, &dev_profile); |
6096 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &target_profile, | 6107 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &target_profile, |
6097 | &rendering_intent); | 6108 | &rendering_intent, &blackptcomp); |
6098 | if_debug0m('v', pis->memory, "[v]pdf14_create_clist_device\n"); | 6109 | if_debug0m('v', pis->memory, "[v]pdf14_create_clist_device\n"); |
6099 | code = get_pdf14_clist_device_proto(target, &dev_proto, | 6110 | code = get_pdf14_clist_device_proto(target, &dev_proto, |
6100 | &temp_dev_proto, pis, pdf14pct); | 6111 | &temp_dev_proto, pis, pdf14pct); |
@@ -6869,15 +6880,16 @@ pdf14_clist_fill_path(gx_device *dev, const gs_imager_state *pis, | |||
6869 | gx_device_forward * fdev = (gx_device_forward *)dev; | 6880 | gx_device_forward * fdev = (gx_device_forward *)dev; |
6870 | cmm_dev_profile_t *dev_profile, *fwd_profile; | 6881 | cmm_dev_profile_t *dev_profile, *fwd_profile; |
6871 | gsicc_rendering_intents_t rendering_intent; | 6882 | gsicc_rendering_intents_t rendering_intent; |
6883 | gsicc_blackptcomp_t blackptcomp; | ||
6872 | cmm_profile_t *icc_profile_fwd, *icc_profile_dev; | 6884 | cmm_profile_t *icc_profile_fwd, *icc_profile_dev; |
6873 | 6885 | ||
6874 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 6886 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
6875 | code = dev_proc(fdev->target, get_profile)(fdev->target, &fwd_profile); | 6887 | code = dev_proc(fdev->target, get_profile)(fdev->target, &fwd_profile); |
6876 | 6888 | ||
6877 | gsicc_extract_profile(GS_UNKNOWN_TAG, fwd_profile, &icc_profile_fwd, | 6889 | gsicc_extract_profile(GS_UNKNOWN_TAG, fwd_profile, &icc_profile_fwd, |
6878 | &rendering_intent); | 6890 | &rendering_intent, &blackptcomp); |
6879 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile_dev, | 6891 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile_dev, |
6880 | &rendering_intent); | 6892 | &rendering_intent, &blackptcomp); |
6881 | 6893 | ||
6882 | /* | 6894 | /* |
6883 | * Ensure that that the PDF 1.4 reading compositor will have the current | 6895 | * Ensure that that the PDF 1.4 reading compositor will have the current |
@@ -7304,15 +7316,16 @@ c_pdf14trans_clist_read_update(gs_composite_t * pcte, gx_device * cdev, | |||
7304 | gx_device_clist_reader *pcrdev = (gx_device_clist_reader *)cdev; | 7316 | gx_device_clist_reader *pcrdev = (gx_device_clist_reader *)cdev; |
7305 | cmm_profile_t *cl_icc_profile, *p14_icc_profile; | 7317 | cmm_profile_t *cl_icc_profile, *p14_icc_profile; |
7306 | gsicc_rendering_intents_t rendering_intent; | 7318 | gsicc_rendering_intents_t rendering_intent; |
7319 | gsicc_blackptcomp_t blackptcomp; | ||
7307 | int code; | 7320 | int code; |
7308 | cmm_dev_profile_t *dev_profile; | 7321 | cmm_dev_profile_t *dev_profile; |
7309 | 7322 | ||
7310 | code = dev_proc(cdev, get_profile)(cdev, &dev_profile); | 7323 | code = dev_proc(cdev, get_profile)(cdev, &dev_profile); |
7311 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &cl_icc_profile, | 7324 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &cl_icc_profile, |
7312 | &rendering_intent); | 7325 | &rendering_intent, &blackptcomp); |
7313 | code = dev_proc(p14dev, get_profile)((gx_device *)p14dev, &dev_profile); | 7326 | code = dev_proc(p14dev, get_profile)((gx_device *)p14dev, &dev_profile); |
7314 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &p14_icc_profile, | 7327 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &p14_icc_profile, |
7315 | &rendering_intent); | 7328 | &rendering_intent, &blackptcomp); |
7316 | 7329 | ||
7317 | /* | 7330 | /* |
7318 | * We only handle the push/pop operations. Save and restore the color_info | 7331 | * We only handle the push/pop operations. Save and restore the color_info |
diff --git a/gs/base/gscms.h b/gs/base/gscms.h index 96b462092..70f6bcf1a 100644 --- a/gs/base/gscms.h +++ b/gs/base/gscms.h | |||
@@ -122,7 +122,19 @@ typedef enum { | |||
122 | gsABSOLUTECOLORIMETRIC_OR /* in particular through the clist */ | 122 | gsABSOLUTECOLORIMETRIC_OR /* in particular through the clist */ |
123 | } gsicc_rendering_intents_t; | 123 | } gsicc_rendering_intents_t; |
124 | 124 | ||
125 | /* We make an enumerated type in case someone wants to add different types | ||
126 | of black point compensation. Like lcms provides the option for. If | ||
127 | any are added, be sure to add in the regular and the source overide | ||
128 | option. Also not that we have at most 4 options due to gsBP_OVERRIDE */ | ||
129 | typedef enum { | ||
130 | gsBLACKPTCOMP_OFF = 0, | ||
131 | gsBLACKPTCOMP_ON, | ||
132 | gsBLACKPTCOMP_OFF_OR = 4, /* These are needed for keeping track of the */ | ||
133 | gsBLACKPTCOMP_ON_OR, /* source blackpt is to overide dest. setting */ | ||
134 | } gsicc_blackptcomp_t; | ||
135 | |||
125 | #define gsRI_OVERRIDE 0x4 | 136 | #define gsRI_OVERRIDE 0x4 |
137 | #define gsBP_OVERRIDE 0x4 | ||
126 | #define gsRI_MASK 0x3; | 138 | #define gsRI_MASK 0x3; |
127 | 139 | ||
128 | /* Enumerate the types of profiles */ | 140 | /* Enumerate the types of profiles */ |
@@ -146,8 +158,10 @@ typedef enum { | |||
146 | typedef struct cmm_srcgtag_profile_s { | 158 | typedef struct cmm_srcgtag_profile_s { |
147 | cmm_profile_t *rgb_profiles[NUM_SOURCE_PROFILES]; | 159 | cmm_profile_t *rgb_profiles[NUM_SOURCE_PROFILES]; |
148 | gsicc_rendering_intents_t rgb_intent[NUM_SOURCE_PROFILES]; | 160 | gsicc_rendering_intents_t rgb_intent[NUM_SOURCE_PROFILES]; |
161 | gsicc_blackptcomp_t rgb_blackptcomp[NUM_SOURCE_PROFILES]; | ||
149 | cmm_profile_t *cmyk_profiles[NUM_SOURCE_PROFILES]; | 162 | cmm_profile_t *cmyk_profiles[NUM_SOURCE_PROFILES]; |
150 | gsicc_rendering_intents_t cmyk_intent[NUM_SOURCE_PROFILES]; | 163 | gsicc_rendering_intents_t cmyk_intent[NUM_SOURCE_PROFILES]; |
164 | gsicc_blackptcomp_t cmyk_blackptcomp[NUM_SOURCE_PROFILES]; | ||
151 | cmm_profile_t *color_warp_profile; | 165 | cmm_profile_t *color_warp_profile; |
152 | gs_memory_t *memory; | 166 | gs_memory_t *memory; |
153 | int name_length; /* Length of file name */ | 167 | int name_length; /* Length of file name */ |
@@ -189,6 +203,7 @@ typedef struct cmm_dev_profile_s { | |||
189 | cmm_profile_t *link_profile; | 203 | cmm_profile_t *link_profile; |
190 | cmm_profile_t *oi_profile; /* output intent profile */ | 204 | cmm_profile_t *oi_profile; /* output intent profile */ |
191 | gsicc_rendering_intents_t intent[NUM_DEVICE_PROFILES]; | 205 | gsicc_rendering_intents_t intent[NUM_DEVICE_PROFILES]; |
206 | gsicc_blackptcomp_t blackptcomp[NUM_DEVICE_PROFILES]; | ||
192 | bool devicegraytok; /* Used for forcing gray to pure black */ | 207 | bool devicegraytok; /* Used for forcing gray to pure black */ |
193 | bool usefastcolor; /* Used when we want to use no cm */ | 208 | bool usefastcolor; /* Used when we want to use no cm */ |
194 | bool supports_devn; /* If the target handles devn colors */ | 209 | bool supports_devn; /* If the target handles devn colors */ |
@@ -198,15 +213,6 @@ typedef struct cmm_dev_profile_s { | |||
198 | rc_header rc; | 213 | rc_header rc; |
199 | } cmm_dev_profile_t; | 214 | } cmm_dev_profile_t; |
200 | 215 | ||
201 | /* Doing this an an enum type for now. There is alot going on with respect | ||
202 | * to this and V2 versus V4 profiles | ||
203 | */ | ||
204 | |||
205 | typedef enum { | ||
206 | BP_ON = 0, | ||
207 | BP_OFF, | ||
208 | } gsicc_black_point_comp_t; | ||
209 | |||
210 | /* Used so that we can specify if we want to link with Device input color spaces | 216 | /* Used so that we can specify if we want to link with Device input color spaces |
211 | during the link creation process. For the DeviceN case, the DeviceN profile | 217 | during the link creation process. For the DeviceN case, the DeviceN profile |
212 | must match the DeviceN profile in colorant order and number of colorants. | 218 | must match the DeviceN profile in colorant order and number of colorants. |
@@ -214,7 +220,6 @@ typedef enum { | |||
214 | the icc manager. This is useful for reducing clist size since we will encode | 220 | the icc manager. This is useful for reducing clist size since we will encode |
215 | this value instead of the ICC profile. | 221 | this value instead of the ICC profile. |
216 | */ | 222 | */ |
217 | |||
218 | typedef enum { | 223 | typedef enum { |
219 | DEFAULT_NONE, /* A profile that was actually embedded in a doc */ | 224 | DEFAULT_NONE, /* A profile that was actually embedded in a doc */ |
220 | DEFAULT_GRAY, /* The default DeviceGray profile */ | 225 | DEFAULT_GRAY, /* The default DeviceGray profile */ |
@@ -424,6 +429,7 @@ typedef struct gsicc_manager_s { | |||
424 | gsicc_smask_t *smask_profiles; /* Profiles used when we are in a softmask group */ | 429 | gsicc_smask_t *smask_profiles; /* Profiles used when we are in a softmask group */ |
425 | bool override_internal; /* Set via the user params */ | 430 | bool override_internal; /* Set via the user params */ |
426 | bool override_ri; /* Override rend intent. Set via the user params */ | 431 | bool override_ri; /* Override rend intent. Set via the user params */ |
432 | bool override_bp; /* Override black point setting. Set via user params */ | ||
427 | cmm_srcgtag_profile_t *srcgtag_profile; | 433 | cmm_srcgtag_profile_t *srcgtag_profile; |
428 | gs_memory_t *memory; | 434 | gs_memory_t *memory; |
429 | rc_header rc; | 435 | rc_header rc; |
@@ -444,7 +450,7 @@ typedef enum { | |||
444 | typedef struct gsicc_rendering_param_s { | 450 | typedef struct gsicc_rendering_param_s { |
445 | gsicc_rendering_intents_t rendering_intent; | 451 | gsicc_rendering_intents_t rendering_intent; |
446 | gs_graphics_type_tag_t graphics_type_tag; | 452 | gs_graphics_type_tag_t graphics_type_tag; |
447 | gsicc_black_point_comp_t black_point_comp; | 453 | gsicc_blackptcomp_t black_point_comp; |
448 | } gsicc_rendering_param_t; | 454 | } gsicc_rendering_param_t; |
449 | 455 | ||
450 | #endif /* ifndef gscms_INCLUDED */ | 456 | #endif /* ifndef gscms_INCLUDED */ |
diff --git a/gs/base/gscsepr.c b/gs/base/gscsepr.c index 57ff898bd..1715b2d5c 100644 --- a/gs/base/gscsepr.c +++ b/gs/base/gscsepr.c | |||
@@ -328,7 +328,7 @@ gx_concretize_Separation(const gs_client_color *pc, const gs_color_space *pcs, | |||
328 | gsicc_rendering_param_t rendering_params; | 328 | gsicc_rendering_param_t rendering_params; |
329 | 329 | ||
330 | /* Define the rendering intents. */ | 330 | /* Define the rendering intents. */ |
331 | rendering_params.black_point_comp = BP_ON; | 331 | rendering_params.black_point_comp = pis->blackptcomp; |
332 | rendering_params.graphics_type_tag = GS_PATH_TAG; | 332 | rendering_params.graphics_type_tag = GS_PATH_TAG; |
333 | rendering_params.rendering_intent = pis->renderingintent; | 333 | rendering_params.rendering_intent = pis->renderingintent; |
334 | 334 | ||
diff --git a/gs/base/gscspace.c b/gs/base/gscspace.c index 756184c58..072064f72 100644 --- a/gs/base/gscspace.c +++ b/gs/base/gscspace.c | |||
@@ -613,10 +613,11 @@ int gx_set_overprint_cmyk(const gs_color_space * pcs, gs_state * pgs) | |||
613 | int code; | 613 | int code; |
614 | bool profile_ok = false; | 614 | bool profile_ok = false; |
615 | gsicc_rendering_intents_t rendering_intent; | 615 | gsicc_rendering_intents_t rendering_intent; |
616 | gsicc_blackptcomp_t blackptcomp; | ||
616 | 617 | ||
617 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 618 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
618 | gsicc_extract_profile(dev->graphics_type_tag, dev_profile, &(output_profile), | 619 | gsicc_extract_profile(dev->graphics_type_tag, dev_profile, &(output_profile), |
619 | &rendering_intent); | 620 | &rendering_intent, &blackptcomp); |
620 | 621 | ||
621 | /* check if color model behavior must be determined */ | 622 | /* check if color model behavior must be determined */ |
622 | if (pcinfo->opmode == GX_CINFO_OPMODE_UNKNOWN) | 623 | if (pcinfo->opmode == GX_CINFO_OPMODE_UNKNOWN) |
diff --git a/gs/base/gsdparam.c b/gs/base/gsdparam.c index d6794b200..fa368f623 100644 --- a/gs/base/gsdparam.c +++ b/gs/base/gsdparam.c | |||
@@ -13,7 +13,6 @@ | |||
13 | CA 94903, U.S.A., +1(415)492-9861, for further information. | 13 | CA 94903, U.S.A., +1(415)492-9861, for further information. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | |||
17 | /* Default device parameters for Ghostscript library */ | 16 | /* Default device parameters for Ghostscript library */ |
18 | #include "memory_.h" /* for memcpy */ | 17 | #include "memory_.h" /* for memcpy */ |
19 | #include "string_.h" /* for strlen */ | 18 | #include "string_.h" /* for strlen */ |
@@ -25,11 +24,6 @@ | |||
25 | #include "gxfixed.h" | 24 | #include "gxfixed.h" |
26 | #include "gsicc_manage.h" | 25 | #include "gsicc_manage.h" |
27 | 26 | ||
28 | |||
29 | static const char *const std_intent_keys[] = { | ||
30 | GSICC_STANDARD_INTENT_KEYS | ||
31 | }; | ||
32 | |||
33 | /* Define whether we accept PageSize as a synonym for MediaSize. */ | 27 | /* Define whether we accept PageSize as a synonym for MediaSize. */ |
34 | /* This is for backward compatibility only. */ | 28 | /* This is for backward compatibility only. */ |
35 | #define PAGESIZE_IS_MEDIASIZE | 29 | #define PAGESIZE_IS_MEDIASIZE |
@@ -82,6 +76,7 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist) | |||
82 | gs_param_string dns, pcms, profile_array[NUM_DEVICE_PROFILES]; | 76 | gs_param_string dns, pcms, profile_array[NUM_DEVICE_PROFILES]; |
83 | gs_param_string proof_profile, link_profile, icc_colorants; | 77 | gs_param_string proof_profile, link_profile, icc_colorants; |
84 | gsicc_rendering_intents_t profile_intents[NUM_DEVICE_PROFILES]; | 78 | gsicc_rendering_intents_t profile_intents[NUM_DEVICE_PROFILES]; |
79 | gsicc_blackptcomp_t blackptcomps[NUM_DEVICE_PROFILES]; | ||
85 | bool devicegraytok = true; /* Default if device profile stuct not set */ | 80 | bool devicegraytok = true; /* Default if device profile stuct not set */ |
86 | bool usefastcolor = false; /* set for unmanaged color */ | 81 | bool usefastcolor = false; /* set for unmanaged color */ |
87 | bool prebandthreshold = true; | 82 | bool prebandthreshold = true; |
@@ -147,10 +142,12 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist) | |||
147 | || dev_profile->device_profile[k]->name == NULL) { | 142 | || dev_profile->device_profile[k]->name == NULL) { |
148 | param_string_from_string(profile_array[k], null_str); | 143 | param_string_from_string(profile_array[k], null_str); |
149 | profile_intents[k] = gsPERCEPTUAL; | 144 | profile_intents[k] = gsPERCEPTUAL; |
145 | blackptcomps[k] = gsBLACKPTCOMP_ON; | ||
150 | } else { | 146 | } else { |
151 | param_string_from_string(profile_array[k], | 147 | param_string_from_string(profile_array[k], |
152 | dev_profile->device_profile[k]->name); | 148 | dev_profile->device_profile[k]->name); |
153 | profile_intents[k] = dev_profile->intent[k]; | 149 | profile_intents[k] = dev_profile->intent[k]; |
150 | blackptcomps[k] = dev_profile->blackptcomp[k]; | ||
154 | } | 151 | } |
155 | } | 152 | } |
156 | /* The proof and link profile */ | 153 | /* The proof and link profile */ |
@@ -189,6 +186,7 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist) | |||
189 | for (k = 0; k < NUM_DEVICE_PROFILES; k++) { | 186 | for (k = 0; k < NUM_DEVICE_PROFILES; k++) { |
190 | param_string_from_string(profile_array[k], null_str); | 187 | param_string_from_string(profile_array[k], null_str); |
191 | profile_intents[k] = gsPERCEPTUAL; | 188 | profile_intents[k] = gsPERCEPTUAL; |
189 | blackptcomps[k] = gsBLACKPTCOMP_ON; | ||
192 | } | 190 | } |
193 | param_string_from_string(proof_profile, null_str); | 191 | param_string_from_string(proof_profile, null_str); |
194 | param_string_from_string(link_profile, null_str); | 192 | param_string_from_string(link_profile, null_str); |
@@ -234,6 +232,10 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist) | |||
234 | (code = param_write_int(plist,"GraphicIntent", (const int *) &(profile_intents[1]))) < 0 || | 232 | (code = param_write_int(plist,"GraphicIntent", (const int *) &(profile_intents[1]))) < 0 || |
235 | (code = param_write_int(plist,"ImageIntent", (const int *) &(profile_intents[2]))) < 0 || | 233 | (code = param_write_int(plist,"ImageIntent", (const int *) &(profile_intents[2]))) < 0 || |
236 | (code = param_write_int(plist,"TextIntent", (const int *) &(profile_intents[3]))) < 0 || | 234 | (code = param_write_int(plist,"TextIntent", (const int *) &(profile_intents[3]))) < 0 || |
235 | (code = param_write_int(plist,"BlackPtComp", (const int *) (&(blackptcomps[0])))) < 0 || | ||
236 | (code = param_write_int(plist,"GraphBlackPt", (const int *) &(blackptcomps[1]))) < 0 || | ||
237 | (code = param_write_int(plist,"ImageBlackPt", (const int *) &(blackptcomps[2]))) < 0 || | ||
238 | (code = param_write_int(plist,"TextBlackPt", (const int *) &(blackptcomps[3]))) < 0 || | ||
237 | (code = param_write_int_array(plist, "HWSize", &hwsa)) < 0 || | 239 | (code = param_write_int_array(plist, "HWSize", &hwsa)) < 0 || |
238 | (code = param_write_float_array(plist, ".HWMargins", &hwma)) < 0 || | 240 | (code = param_write_float_array(plist, ".HWMargins", &hwma)) < 0 || |
239 | (code = param_write_float_array(plist, ".MarginsHWResolution", &mhwra)) < 0 || | 241 | (code = param_write_float_array(plist, ".MarginsHWResolution", &mhwra)) < 0 || |
@@ -591,7 +593,7 @@ gx_default_put_usefastcolor(bool fastcolor, gx_device * dev) | |||
591 | } | 593 | } |
592 | 594 | ||
593 | static void | 595 | static void |
594 | gx_default_put_intent(gsicc_profile_types_t icc_intent, gx_device * dev, | 596 | gx_default_put_intent(gsicc_rendering_intents_t icc_intent, gx_device * dev, |
595 | gsicc_profile_types_t index) | 597 | gsicc_profile_types_t index) |
596 | { | 598 | { |
597 | int code; | 599 | int code; |
@@ -618,6 +620,33 @@ gx_default_put_intent(gsicc_profile_types_t icc_intent, gx_device * dev, | |||
618 | } | 620 | } |
619 | 621 | ||
620 | static void | 622 | static void |
623 | gx_default_put_blackptcomp(gsicc_blackptcomp_t blackptcomp, gx_device * dev, | ||
624 | gsicc_profile_types_t index) | ||
625 | { | ||
626 | int code; | ||
627 | cmm_dev_profile_t *profile_struct; | ||
628 | |||
629 | if (dev->procs.get_profile == NULL) { | ||
630 | /* This is an odd case where the device has not yet fully been | ||
631 | set up with its procedures yet. We want to make sure that | ||
632 | we catch this so we assume here that we are dealing with | ||
633 | the target device */ | ||
634 | if (dev->icc_struct == NULL) { | ||
635 | /* Intializes the device structure. Not the profile though for index */ | ||
636 | dev->icc_struct = gsicc_new_device_profile_array(dev->memory); | ||
637 | } | ||
638 | code = gsicc_set_device_blackptcomp(dev, blackptcomp, index); | ||
639 | } else { | ||
640 | code = dev_proc(dev, get_profile)(dev, &profile_struct); | ||
641 | if (profile_struct == NULL) { | ||
642 | /* Create now */ | ||
643 | dev->icc_struct = gsicc_new_device_profile_array(dev->memory); | ||
644 | } | ||
645 | code = gsicc_set_device_blackptcomp(dev, blackptcomp, index); | ||
646 | } | ||
647 | } | ||
648 | |||
649 | static void | ||
621 | gx_default_put_icc_colorants(gs_param_string *colorants, gx_device * dev) | 650 | gx_default_put_icc_colorants(gs_param_string *colorants, gx_device * dev) |
622 | { | 651 | { |
623 | char *tempstr; | 652 | char *tempstr; |
@@ -697,16 +726,28 @@ gx_default_put_params(gx_device * dev, gs_param_list * plist) | |||
697 | int gab = dev->color_info.anti_alias.graphics_bits; | 726 | int gab = dev->color_info.anti_alias.graphics_bits; |
698 | int mpbm = dev->MaxPatternBitmap; | 727 | int mpbm = dev->MaxPatternBitmap; |
699 | int rend_intent[NUM_DEVICE_PROFILES]; | 728 | int rend_intent[NUM_DEVICE_PROFILES]; |
729 | int blackptcomp[NUM_DEVICE_PROFILES]; | ||
700 | gs_param_string cms; | 730 | gs_param_string cms; |
701 | int leadingedge = dev->LeadingEdge; | 731 | int leadingedge = dev->LeadingEdge; |
702 | int k; | 732 | int k; |
703 | bool devicegraytok = true; | 733 | bool devicegraytok = true; |
704 | bool usefastcolor = false; | 734 | bool usefastcolor = false; |
705 | bool prebandthreshold = false; | 735 | bool prebandthreshold = false; |
706 | 736 | bool rend_intent_set[NUM_DEVICE_PROFILES]; /* needed so that global forces */ | |
737 | bool blackptcomp_set[NUM_DEVICE_PROFILES]; /* all the types if no types set */ | ||
738 | int profile_types[NUM_DEVICE_PROFILES] = {gsDEFAULTPROFILE, | ||
739 | gsGRAPHICPROFILE, | ||
740 | gsIMAGEPROFILE, | ||
741 | gsTEXTPROFILE}; | ||
742 | |||
743 | for (k = 0; k < NUM_DEVICE_PROFILES; k++) { | ||
744 | rend_intent_set[k] = false; | ||
745 | blackptcomp_set[k] = false; | ||
746 | } | ||
707 | if (dev->icc_struct != NULL) { | 747 | if (dev->icc_struct != NULL) { |
708 | for (k = 0; k < NUM_DEVICE_PROFILES; k++) { | 748 | for (k = 0; k < NUM_DEVICE_PROFILES; k++) { |
709 | rend_intent[k] = dev->icc_struct->intent[k]; | 749 | rend_intent[k] = dev->icc_struct->intent[k]; |
750 | blackptcomp[k] = dev->icc_struct->blackptcomp[k]; | ||
710 | } | 751 | } |
711 | devicegraytok = dev->icc_struct->devicegraytok; | 752 | devicegraytok = dev->icc_struct->devicegraytok; |
712 | usefastcolor = dev->icc_struct->usefastcolor; | 753 | usefastcolor = dev->icc_struct->usefastcolor; |
@@ -714,6 +755,7 @@ gx_default_put_params(gx_device * dev, gs_param_list * plist) | |||
714 | } else { | 755 | } else { |
715 | for (k = 0; k < NUM_DEVICE_PROFILES; k++) { | 756 | for (k = 0; k < NUM_DEVICE_PROFILES; k++) { |
716 | rend_intent[k] = gsPERCEPTUAL; | 757 | rend_intent[k] = gsPERCEPTUAL; |
758 | blackptcomp[k] = gsBLACKPTCOMP_ON; | ||
717 | } | 759 | } |
718 | } | 760 | } |
719 | 761 | ||
@@ -918,21 +960,57 @@ nce: | |||
918 | &(rend_intent[0]))) < 0) { | 960 | &(rend_intent[0]))) < 0) { |
919 | ecode = code; | 961 | ecode = code; |
920 | param_signal_error(plist, param_name, ecode); | 962 | param_signal_error(plist, param_name, ecode); |
963 | } else if (code == 0) { | ||
964 | rend_intent_set[0] = true; | ||
921 | } | 965 | } |
922 | if ((code = param_read_int(plist, (param_name = "GraphicIntent"), | 966 | if ((code = param_read_int(plist, (param_name = "GraphicIntent"), |
923 | &(rend_intent[1]))) < 0) { | 967 | &(rend_intent[1]))) < 0) { |
924 | ecode = code; | 968 | ecode = code; |
925 | param_signal_error(plist, param_name, ecode); | 969 | param_signal_error(plist, param_name, ecode); |
970 | } else if (code == 0) { | ||
971 | rend_intent_set[1] = true; | ||
926 | } | 972 | } |
927 | if ((code = param_read_int(plist, (param_name = "ImageIntent"), | 973 | if ((code = param_read_int(plist, (param_name = "ImageIntent"), |
928 | &(rend_intent[2]))) < 0) { | 974 | &(rend_intent[2]))) < 0) { |
929 | ecode = code; | 975 | ecode = code; |
930 | param_signal_error(plist, param_name, ecode); | 976 | param_signal_error(plist, param_name, ecode); |
977 | } else if (code == 0) { | ||
978 | rend_intent_set[2] = true; | ||
931 | } | 979 | } |
932 | if ((code = param_read_int(plist, (param_name = "TextIntent"), | 980 | if ((code = param_read_int(plist, (param_name = "TextIntent"), |
933 | &(rend_intent[3]))) < 0) { | 981 | &(rend_intent[3]))) < 0) { |
934 | ecode = code; | 982 | ecode = code; |
935 | param_signal_error(plist, param_name, ecode); | 983 | param_signal_error(plist, param_name, ecode); |
984 | } else if (code == 0) { | ||
985 | rend_intent_set[3] = true; | ||
986 | } | ||
987 | if ((code = param_read_int(plist, (param_name = "BlackPtComp"), | ||
988 | &(blackptcomp[0]))) < 0) { | ||
989 | ecode = code; | ||
990 | param_signal_error(plist, param_name, ecode); | ||
991 | } else if (code == 0) { | ||
992 | blackptcomp_set[0] = true; | ||
993 | } | ||
994 | if ((code = param_read_int(plist, (param_name = "GraphBlackPt"), | ||
995 | &(blackptcomp[1]))) < 0) { | ||
996 | ecode = code; | ||
997 | param_signal_error(plist, param_name, ecode); | ||
998 | } else if (code == 0) { | ||
999 | blackptcomp_set[1] = true; | ||
1000 | } | ||
1001 | if ((code = param_read_int(plist, (param_name = "ImageBlackPt"), | ||
1002 | &(blackptcomp[2]))) < 0) { | ||
1003 | ecode = code; | ||
1004 | param_signal_error(plist, param_name, ecode); | ||
1005 | } else if (code == 0) { | ||
1006 | blackptcomp_set[2] = true; | ||
1007 | } | ||
1008 | if ((code = param_read_int(plist, (param_name = "TextBlackPt"), | ||
1009 | &(blackptcomp[3]))) < 0) { | ||
1010 | ecode = code; | ||
1011 | param_signal_error(plist, param_name, ecode); | ||
1012 | } else if (code == 0) { | ||
1013 | blackptcomp_set[3] = true; | ||
936 | } | 1014 | } |
937 | if ((code = param_read_bool(plist, (param_name = "DeviceGrayToK"), | 1015 | if ((code = param_read_bool(plist, (param_name = "DeviceGrayToK"), |
938 | &devicegraytok)) < 0) { | 1016 | &devicegraytok)) < 0) { |
@@ -1142,12 +1220,27 @@ nce: | |||
1142 | dev->MaxPatternBitmap = mpbm; | 1220 | dev->MaxPatternBitmap = mpbm; |
1143 | gx_device_decache_colors(dev); | 1221 | gx_device_decache_colors(dev); |
1144 | 1222 | ||
1145 | /* Take care of the rendering intents */ | 1223 | /* Take care of the rendering intents and blackpts. For those that |
1224 | are not set special, the default provides an override */ | ||
1146 | if (dev->icc_struct != NULL) { | 1225 | if (dev->icc_struct != NULL) { |
1226 | /* Set the default object */ | ||
1147 | gx_default_put_intent(rend_intent[0], dev, gsDEFAULTPROFILE); | 1227 | gx_default_put_intent(rend_intent[0], dev, gsDEFAULTPROFILE); |
1148 | gx_default_put_intent(rend_intent[1], dev, gsGRAPHICPROFILE); | 1228 | gx_default_put_blackptcomp(blackptcomp[0], dev, gsDEFAULTPROFILE); |
1149 | gx_default_put_intent(rend_intent[2], dev, gsIMAGEPROFILE); | 1229 | |
1150 | gx_default_put_intent(rend_intent[3], dev, gsTEXTPROFILE); | 1230 | /* If the default was specified and not a specialized one (e.g. graphic |
1231 | image or text) then the special one will get set to the default */ | ||
1232 | for (k = 1; k < NUM_DEVICE_PROFILES; k++) { | ||
1233 | if (rend_intent_set[0] && !rend_intent_set[k]) { | ||
1234 | gx_default_put_intent(rend_intent[0], dev, profile_types[k]); | ||
1235 | } else { | ||
1236 | gx_default_put_intent(rend_intent[k], dev, profile_types[k]); | ||
1237 | } | ||
1238 | if (blackptcomp_set[0] && !blackptcomp_set[k]) { | ||
1239 | gx_default_put_blackptcomp(blackptcomp[0], dev, profile_types[k]); | ||
1240 | } else { | ||
1241 | gx_default_put_blackptcomp(blackptcomp[k], dev, profile_types[k]); | ||
1242 | } | ||
1243 | } | ||
1151 | } | 1244 | } |
1152 | gx_default_put_graytok(devicegraytok, dev); | 1245 | gx_default_put_graytok(devicegraytok, dev); |
1153 | gx_default_put_usefastcolor(usefastcolor, dev); | 1246 | gx_default_put_usefastcolor(usefastcolor, dev); |
diff --git a/gs/base/gsequivc.c b/gs/base/gsequivc.c index 84dd1007f..8d105e2fe 100644 --- a/gs/base/gsequivc.c +++ b/gs/base/gsequivc.c | |||
@@ -453,6 +453,7 @@ capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_state * pgs, | |||
453 | color_capture_device temp_device = { 0 }; | 453 | color_capture_device temp_device = { 0 }; |
454 | gx_device_color dev_color; | 454 | gx_device_color dev_color; |
455 | gsicc_rendering_intents_t rendering_intent; | 455 | gsicc_rendering_intents_t rendering_intent; |
456 | gsicc_blackptcomp_t blackptcomp; | ||
456 | int code; | 457 | int code; |
457 | cmm_dev_profile_t *dev_profile; | 458 | cmm_dev_profile_t *dev_profile; |
458 | cmm_profile_t *curr_output_profile; | 459 | cmm_profile_t *curr_output_profile; |
@@ -461,7 +462,7 @@ capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_state * pgs, | |||
461 | code = dev_proc(pdev, get_profile)(pdev, &dev_profile); | 462 | code = dev_proc(pdev, get_profile)(pdev, &dev_profile); |
462 | gsicc_extract_profile(pdev->graphics_type_tag, | 463 | gsicc_extract_profile(pdev->graphics_type_tag, |
463 | dev_profile, &(curr_output_profile), | 464 | dev_profile, &(curr_output_profile), |
464 | &rendering_intent); | 465 | &rendering_intent, &blackptcomp); |
465 | /* | 466 | /* |
466 | * Create a temp device. The primary purpose of this device is pass the | 467 | * Create a temp device. The primary purpose of this device is pass the |
467 | * separation number and a pointer to the original device's equivalent | 468 | * separation number and a pointer to the original device's equivalent |
diff --git a/gs/base/gsicc.c b/gs/base/gsicc.c index aa202c41e..245fe7b87 100644 --- a/gs/base/gsicc.c +++ b/gs/base/gsicc.c | |||
@@ -355,7 +355,7 @@ gx_remap_ICC(const gs_client_color * pcc, const gs_color_space * pcs, | |||
355 | 355 | ||
356 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 356 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
357 | num_des_comps = gsicc_get_device_profile_comps(dev_profile); | 357 | num_des_comps = gsicc_get_device_profile_comps(dev_profile); |
358 | rendering_params.black_point_comp = BP_ON; | 358 | rendering_params.black_point_comp = pis->blackptcomp; |
359 | rendering_params.graphics_type_tag = dev->graphics_type_tag; | 359 | rendering_params.graphics_type_tag = dev->graphics_type_tag; |
360 | /* Need to figure out which one rules here on rendering intent. The | 360 | /* Need to figure out which one rules here on rendering intent. The |
361 | source of the device */ | 361 | source of the device */ |
@@ -444,7 +444,7 @@ gx_remap_ICC_imagelab(const gs_client_color * pcc, const gs_color_space * pcs, | |||
444 | 444 | ||
445 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 445 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
446 | num_des_comps = gsicc_get_device_profile_comps(dev_profile); | 446 | num_des_comps = gsicc_get_device_profile_comps(dev_profile); |
447 | rendering_params.black_point_comp = BP_ON; | 447 | rendering_params.black_point_comp = pis->blackptcomp; |
448 | rendering_params.graphics_type_tag = dev->graphics_type_tag; | 448 | rendering_params.graphics_type_tag = dev->graphics_type_tag; |
449 | /* Need to figure out which one rules here on rendering intent. The | 449 | /* Need to figure out which one rules here on rendering intent. The |
450 | source of the device */ | 450 | source of the device */ |
@@ -511,7 +511,7 @@ gx_concretize_ICC( | |||
511 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 511 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
512 | num_des_comps = gsicc_get_device_profile_comps(dev_profile); | 512 | num_des_comps = gsicc_get_device_profile_comps(dev_profile); |
513 | /* Define the rendering intents. MJV to fix */ | 513 | /* Define the rendering intents. MJV to fix */ |
514 | rendering_params.black_point_comp = BP_ON; | 514 | rendering_params.black_point_comp = pis->blackptcomp; |
515 | rendering_params.graphics_type_tag = dev->graphics_type_tag; | 515 | rendering_params.graphics_type_tag = dev->graphics_type_tag; |
516 | rendering_params.rendering_intent = pis->renderingintent; | 516 | rendering_params.rendering_intent = pis->renderingintent; |
517 | for (k = 0; k < pcs->cmm_icc_profile_data->num_comps; k++) { | 517 | for (k = 0; k < pcs->cmm_icc_profile_data->num_comps; k++) { |
diff --git a/gs/base/gsicc_cache.c b/gs/base/gsicc_cache.c index 6539f8561..533654007 100644 --- a/gs/base/gsicc_cache.c +++ b/gs/base/gsicc_cache.c | |||
@@ -316,12 +316,13 @@ gsicc_get_cspace_hash(gsicc_manager_t *icc_manager, gx_device *dev, | |||
316 | cmm_dev_profile_t *dev_profile; | 316 | cmm_dev_profile_t *dev_profile; |
317 | cmm_profile_t *icc_profile; | 317 | cmm_profile_t *icc_profile; |
318 | gsicc_rendering_intents_t rendering_intent; | 318 | gsicc_rendering_intents_t rendering_intent; |
319 | gsicc_blackptcomp_t blackptcomp; | ||
319 | int code; | 320 | int code; |
320 | 321 | ||
321 | if (cmm_icc_profile_data == NULL ) { | 322 | if (cmm_icc_profile_data == NULL ) { |
322 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 323 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
323 | gsicc_extract_profile(dev->graphics_type_tag, dev_profile, | 324 | gsicc_extract_profile(dev->graphics_type_tag, dev_profile, |
324 | &(icc_profile), &rendering_intent); | 325 | &(icc_profile), &rendering_intent, &blackptcomp); |
325 | *hash = icc_profile->hashcode; | 326 | *hash = icc_profile->hashcode; |
326 | return; | 327 | return; |
327 | } | 328 | } |
@@ -455,6 +456,7 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in, | |||
455 | gs_state *pgs; | 456 | gs_state *pgs; |
456 | gx_device *dev; | 457 | gx_device *dev; |
457 | gsicc_rendering_intents_t rendering_intent; | 458 | gsicc_rendering_intents_t rendering_intent; |
459 | gsicc_blackptcomp_t blackptcomp; | ||
458 | bool use_src_intent = false; | 460 | bool use_src_intent = false; |
459 | cmm_dev_profile_t *dev_profile; | 461 | cmm_dev_profile_t *dev_profile; |
460 | int code; | 462 | int code; |
@@ -483,14 +485,16 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in, | |||
483 | gsicc_get_srcprofile(gs_input_profile->data_cs, | 485 | gsicc_get_srcprofile(gs_input_profile->data_cs, |
484 | dev->graphics_type_tag, | 486 | dev->graphics_type_tag, |
485 | pis->icc_manager->srcgtag_profile, | 487 | pis->icc_manager->srcgtag_profile, |
486 | &(gs_srcgtag_profile), &rendering_intent); | 488 | &(gs_srcgtag_profile), &rendering_intent, |
489 | &blackptcomp); | ||
487 | if (gs_srcgtag_profile != NULL) { | 490 | if (gs_srcgtag_profile != NULL) { |
488 | /* In this case, the user is letting the source profiles | 491 | /* In this case, the user is letting the source profiles |
489 | drive the color management. Let that set the | 492 | drive the color management. Let that set the |
490 | rendering intent too as they must know what they | 493 | rendering intent and blackpoint compensation also as they |
491 | are doing. */ | 494 | must know what they are doing. */ |
492 | gs_input_profile = gs_srcgtag_profile; | 495 | gs_input_profile = gs_srcgtag_profile; |
493 | rendering_params->rendering_intent = rendering_intent; | 496 | rendering_params->rendering_intent = rendering_intent; |
497 | rendering_params->black_point_comp = blackptcomp; | ||
494 | use_src_intent = true; | 498 | use_src_intent = true; |
495 | } | 499 | } |
496 | } | 500 | } |
@@ -500,8 +504,9 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in, | |||
500 | devicegraytok = false; | 504 | devicegraytok = false; |
501 | } else { | 505 | } else { |
502 | /* Use the device profile. Only use the rendering intent if override_ri | 506 | /* Use the device profile. Only use the rendering intent if override_ri |
503 | is set. Note that this can conflict with intents set from the source | 507 | is set. Also, only use the blackpoint if overide_bp is set. |
504 | objects so the user needs to understand what options to set. */ | 508 | Note that this can conflict with intents set from the source |
509 | objects so the user needs to understand what options to set. */ | ||
505 | gs_color_space_index index = | 510 | gs_color_space_index index = |
506 | gsicc_get_default_type(gs_input_profile); | 511 | gsicc_get_default_type(gs_input_profile); |
507 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 512 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
@@ -520,8 +525,9 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in, | |||
520 | } | 525 | } |
521 | } | 526 | } |
522 | gsicc_extract_profile(dev->graphics_type_tag, dev_profile, | 527 | gsicc_extract_profile(dev->graphics_type_tag, dev_profile, |
523 | &(gs_output_profile), &rendering_intent); | 528 | &(gs_output_profile), &rendering_intent, |
524 | /* Check if the incoming rendering itent was source based | 529 | &blackptcomp); |
530 | /* Check if the incoming rendering intent was source based | ||
525 | (this can occur for high level images in the clist) in | 531 | (this can occur for high level images in the clist) in |
526 | that case we need to use the source ri and not the device one */ | 532 | that case we need to use the source ri and not the device one */ |
527 | if (!(rendering_params->rendering_intent & gsRI_OVERRIDE)) { | 533 | if (!(rendering_params->rendering_intent & gsRI_OVERRIDE)) { |
@@ -529,6 +535,12 @@ gsicc_get_link(const gs_imager_state *pis, gx_device *dev_in, | |||
529 | rendering_params->rendering_intent = rendering_intent; | 535 | rendering_params->rendering_intent = rendering_intent; |
530 | } | 536 | } |
531 | } | 537 | } |
538 | /* Similar to the black point compensation */ | ||
539 | if (!(rendering_params->black_point_comp & gsBP_OVERRIDE)) { | ||
540 | if (pis->icc_manager != NULL && pis->icc_manager->override_bp == true) { | ||
541 | rendering_params->black_point_comp = blackptcomp; | ||
542 | } | ||
543 | } | ||
532 | devicegraytok = dev_profile->devicegraytok; | 544 | devicegraytok = dev_profile->devicegraytok; |
533 | } | 545 | } |
534 | /* If we are going from DeviceGray to DeviceCMYK and devicegraytok | 546 | /* If we are going from DeviceGray to DeviceCMYK and devicegraytok |
@@ -938,6 +950,7 @@ gsicc_transform_named_color(float tint_value, byte *color_name, uint name_size, | |||
938 | gsicc_link_t *icc_link; | 950 | gsicc_link_t *icc_link; |
939 | cmm_profile_t *curr_output_profile; | 951 | cmm_profile_t *curr_output_profile; |
940 | gsicc_rendering_intents_t rendering_intent; | 952 | gsicc_rendering_intents_t rendering_intent; |
953 | gsicc_blackptcomp_t blackptcomp; | ||
941 | cmm_dev_profile_t *dev_profile; | 954 | cmm_dev_profile_t *dev_profile; |
942 | 955 | ||
943 | /* Check if the data that we have has already been generated. */ | 956 | /* Check if the data that we have has already been generated. */ |
@@ -1066,7 +1079,7 @@ gsicc_transform_named_color(float tint_value, byte *color_name, uint name_size, | |||
1066 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 1079 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
1067 | gsicc_extract_profile(dev->graphics_type_tag, | 1080 | gsicc_extract_profile(dev->graphics_type_tag, |
1068 | dev_profile, &(curr_output_profile), | 1081 | dev_profile, &(curr_output_profile), |
1069 | &rendering_intent); | 1082 | &rendering_intent, &blackptcomp); |
1070 | } | 1083 | } |
1071 | icc_link = gsicc_get_link_profile(pis, dev, | 1084 | icc_link = gsicc_get_link_profile(pis, dev, |
1072 | pis->icc_manager->lab_profile, | 1085 | pis->icc_manager->lab_profile, |
diff --git a/gs/base/gsicc_lcms2.c b/gs/base/gsicc_lcms2.c index 7f09dd0b6..7f167eeb9 100644 --- a/gs/base/gsicc_lcms2.c +++ b/gs/base/gsicc_lcms2.c | |||
@@ -330,6 +330,7 @@ gscms_get_link(gcmmhprofile_t lcms_srchandle, | |||
330 | cmsColorSpaceSignature src_color_space,des_color_space; | 330 | cmsColorSpaceSignature src_color_space,des_color_space; |
331 | int src_nChannels,des_nChannels; | 331 | int src_nChannels,des_nChannels; |
332 | int lcms_src_color_space, lcms_des_color_space; | 332 | int lcms_src_color_space, lcms_des_color_space; |
333 | unsigned int flag; | ||
333 | 334 | ||
334 | /* Check for case of request for a transfrom from a device link profile | 335 | /* Check for case of request for a transfrom from a device link profile |
335 | in that case, the destination profile is NULL */ | 336 | in that case, the destination profile is NULL */ |
@@ -363,11 +364,15 @@ gscms_get_link(gcmmhprofile_t lcms_srchandle, | |||
363 | des_data_type = des_data_type | ENDIAN16_SH(1); | 364 | des_data_type = des_data_type | ENDIAN16_SH(1); |
364 | #endif | 365 | #endif |
365 | /* Create the link */ | 366 | /* Create the link */ |
366 | return(cmsCreateTransformTHR((cmsContext)memory, | 367 | flag = cmsFLAGS_HIGHRESPRECALC; |
368 | if (rendering_params->black_point_comp == gsBLACKPTCOMP_ON | ||
369 | || rendering_params->black_point_comp == gsBLACKPTCOMP_ON_OR) { | ||
370 | flag = (flag | cmsFLAGS_BLACKPOINTCOMPENSATION); | ||
371 | } | ||
372 | return cmsCreateTransformTHR((cmsContext)memory, | ||
367 | lcms_srchandle, src_data_type, | 373 | lcms_srchandle, src_data_type, |
368 | lcms_deshandle, des_data_type, | 374 | lcms_deshandle, des_data_type, |
369 | rendering_params->rendering_intent, | 375 | rendering_params->rendering_intent,flag); |
370 | (cmsFLAGS_BLACKPOINTCOMPENSATION | cmsFLAGS_HIGHRESPRECALC))); | ||
371 | /* cmsFLAGS_HIGHRESPRECALC) cmsFLAGS_NOTPRECALC cmsFLAGS_LOWRESPRECALC*/ | 376 | /* cmsFLAGS_HIGHRESPRECALC) cmsFLAGS_NOTPRECALC cmsFLAGS_LOWRESPRECALC*/ |
372 | } | 377 | } |
373 | 378 | ||
@@ -387,6 +392,7 @@ gscms_get_link_proof_devlink(gcmmhprofile_t lcms_srchandle, | |||
387 | int lcms_src_color_space, lcms_des_color_space; | 392 | int lcms_src_color_space, lcms_des_color_space; |
388 | cmsHPROFILE hProfiles[5]; | 393 | cmsHPROFILE hProfiles[5]; |
389 | int nProfiles = 0; | 394 | int nProfiles = 0; |
395 | unsigned int flag; | ||
390 | 396 | ||
391 | /* First handle all the source stuff */ | 397 | /* First handle all the source stuff */ |
392 | src_color_space = cmsGetColorSpace(lcms_srchandle); | 398 | src_color_space = cmsGetColorSpace(lcms_srchandle); |
@@ -420,10 +426,14 @@ gscms_get_link_proof_devlink(gcmmhprofile_t lcms_srchandle, | |||
420 | if (lcms_devlinkhandle != NULL) { | 426 | if (lcms_devlinkhandle != NULL) { |
421 | hProfiles[nProfiles++] = lcms_devlinkhandle; | 427 | hProfiles[nProfiles++] = lcms_devlinkhandle; |
422 | } | 428 | } |
423 | return(cmsCreateMultiprofileTransformTHR((cmsContext)memory, | 429 | flag = cmsFLAGS_HIGHRESPRECALC; |
430 | if (rendering_params->black_point_comp == gsBLACKPTCOMP_ON | ||
431 | || rendering_params->black_point_comp == gsBLACKPTCOMP_ON_OR) { | ||
432 | flag = (flag | cmsFLAGS_BLACKPOINTCOMPENSATION); | ||
433 | } | ||
434 | return cmsCreateMultiprofileTransformTHR((cmsContext)memory, | ||
424 | hProfiles, nProfiles, src_data_type, | 435 | hProfiles, nProfiles, src_data_type, |
425 | des_data_type, rendering_params->rendering_intent, | 436 | des_data_type, rendering_params->rendering_intent, flag); |
426 | (cmsFLAGS_BLACKPOINTCOMPENSATION | cmsFLAGS_HIGHRESPRECALC))); | ||
427 | } | 437 | } |
428 | 438 | ||
429 | /* Do any initialization if needed to the CMS */ | 439 | /* Do any initialization if needed to the CMS */ |
diff --git a/gs/base/gsicc_manage.c b/gs/base/gsicc_manage.c index 474e55826..71d5d0b1c 100644 --- a/gs/base/gsicc_manage.c +++ b/gs/base/gsicc_manage.c | |||
@@ -463,6 +463,7 @@ gsicc_set_srcgtag_struct(gsicc_manager_t *icc_manager, const char* pname, | |||
463 | static const char *const srcgtag_keys[] = {GSICC_SRCGTAG_KEYS}; | 463 | static const char *const srcgtag_keys[] = {GSICC_SRCGTAG_KEYS}; |
464 | cmm_profile_t *icc_profile; | 464 | cmm_profile_t *icc_profile; |
465 | int ri; | 465 | int ri; |
466 | int blackptcomp; | ||
466 | cmm_srcgtag_profile_t *srcgtag; | 467 | cmm_srcgtag_profile_t *srcgtag; |
467 | bool start = true; | 468 | bool start = true; |
468 | 469 | ||
@@ -552,6 +553,11 @@ gsicc_set_srcgtag_struct(gsicc_manager_t *icc_manager, const char* pname, | |||
552 | curr_ptr = strtok(NULL, "\t,\32\n\r"); | 553 | curr_ptr = strtok(NULL, "\t,\32\n\r"); |
553 | count = sscanf(curr_ptr, "%d", &ri); | 554 | count = sscanf(curr_ptr, "%d", &ri); |
554 | srcgtag->cmyk_intent[gsSRC_GRAPPRO] = ri | gsRI_OVERRIDE; | 555 | srcgtag->cmyk_intent[gsSRC_GRAPPRO] = ri | gsRI_OVERRIDE; |
556 | /* Get the black point compensation setting */ | ||
557 | curr_ptr = strtok(NULL, "\t,\32\n\r"); | ||
558 | count = sscanf(curr_ptr, "%d", &blackptcomp); | ||
559 | srcgtag->cmyk_blackptcomp[gsSRC_GRAPPRO] = | ||
560 | blackptcomp | gsBP_OVERRIDE; | ||
555 | break; | 561 | break; |
556 | case IMAGE_CMYK: | 562 | case IMAGE_CMYK: |
557 | srcgtag->cmyk_profiles[gsSRC_IMAGPRO] = icc_profile; | 563 | srcgtag->cmyk_profiles[gsSRC_IMAGPRO] = icc_profile; |
@@ -559,6 +565,11 @@ gsicc_set_srcgtag_struct(gsicc_manager_t *icc_manager, const char* pname, | |||
559 | curr_ptr = strtok(NULL, "\t,\32\n\r"); | 565 | curr_ptr = strtok(NULL, "\t,\32\n\r"); |
560 | count = sscanf(curr_ptr, "%d", &ri); | 566 | count = sscanf(curr_ptr, "%d", &ri); |
561 | srcgtag->cmyk_intent[gsSRC_IMAGPRO] = ri | gsRI_OVERRIDE; | 567 | srcgtag->cmyk_intent[gsSRC_IMAGPRO] = ri | gsRI_OVERRIDE; |
568 | /* Get the black point compensation setting */ | ||
569 | curr_ptr = strtok(NULL, "\t,\32\n\r"); | ||
570 | count = sscanf(curr_ptr, "%d", &blackptcomp); | ||
571 | srcgtag->cmyk_blackptcomp[gsSRC_IMAGPRO] = | ||
572 | blackptcomp | gsBP_OVERRIDE; | ||
562 | break; | 573 | break; |
563 | case TEXT_CMYK: | 574 | case TEXT_CMYK: |
564 | srcgtag->cmyk_profiles[gsSRC_TEXTPRO] = icc_profile; | 575 | srcgtag->cmyk_profiles[gsSRC_TEXTPRO] = icc_profile; |
@@ -566,6 +577,11 @@ gsicc_set_srcgtag_struct(gsicc_manager_t *icc_manager, const char* pname, | |||
566 | curr_ptr = strtok(NULL, "\t,\32\n\r"); | 577 | curr_ptr = strtok(NULL, "\t,\32\n\r"); |
567 | count = sscanf(curr_ptr, "%d", &ri); | 578 | count = sscanf(curr_ptr, "%d", &ri); |
568 | srcgtag->cmyk_intent[gsSRC_TEXTPRO] = ri | gsRI_OVERRIDE; | 579 | srcgtag->cmyk_intent[gsSRC_TEXTPRO] = ri | gsRI_OVERRIDE; |
580 | /* Get the black point compensation setting */ | ||
581 | curr_ptr = strtok(NULL, "\t,\32\n\r"); | ||
582 | count = sscanf(curr_ptr, "%d", &blackptcomp); | ||
583 | srcgtag->cmyk_blackptcomp[gsSRC_TEXTPRO] = | ||
584 | blackptcomp | gsBP_OVERRIDE; | ||
569 | break; | 585 | break; |
570 | case GRAPHIC_RGB: | 586 | case GRAPHIC_RGB: |
571 | srcgtag->rgb_profiles[gsSRC_GRAPPRO] = icc_profile; | 587 | srcgtag->rgb_profiles[gsSRC_GRAPPRO] = icc_profile; |
@@ -573,6 +589,11 @@ gsicc_set_srcgtag_struct(gsicc_manager_t *icc_manager, const char* pname, | |||
573 | curr_ptr = strtok(NULL, "\t,\32\n\r"); | 589 | curr_ptr = strtok(NULL, "\t,\32\n\r"); |
574 | count = sscanf(curr_ptr, "%d", &ri); | 590 | count = sscanf(curr_ptr, "%d", &ri); |
575 | srcgtag->rgb_intent[gsSRC_GRAPPRO] = ri | gsRI_OVERRIDE; | 591 | srcgtag->rgb_intent[gsSRC_GRAPPRO] = ri | gsRI_OVERRIDE; |
592 | /* Get the black point compensation setting */ | ||
593 | curr_ptr = strtok(NULL, "\t,\32\n\r"); | ||
594 | count = sscanf(curr_ptr, "%d", &blackptcomp); | ||
595 | srcgtag->rgb_blackptcomp[gsSRC_GRAPPRO] = | ||
596 | blackptcomp | gsBP_OVERRIDE; | ||
576 | break; | 597 | break; |
577 | case IMAGE_RGB: | 598 | case IMAGE_RGB: |
578 | srcgtag->rgb_profiles[gsSRC_IMAGPRO] = icc_profile; | 599 | srcgtag->rgb_profiles[gsSRC_IMAGPRO] = icc_profile; |
@@ -580,6 +601,11 @@ gsicc_set_srcgtag_struct(gsicc_manager_t *icc_manager, const char* pname, | |||
580 | curr_ptr = strtok(NULL, "\t,\32\n\r"); | 601 | curr_ptr = strtok(NULL, "\t,\32\n\r"); |
581 | count = sscanf(curr_ptr, "%d", &ri); | 602 | count = sscanf(curr_ptr, "%d", &ri); |
582 | srcgtag->rgb_intent[gsSRC_IMAGPRO] = ri | gsRI_OVERRIDE; | 603 | srcgtag->rgb_intent[gsSRC_IMAGPRO] = ri | gsRI_OVERRIDE; |
604 | /* Get the black point compensation setting */ | ||
605 | curr_ptr = strtok(NULL, "\t,\32\n\r"); | ||
606 | count = sscanf(curr_ptr, "%d", &blackptcomp); | ||
607 | srcgtag->rgb_blackptcomp[gsSRC_IMAGPRO] = | ||
608 | blackptcomp | gsBP_OVERRIDE; | ||
583 | break; | 609 | break; |
584 | case TEXT_RGB: | 610 | case TEXT_RGB: |
585 | srcgtag->rgb_profiles[gsSRC_TEXTPRO] = icc_profile; | 611 | srcgtag->rgb_profiles[gsSRC_TEXTPRO] = icc_profile; |
@@ -587,6 +613,11 @@ gsicc_set_srcgtag_struct(gsicc_manager_t *icc_manager, const char* pname, | |||
587 | curr_ptr = strtok(NULL, "\t,\32\n\r"); | 613 | curr_ptr = strtok(NULL, "\t,\32\n\r"); |
588 | count = sscanf(curr_ptr, "%d", &ri); | 614 | count = sscanf(curr_ptr, "%d", &ri); |
589 | srcgtag->rgb_intent[gsSRC_TEXTPRO] = ri | gsRI_OVERRIDE; | 615 | srcgtag->rgb_intent[gsSRC_TEXTPRO] = ri | gsRI_OVERRIDE; |
616 | /* Get the black point compensation setting */ | ||
617 | curr_ptr = strtok(NULL, "\t,\32\n\r"); | ||
618 | count = sscanf(curr_ptr, "%d", &blackptcomp); | ||
619 | srcgtag->rgb_blackptcomp[gsSRC_TEXTPRO] = | ||
620 | blackptcomp | gsBP_OVERRIDE; | ||
590 | break; | 621 | break; |
591 | case GSICC_NUM_SRCGTAG_KEYS: | 622 | case GSICC_NUM_SRCGTAG_KEYS: |
592 | /* Failed to match the key */ | 623 | /* Failed to match the key */ |
@@ -1081,6 +1112,7 @@ gsicc_new_device_profile_array(gs_memory_t *memory) | |||
1081 | for (k = 0; k < NUM_DEVICE_PROFILES; k++) { | 1112 | for (k = 0; k < NUM_DEVICE_PROFILES; k++) { |
1082 | result->device_profile[k] = NULL; | 1113 | result->device_profile[k] = NULL; |
1083 | result->intent[k] = gsPERCEPTUAL; | 1114 | result->intent[k] = gsPERCEPTUAL; |
1115 | result->blackptcomp[k] = gsBLACKPTCOMP_ON; | ||
1084 | } | 1116 | } |
1085 | result->proof_profile = NULL; | 1117 | result->proof_profile = NULL; |
1086 | result->link_profile = NULL; | 1118 | result->link_profile = NULL; |
@@ -1095,7 +1127,7 @@ gsicc_new_device_profile_array(gs_memory_t *memory) | |||
1095 | } | 1127 | } |
1096 | 1128 | ||
1097 | int | 1129 | int |
1098 | gsicc_set_device_profile_intent(gx_device *dev, gsicc_profile_types_t intent, | 1130 | gsicc_set_device_profile_intent(gx_device *dev, gsicc_rendering_intents_t intent, |
1099 | gsicc_profile_types_t profile_type) | 1131 | gsicc_profile_types_t profile_type) |
1100 | { | 1132 | { |
1101 | int code; | 1133 | int code; |
@@ -1112,6 +1144,24 @@ gsicc_set_device_profile_intent(gx_device *dev, gsicc_profile_types_t intent, | |||
1112 | return 0; | 1144 | return 0; |
1113 | } | 1145 | } |
1114 | 1146 | ||
1147 | int | ||
1148 | gsicc_set_device_blackptcomp(gx_device *dev, gsicc_blackptcomp_t blackptcomp, | ||
1149 | gsicc_profile_types_t profile_type) | ||
1150 | { | ||
1151 | int code; | ||
1152 | cmm_dev_profile_t *profile_struct; | ||
1153 | |||
1154 | if (dev->procs.get_profile == NULL) { | ||
1155 | profile_struct = dev->icc_struct; | ||
1156 | } else { | ||
1157 | code = dev_proc(dev, get_profile)(dev, &profile_struct); | ||
1158 | } | ||
1159 | if (profile_struct == NULL) | ||
1160 | return 0; | ||
1161 | profile_struct->blackptcomp[profile_type] = blackptcomp; | ||
1162 | return 0; | ||
1163 | } | ||
1164 | |||
1115 | /* This is used to set up the equivalent cmyk colors for the spots that may | 1165 | /* This is used to set up the equivalent cmyk colors for the spots that may |
1116 | exist in an output DeviceN profile. We do this by faking a new separation | 1166 | exist in an output DeviceN profile. We do this by faking a new separation |
1117 | space for each one */ | 1167 | space for each one */ |
@@ -2067,7 +2117,8 @@ gsicc_get_srcprofile(gsicc_colorbuffer_t data_cs, | |||
2067 | gs_graphics_type_tag_t graphics_type_tag, | 2117 | gs_graphics_type_tag_t graphics_type_tag, |
2068 | cmm_srcgtag_profile_t *srcgtag_profile, | 2118 | cmm_srcgtag_profile_t *srcgtag_profile, |
2069 | cmm_profile_t **profile, | 2119 | cmm_profile_t **profile, |
2070 | gsicc_rendering_intents_t *rendering_intent) | 2120 | gsicc_rendering_intents_t *rendering_intent, |
2121 | gsicc_blackptcomp_t *blackptcomp) | ||
2071 | { | 2122 | { |
2072 | (*profile) = NULL; | 2123 | (*profile) = NULL; |
2073 | *rendering_intent = gsPERCEPTUAL; | 2124 | *rendering_intent = gsPERCEPTUAL; |
@@ -2080,27 +2131,33 @@ gsicc_get_srcprofile(gsicc_colorbuffer_t data_cs, | |||
2080 | if (data_cs == gsRGB) { | 2131 | if (data_cs == gsRGB) { |
2081 | (*profile) = srcgtag_profile->rgb_profiles[gsSRC_GRAPPRO]; | 2132 | (*profile) = srcgtag_profile->rgb_profiles[gsSRC_GRAPPRO]; |
2082 | *rendering_intent = srcgtag_profile->rgb_intent[gsSRC_GRAPPRO]; | 2133 | *rendering_intent = srcgtag_profile->rgb_intent[gsSRC_GRAPPRO]; |
2134 | *blackptcomp = srcgtag_profile->rgb_blackptcomp[gsSRC_GRAPPRO]; | ||
2083 | } else if (data_cs == gsCMYK) { | 2135 | } else if (data_cs == gsCMYK) { |
2084 | (*profile) = srcgtag_profile->cmyk_profiles[gsSRC_GRAPPRO]; | 2136 | (*profile) = srcgtag_profile->cmyk_profiles[gsSRC_GRAPPRO]; |
2085 | *rendering_intent = srcgtag_profile->cmyk_intent[gsSRC_GRAPPRO]; | 2137 | *rendering_intent = srcgtag_profile->cmyk_intent[gsSRC_GRAPPRO]; |
2138 | *blackptcomp = srcgtag_profile->cmyk_blackptcomp[gsSRC_GRAPPRO]; | ||
2086 | } | 2139 | } |
2087 | break; | 2140 | break; |
2088 | case GS_IMAGE_TAG: | 2141 | case GS_IMAGE_TAG: |
2089 | if (data_cs == gsRGB) { | 2142 | if (data_cs == gsRGB) { |
2090 | (*profile) = srcgtag_profile->rgb_profiles[gsSRC_IMAGPRO]; | 2143 | (*profile) = srcgtag_profile->rgb_profiles[gsSRC_IMAGPRO]; |
2091 | *rendering_intent = srcgtag_profile->rgb_intent[gsSRC_IMAGPRO]; | 2144 | *rendering_intent = srcgtag_profile->rgb_intent[gsSRC_IMAGPRO]; |
2145 | *blackptcomp = srcgtag_profile->rgb_blackptcomp[gsSRC_IMAGPRO]; | ||
2092 | } else if (data_cs == gsCMYK) { | 2146 | } else if (data_cs == gsCMYK) { |
2093 | (*profile) = srcgtag_profile->cmyk_profiles[gsSRC_IMAGPRO]; | 2147 | (*profile) = srcgtag_profile->cmyk_profiles[gsSRC_IMAGPRO]; |
2094 | *rendering_intent = srcgtag_profile->cmyk_intent[gsSRC_IMAGPRO]; | 2148 | *rendering_intent = srcgtag_profile->cmyk_intent[gsSRC_IMAGPRO]; |
2149 | *blackptcomp = srcgtag_profile->cmyk_blackptcomp[gsSRC_IMAGPRO]; | ||
2095 | } | 2150 | } |
2096 | break; | 2151 | break; |
2097 | case GS_TEXT_TAG: | 2152 | case GS_TEXT_TAG: |
2098 | if (data_cs == gsRGB) { | 2153 | if (data_cs == gsRGB) { |
2099 | (*profile) = srcgtag_profile->rgb_profiles[gsSRC_TEXTPRO]; | 2154 | (*profile) = srcgtag_profile->rgb_profiles[gsSRC_TEXTPRO]; |
2100 | *rendering_intent = srcgtag_profile->rgb_intent[gsSRC_TEXTPRO]; | 2155 | *rendering_intent = srcgtag_profile->rgb_intent[gsSRC_TEXTPRO]; |
2156 | *blackptcomp = srcgtag_profile->rgb_blackptcomp[gsSRC_TEXTPRO]; | ||
2101 | } else if (data_cs == gsCMYK) { | 2157 | } else if (data_cs == gsCMYK) { |
2102 | (*profile) = srcgtag_profile->cmyk_profiles[gsSRC_TEXTPRO]; | 2158 | (*profile) = srcgtag_profile->cmyk_profiles[gsSRC_TEXTPRO]; |
2103 | *rendering_intent = srcgtag_profile->cmyk_intent[gsSRC_TEXTPRO]; | 2159 | *rendering_intent = srcgtag_profile->cmyk_intent[gsSRC_TEXTPRO]; |
2160 | *blackptcomp = srcgtag_profile->cmyk_blackptcomp[gsSRC_TEXTPRO]; | ||
2104 | } | 2161 | } |
2105 | break; | 2162 | break; |
2106 | } | 2163 | } |
@@ -2110,7 +2167,8 @@ void | |||
2110 | gsicc_extract_profile(gs_graphics_type_tag_t graphics_type_tag, | 2167 | gsicc_extract_profile(gs_graphics_type_tag_t graphics_type_tag, |
2111 | cmm_dev_profile_t *profile_struct, | 2168 | cmm_dev_profile_t *profile_struct, |
2112 | cmm_profile_t **profile, | 2169 | cmm_profile_t **profile, |
2113 | gsicc_rendering_intents_t *rendering_intent) | 2170 | gsicc_rendering_intents_t *rendering_intent, |
2171 | gsicc_blackptcomp_t *blackptcomp) | ||
2114 | { | 2172 | { |
2115 | switch (graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS) { | 2173 | switch (graphics_type_tag & ~GS_DEVICE_ENCODES_TAGS) { |
2116 | case GS_UNKNOWN_TAG: | 2174 | case GS_UNKNOWN_TAG: |
@@ -2118,32 +2176,39 @@ gsicc_extract_profile(gs_graphics_type_tag_t graphics_type_tag, | |||
2118 | default: | 2176 | default: |
2119 | (*profile) = profile_struct->device_profile[0]; | 2177 | (*profile) = profile_struct->device_profile[0]; |
2120 | *rendering_intent = profile_struct->intent[0]; | 2178 | *rendering_intent = profile_struct->intent[0]; |
2179 | *blackptcomp = profile_struct->blackptcomp[0]; | ||
2121 | break; | 2180 | break; |
2122 | case GS_PATH_TAG: | 2181 | case GS_PATH_TAG: |
2123 | if (profile_struct->device_profile[1] != NULL) { | 2182 | if (profile_struct->device_profile[1] != NULL) { |
2124 | (*profile) = profile_struct->device_profile[1]; | 2183 | (*profile) = profile_struct->device_profile[1]; |
2125 | *rendering_intent = profile_struct->intent[1]; | 2184 | *rendering_intent = profile_struct->intent[1]; |
2185 | *blackptcomp = profile_struct->blackptcomp[1]; | ||
2126 | } else { | 2186 | } else { |
2127 | (*profile) = profile_struct->device_profile[0]; | 2187 | (*profile) = profile_struct->device_profile[0]; |
2128 | *rendering_intent = profile_struct->intent[0]; | 2188 | *rendering_intent = profile_struct->intent[1]; |
2189 | *blackptcomp = profile_struct->blackptcomp[1]; | ||
2129 | } | 2190 | } |
2130 | break; | 2191 | break; |
2131 | case GS_IMAGE_TAG: | 2192 | case GS_IMAGE_TAG: |
2132 | if (profile_struct->device_profile[2] != NULL) { | 2193 | if (profile_struct->device_profile[2] != NULL) { |
2133 | (*profile) = profile_struct->device_profile[2]; | 2194 | (*profile) = profile_struct->device_profile[2]; |
2134 | *rendering_intent = profile_struct->intent[2]; | 2195 | *rendering_intent = profile_struct->intent[2]; |
2196 | *blackptcomp = profile_struct->blackptcomp[2]; | ||
2135 | } else { | 2197 | } else { |
2136 | (*profile) = profile_struct->device_profile[0]; | 2198 | (*profile) = profile_struct->device_profile[0]; |
2137 | *rendering_intent = profile_struct->intent[0]; | 2199 | *rendering_intent = profile_struct->intent[2]; |
2200 | *blackptcomp = profile_struct->blackptcomp[2]; | ||
2138 | } | 2201 | } |
2139 | break; | 2202 | break; |
2140 | case GS_TEXT_TAG: | 2203 | case GS_TEXT_TAG: |
2141 | if (profile_struct->device_profile[3] != NULL) { | 2204 | if (profile_struct->device_profile[3] != NULL) { |
2142 | (*profile) = profile_struct->device_profile[3]; | 2205 | (*profile) = profile_struct->device_profile[3]; |
2143 | *rendering_intent = profile_struct->intent[3]; | 2206 | *rendering_intent = profile_struct->intent[3]; |
2207 | *blackptcomp = profile_struct->blackptcomp[3]; | ||
2144 | } else { | 2208 | } else { |
2145 | (*profile) = profile_struct->device_profile[0]; | 2209 | (*profile) = profile_struct->device_profile[0]; |
2146 | *rendering_intent = profile_struct->intent[0]; | 2210 | *rendering_intent = profile_struct->intent[3]; |
2211 | *blackptcomp = profile_struct->blackptcomp[3]; | ||
2147 | } | 2212 | } |
2148 | break; | 2213 | break; |
2149 | } | 2214 | } |
@@ -2182,7 +2247,22 @@ gs_currentoverride_ri(const gs_imager_state *pis) | |||
2182 | return false; | 2247 | return false; |
2183 | } | 2248 | } |
2184 | } | 2249 | } |
2185 | 2250 | void | |
2251 | gs_setoverride_bp(gs_imager_state *pis, bool value) | ||
2252 | { | ||
2253 | if (pis->icc_manager != NULL) { | ||
2254 | pis->icc_manager->override_bp = value; | ||
2255 | } | ||
2256 | } | ||
2257 | bool | ||
2258 | gs_currentoverride_bp(const gs_imager_state *pis) | ||
2259 | { | ||
2260 | if (pis->icc_manager != NULL) { | ||
2261 | return pis->icc_manager->override_bp; | ||
2262 | } else { | ||
2263 | return false; | ||
2264 | } | ||
2265 | } | ||
2186 | void | 2266 | void |
2187 | gsicc_setrange_lab(cmm_profile_t *profile) | 2267 | gsicc_setrange_lab(cmm_profile_t *profile) |
2188 | { | 2268 | { |
diff --git a/gs/base/gsicc_manage.h b/gs/base/gsicc_manage.h index a7593b4b5..7ebb47ffb 100644 --- a/gs/base/gsicc_manage.h +++ b/gs/base/gsicc_manage.h | |||
@@ -43,8 +43,6 @@ | |||
43 | #define GSICC_STANDARD_PROFILES\ | 43 | #define GSICC_STANDARD_PROFILES\ |
44 | "srgb.icc", "sgray.icc" | 44 | "srgb.icc", "sgray.icc" |
45 | #define GSICC_NUMBER_STANDARD_PROFILES 2 | 45 | #define GSICC_NUMBER_STANDARD_PROFILES 2 |
46 | #define GSICC_STANDARD_INTENT_KEYS\ | ||
47 | "per", "col" , "sat", "abs" | ||
48 | /* This enumeration has to be in sync with GSICC_SRCGTAG_KEYS */ | 46 | /* This enumeration has to be in sync with GSICC_SRCGTAG_KEYS */ |
49 | typedef enum { | 47 | typedef enum { |
50 | COLOR_TUNE, | 48 | COLOR_TUNE, |
@@ -69,19 +67,25 @@ void gsicc_profile_reference(cmm_profile_t *icc_profile, int delta); | |||
69 | void gsicc_extract_profile(gs_graphics_type_tag_t graphics_type_tag, | 67 | void gsicc_extract_profile(gs_graphics_type_tag_t graphics_type_tag, |
70 | cmm_dev_profile_t *profile_struct, | 68 | cmm_dev_profile_t *profile_struct, |
71 | cmm_profile_t **profile, | 69 | cmm_profile_t **profile, |
72 | gsicc_rendering_intents_t *rendering_intent); | 70 | gsicc_rendering_intents_t *rendering_intent, |
71 | gsicc_blackptcomp_t *blackptcomp); | ||
73 | void gsicc_get_srcprofile(gsicc_colorbuffer_t data_cs, | 72 | void gsicc_get_srcprofile(gsicc_colorbuffer_t data_cs, |
74 | gs_graphics_type_tag_t graphics_type_tag, | 73 | gs_graphics_type_tag_t graphics_type_tag, |
75 | cmm_srcgtag_profile_t *srcgtag_profile, | 74 | cmm_srcgtag_profile_t *srcgtag_profile, |
76 | cmm_profile_t **profile, | 75 | cmm_profile_t **profile, |
77 | gsicc_rendering_intents_t *rendering_intent); | 76 | gsicc_rendering_intents_t *rendering_intent, |
77 | gsicc_blackptcomp_t *blackptcomp); | ||
78 | int gsicc_getsrc_channel_count(cmm_profile_t *icc_profile); | 78 | int gsicc_getsrc_channel_count(cmm_profile_t *icc_profile); |
79 | int gsicc_init_iccmanager(gs_state * pgs); | 79 | int gsicc_init_iccmanager(gs_state * pgs); |
80 | int gsicc_init_gs_colors(gs_state *pgs); | 80 | int gsicc_init_gs_colors(gs_state *pgs); |
81 | void gsicc_profile_serialize(gsicc_serialized_profile_t *profile_data, | 81 | void gsicc_profile_serialize(gsicc_serialized_profile_t *profile_data, |
82 | cmm_profile_t *iccprofile); | 82 | cmm_profile_t *iccprofile); |
83 | int gsicc_set_device_profile_intent(gx_device *dev, gsicc_profile_types_t intent, | 83 | int gsicc_set_device_profile_intent(gx_device *dev, |
84 | gsicc_profile_types_t profile_type); | 84 | gsicc_rendering_intents_t intent, |
85 | gsicc_profile_types_t profile_type); | ||
86 | int gsicc_set_device_blackptcomp(gx_device *dev, | ||
87 | gsicc_blackptcomp_t blackptcomp, | ||
88 | gsicc_profile_types_t profile_type); | ||
85 | void gsicc_set_devicen_equiv_colors(gx_device *dev, const gs_imager_state * pis, | 89 | void gsicc_set_devicen_equiv_colors(gx_device *dev, const gs_imager_state * pis, |
86 | cmm_profile_t *profile); | 90 | cmm_profile_t *profile); |
87 | int gsicc_set_device_profile_colorants(gx_device *dev, char *name_str); | 91 | int gsicc_set_device_profile_colorants(gx_device *dev, char *name_str); |
@@ -121,6 +125,8 @@ void gs_setoverrideicc(gs_imager_state *pis, bool value); | |||
121 | bool gs_currentoverrideicc(const gs_imager_state *pis); | 125 | bool gs_currentoverrideicc(const gs_imager_state *pis); |
122 | void gs_setoverride_ri(gs_imager_state *pis, bool value); | 126 | void gs_setoverride_ri(gs_imager_state *pis, bool value); |
123 | bool gs_currentoverride_ri(const gs_imager_state *pis); | 127 | bool gs_currentoverride_ri(const gs_imager_state *pis); |
128 | void gs_setoverride_bp(gs_imager_state *pis, bool value); | ||
129 | bool gs_currentoverride_bp(const gs_imager_state *pis); | ||
124 | cmm_profile_t* gsicc_set_iccsmaskprofile(const char *pname, int namelen, | 130 | cmm_profile_t* gsicc_set_iccsmaskprofile(const char *pname, int namelen, |
125 | gsicc_manager_t *icc_manager, | 131 | gsicc_manager_t *icc_manager, |
126 | gs_memory_t *mem); | 132 | gs_memory_t *mem); |
diff --git a/gs/base/gsstate.c b/gs/base/gsstate.c index 3f519806c..516fc7016 100644 --- a/gs/base/gsstate.c +++ b/gs/base/gsstate.c | |||
@@ -751,6 +751,19 @@ gs_currentrenderingintent(const gs_state * pgs) | |||
751 | return pgs->renderingintent; | 751 | return pgs->renderingintent; |
752 | } | 752 | } |
753 | 753 | ||
754 | int | ||
755 | gs_setblackptcomp(gs_state *pgs, bool bkpt) { | ||
756 | pgs->blackptcomp = bkpt; | ||
757 | return 0; | ||
758 | } | ||
759 | |||
760 | /* currentrenderingintent */ | ||
761 | bool | ||
762 | gs_currentblackptcomp(const gs_state * pgs) | ||
763 | { | ||
764 | return pgs->blackptcomp; | ||
765 | } | ||
766 | |||
754 | /* | 767 | /* |
755 | * Reset most of the graphics state. | 768 | * Reset most of the graphics state. |
756 | * | 769 | * |
diff --git a/gs/base/gsstate.h b/gs/base/gsstate.h index 7f450ccdf..00ca92ab8 100644 --- a/gs/base/gsstate.h +++ b/gs/base/gsstate.h | |||
@@ -57,6 +57,9 @@ int gs_do_set_overprint(gs_state *); | |||
57 | int gs_currentrenderingintent(const gs_state *); | 57 | int gs_currentrenderingintent(const gs_state *); |
58 | int gs_setrenderingintent(gs_state *, int); | 58 | int gs_setrenderingintent(gs_state *, int); |
59 | 59 | ||
60 | int gs_currentblackptcomp(const gs_state *); | ||
61 | int gs_setblackptcomp(gs_state *, int); | ||
62 | |||
60 | int gs_initgraphics(gs_state *); | 63 | int gs_initgraphics(gs_state *); |
61 | 64 | ||
62 | bool gs_currentcpsimode(const gs_memory_t *); | 65 | bool gs_currentcpsimode(const gs_memory_t *); |
diff --git a/gs/base/gstrans.c b/gs/base/gstrans.c index 3a7e279cc..ac5873e44 100644 --- a/gs/base/gstrans.c +++ b/gs/base/gstrans.c | |||
@@ -728,12 +728,13 @@ gs_push_pdf14trans_device(gs_state * pgs, bool is_pattern) | |||
728 | gs_pdf14trans_params_t params = { 0 }; | 728 | gs_pdf14trans_params_t params = { 0 }; |
729 | cmm_profile_t *icc_profile; | 729 | cmm_profile_t *icc_profile; |
730 | gsicc_rendering_intents_t rendering_intent; | 730 | gsicc_rendering_intents_t rendering_intent; |
731 | gsicc_blackptcomp_t blackptcomp; | ||
731 | int code; | 732 | int code; |
732 | cmm_dev_profile_t *dev_profile; | 733 | cmm_dev_profile_t *dev_profile; |
733 | 734 | ||
734 | code = dev_proc(pgs->device, get_profile)(pgs->device, &dev_profile); | 735 | code = dev_proc(pgs->device, get_profile)(pgs->device, &dev_profile); |
735 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile, | 736 | gsicc_extract_profile(GS_UNKNOWN_TAG, dev_profile, &icc_profile, |
736 | &rendering_intent); | 737 | &rendering_intent, &blackptcomp); |
737 | 738 | ||
738 | params.pdf14_op = PDF14_PUSH_DEVICE; | 739 | params.pdf14_op = PDF14_PUSH_DEVICE; |
739 | /* | 740 | /* |
diff --git a/gs/base/gxclimag.c b/gs/base/gxclimag.c index 3eb7fcfc8..1e4bf5e85 100644 --- a/gs/base/gxclimag.c +++ b/gs/base/gxclimag.c | |||
@@ -361,8 +361,10 @@ clist_begin_typed_image(gx_device * dev, | |||
361 | cmm_profile_t *src_profile; | 361 | cmm_profile_t *src_profile; |
362 | cmm_srcgtag_profile_t *srcgtag_profile; | 362 | cmm_srcgtag_profile_t *srcgtag_profile; |
363 | gsicc_rendering_intents_t renderingintent = pis->renderingintent; | 363 | gsicc_rendering_intents_t renderingintent = pis->renderingintent; |
364 | gsicc_blackptcomp_t blackptcomp = pis->blackptcomp; | ||
364 | gs_imager_state *pis_nonconst = (gs_imager_state*) pis; | 365 | gs_imager_state *pis_nonconst = (gs_imager_state*) pis; |
365 | bool intent_changed = false; | 366 | bool intent_changed = false; |
367 | bool bp_changed = false; | ||
366 | cmm_dev_profile_t *dev_profile = NULL; | 368 | cmm_dev_profile_t *dev_profile = NULL; |
367 | cmm_profile_t *gs_output_profile; | 369 | cmm_profile_t *gs_output_profile; |
368 | bool is_planar_dev = dev_proc(dev, dev_spec_op)(dev, gxdso_is_native_planar, NULL, 0); | 370 | bool is_planar_dev = dev_proc(dev, dev_spec_op)(dev, gxdso_is_native_planar, NULL, 0); |
@@ -514,6 +516,8 @@ clist_begin_typed_image(gx_device * dev, | |||
514 | srcgtag_profile->rgb_profiles[gsSRC_IMAGPRO]; | 516 | srcgtag_profile->rgb_profiles[gsSRC_IMAGPRO]; |
515 | pis_nonconst->renderingintent = | 517 | pis_nonconst->renderingintent = |
516 | srcgtag_profile->rgb_intent[gsSRC_IMAGPRO]; | 518 | srcgtag_profile->rgb_intent[gsSRC_IMAGPRO]; |
519 | pis_nonconst->blackptcomp = | ||
520 | srcgtag_profile->rgb_blackptcomp[gsSRC_IMAGPRO]; | ||
517 | } | 521 | } |
518 | } else if (src_profile->data_cs == gsCMYK) { | 522 | } else if (src_profile->data_cs == gsCMYK) { |
519 | if (srcgtag_profile->cmyk_profiles[gsSRC_IMAGPRO] != NULL) { | 523 | if (srcgtag_profile->cmyk_profiles[gsSRC_IMAGPRO] != NULL) { |
@@ -521,6 +525,8 @@ clist_begin_typed_image(gx_device * dev, | |||
521 | srcgtag_profile->cmyk_profiles[gsSRC_IMAGPRO]; | 525 | srcgtag_profile->cmyk_profiles[gsSRC_IMAGPRO]; |
522 | pis_nonconst->renderingintent = | 526 | pis_nonconst->renderingintent = |
523 | srcgtag_profile->cmyk_intent[gsSRC_IMAGPRO]; | 527 | srcgtag_profile->cmyk_intent[gsSRC_IMAGPRO]; |
528 | pis_nonconst->blackptcomp = | ||
529 | srcgtag_profile->cmyk_blackptcomp[gsSRC_IMAGPRO]; | ||
524 | } | 530 | } |
525 | } | 531 | } |
526 | } | 532 | } |
@@ -531,15 +537,36 @@ clist_begin_typed_image(gx_device * dev, | |||
531 | if (!(pis_nonconst->renderingintent & gsRI_OVERRIDE)) { | 537 | if (!(pis_nonconst->renderingintent & gsRI_OVERRIDE)) { |
532 | if (pis->icc_manager != NULL && | 538 | if (pis->icc_manager != NULL && |
533 | pis->icc_manager->override_ri == true) { | 539 | pis->icc_manager->override_ri == true) { |
540 | gsicc_blackptcomp_t temp_blackpt; | ||
534 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 541 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
535 | gsicc_extract_profile(dev->graphics_type_tag, dev_profile, | 542 | gsicc_extract_profile(dev->graphics_type_tag, dev_profile, |
536 | &(gs_output_profile), | 543 | &(gs_output_profile), |
537 | (gsicc_rendering_intents_t *)\ | 544 | (gsicc_rendering_intents_t *)\ |
538 | (&(pis_nonconst->renderingintent))); | 545 | (&(pis_nonconst->renderingintent)), |
546 | (gsicc_blackptcomp_t *)\ | ||
547 | (&(temp_blackpt))); | ||
548 | } | ||
549 | } | ||
550 | /* We have a similar issue to deal with with respect to the | ||
551 | black point. Keeping rendering intent and bp comp | ||
552 | disentangled. */ | ||
553 | if (!(pis_nonconst->blackptcomp & gsBP_OVERRIDE)) { | ||
554 | if (pis->icc_manager != NULL && | ||
555 | pis->icc_manager->override_bp == true) { | ||
556 | gsicc_rendering_intents_t temp_ri; | ||
557 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | ||
558 | gsicc_extract_profile(dev->graphics_type_tag, dev_profile, | ||
559 | &(gs_output_profile), | ||
560 | (gsicc_rendering_intents_t *)\ | ||
561 | (&(temp_ri)), | ||
562 | (gsicc_blackptcomp_t *)\ | ||
563 | (&(pis_nonconst->blackptcomp))); | ||
539 | } | 564 | } |
540 | } | 565 | } |
541 | if (renderingintent != pis_nonconst->renderingintent) | 566 | if (renderingintent != pis_nonconst->renderingintent) |
542 | intent_changed = true; | 567 | intent_changed = true; |
568 | if (blackptcomp != pis_nonconst->blackptcomp) | ||
569 | bp_changed = true; | ||
543 | if (!(src_profile->hash_is_valid)) { | 570 | if (!(src_profile->hash_is_valid)) { |
544 | int64_t hash; | 571 | int64_t hash; |
545 | gsicc_get_icc_buff_hash(src_profile->buffer, &hash, | 572 | gsicc_get_icc_buff_hash(src_profile->buffer, &hash, |
@@ -592,10 +619,11 @@ clist_begin_typed_image(gx_device * dev, | |||
592 | question is penum->image_parent_type == gs_image_type1 */ | 619 | question is penum->image_parent_type == gs_image_type1 */ |
593 | if (dev_profile == NULL) { | 620 | if (dev_profile == NULL) { |
594 | gsicc_rendering_intents_t temp_intent; | 621 | gsicc_rendering_intents_t temp_intent; |
622 | gsicc_blackptcomp_t temp_bp; | ||
595 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 623 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
596 | gsicc_extract_profile(dev->graphics_type_tag, dev_profile, | 624 | gsicc_extract_profile(dev->graphics_type_tag, dev_profile, |
597 | &(gs_output_profile), | 625 | &(gs_output_profile), |
598 | &(temp_intent)); | 626 | &(temp_intent), &(temp_bp)); |
599 | } | 627 | } |
600 | if (gx_device_must_halftone(dev) && pim->BitsPerComponent == 8 && !masked && | 628 | if (gx_device_must_halftone(dev) && pim->BitsPerComponent == 8 && !masked && |
601 | (dev->color_info.num_components == 1 || is_planar_dev) && | 629 | (dev->color_info.num_components == 1 || is_planar_dev) && |
@@ -686,6 +714,8 @@ clist_begin_typed_image(gx_device * dev, | |||
686 | on the pis here for this and reset back */ | 714 | on the pis here for this and reset back */ |
687 | if (intent_changed) | 715 | if (intent_changed) |
688 | pis_nonconst->renderingintent = renderingintent; | 716 | pis_nonconst->renderingintent = renderingintent; |
717 | if (bp_changed) | ||
718 | pis_nonconst->blackptcomp = blackptcomp; | ||
689 | 719 | ||
690 | cdev->image_enum_id = pie->id; | 720 | cdev->image_enum_id = pie->id; |
691 | return 0; | 721 | return 0; |
diff --git a/gs/base/gxcmap.c b/gs/base/gxcmap.c index 5ae9b22be..0a873f9ee 100644 --- a/gs/base/gxcmap.c +++ b/gs/base/gxcmap.c | |||
@@ -1182,6 +1182,7 @@ cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_state * | |||
1182 | gx_color_index color; | 1182 | gx_color_index color; |
1183 | bool use_rgb2dev_icc = false; | 1183 | bool use_rgb2dev_icc = false; |
1184 | gsicc_rendering_intents_t rendering_intent; | 1184 | gsicc_rendering_intents_t rendering_intent; |
1185 | gsicc_blackptcomp_t blackptcomp; | ||
1185 | int code; | 1186 | int code; |
1186 | cmm_dev_profile_t *dev_profile = NULL; | 1187 | cmm_dev_profile_t *dev_profile = NULL; |
1187 | cmm_profile_t *des_profile = NULL; | 1188 | cmm_profile_t *des_profile = NULL; |
@@ -1189,7 +1190,7 @@ cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_state * | |||
1189 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 1190 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
1190 | gsicc_extract_profile(dev->graphics_type_tag, | 1191 | gsicc_extract_profile(dev->graphics_type_tag, |
1191 | dev_profile, &des_profile, | 1192 | dev_profile, &des_profile, |
1192 | &rendering_intent); | 1193 | &rendering_intent, &blackptcomp); |
1193 | for (i=0; i < ncomps; i++) | 1194 | for (i=0; i < ncomps; i++) |
1194 | cm_comps[i] = 0; | 1195 | cm_comps[i] = 0; |
1195 | if (pis->color_component_map.sep_type == SEP_ALL) { | 1196 | if (pis->color_component_map.sep_type == SEP_ALL) { |
@@ -1236,7 +1237,7 @@ cmap_separation_direct(frac all, gx_device_color * pdc, const gs_imager_state * | |||
1236 | gsicc_rendering_param_t rendering_params; | 1237 | gsicc_rendering_param_t rendering_params; |
1237 | unsigned short psrc[GS_CLIENT_COLOR_MAX_COMPONENTS], psrc_cm[GS_CLIENT_COLOR_MAX_COMPONENTS]; | 1238 | unsigned short psrc[GS_CLIENT_COLOR_MAX_COMPONENTS], psrc_cm[GS_CLIENT_COLOR_MAX_COMPONENTS]; |
1238 | 1239 | ||
1239 | rendering_params.black_point_comp = BP_ON; | 1240 | rendering_params.black_point_comp = pis->blackptcomp; |
1240 | rendering_params.graphics_type_tag = GS_PATH_TAG; | 1241 | rendering_params.graphics_type_tag = GS_PATH_TAG; |
1241 | rendering_params.rendering_intent = pis->renderingintent; | 1242 | rendering_params.rendering_intent = pis->renderingintent; |
1242 | 1243 | ||
@@ -1300,6 +1301,7 @@ devicen_icc_cmyk(frac cm_comps[], const gs_imager_state * pis, gx_device *dev) | |||
1300 | int k; | 1301 | int k; |
1301 | unsigned short *psrc_temp; | 1302 | unsigned short *psrc_temp; |
1302 | gsicc_rendering_intents_t rendering_intent; | 1303 | gsicc_rendering_intents_t rendering_intent; |
1304 | gsicc_blackptcomp_t blackptcomp; | ||
1303 | int code; | 1305 | int code; |
1304 | cmm_dev_profile_t *dev_profile = NULL; | 1306 | cmm_dev_profile_t *dev_profile = NULL; |
1305 | cmm_profile_t *des_profile = NULL; | 1307 | cmm_profile_t *des_profile = NULL; |
@@ -1307,9 +1309,9 @@ devicen_icc_cmyk(frac cm_comps[], const gs_imager_state * pis, gx_device *dev) | |||
1307 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 1309 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
1308 | gsicc_extract_profile(dev->graphics_type_tag, | 1310 | gsicc_extract_profile(dev->graphics_type_tag, |
1309 | dev_profile, &des_profile, | 1311 | dev_profile, &des_profile, |
1310 | &rendering_intent); | 1312 | &rendering_intent, &blackptcomp); |
1311 | /* Define the rendering intents. */ | 1313 | /* Define the rendering intents. */ |
1312 | rendering_params.black_point_comp = BP_ON; | 1314 | rendering_params.black_point_comp = pis->blackptcomp; |
1313 | rendering_params.graphics_type_tag = GS_PATH_TAG; | 1315 | rendering_params.graphics_type_tag = GS_PATH_TAG; |
1314 | rendering_params.rendering_intent = pis->renderingintent; | 1316 | rendering_params.rendering_intent = pis->renderingintent; |
1315 | /* Sigh, frac to full 16 bit. Need to clean this up */ | 1317 | /* Sigh, frac to full 16 bit. Need to clean this up */ |
@@ -1351,13 +1353,14 @@ cmap_devicen_halftoned(const frac * pcc, | |||
1351 | frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS]; | 1353 | frac cm_comps[GX_DEVICE_COLOR_MAX_COMPONENTS]; |
1352 | int code; | 1354 | int code; |
1353 | gsicc_rendering_intents_t rendering_intent; | 1355 | gsicc_rendering_intents_t rendering_intent; |
1356 | gsicc_blackptcomp_t blackptcomp; | ||
1354 | cmm_dev_profile_t *dev_profile = NULL; | 1357 | cmm_dev_profile_t *dev_profile = NULL; |
1355 | cmm_profile_t *des_profile = NULL; | 1358 | cmm_profile_t *des_profile = NULL; |
1356 | 1359 | ||
1357 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 1360 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
1358 | gsicc_extract_profile(dev->graphics_type_tag, | 1361 | gsicc_extract_profile(dev->graphics_type_tag, |
1359 | dev_profile, &des_profile, | 1362 | dev_profile, &des_profile, |
1360 | &rendering_intent); | 1363 | &rendering_intent, &blackptcomp); |
1361 | /* map to the color model */ | 1364 | /* map to the color model */ |
1362 | for (i=0; i < ncomps; i++) | 1365 | for (i=0; i < ncomps; i++) |
1363 | cm_comps[i] = 0; | 1366 | cm_comps[i] = 0; |
@@ -1398,13 +1401,15 @@ cmap_devicen_direct(const frac * pcc, | |||
1398 | gx_color_index color; | 1401 | gx_color_index color; |
1399 | int code; | 1402 | int code; |
1400 | gsicc_rendering_intents_t rendering_intent; | 1403 | gsicc_rendering_intents_t rendering_intent; |
1404 | gsicc_blackptcomp_t blackptcomp; | ||
1405 | |||
1401 | cmm_dev_profile_t *dev_profile = NULL; | 1406 | cmm_dev_profile_t *dev_profile = NULL; |
1402 | cmm_profile_t *des_profile = NULL; | 1407 | cmm_profile_t *des_profile = NULL; |
1403 | 1408 | ||
1404 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 1409 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
1405 | gsicc_extract_profile(dev->graphics_type_tag, | 1410 | gsicc_extract_profile(dev->graphics_type_tag, |
1406 | dev_profile, &des_profile, | 1411 | dev_profile, &des_profile, |
1407 | &rendering_intent); | 1412 | &rendering_intent, &blackptcomp); |
1408 | /* See the comment below */ | 1413 | /* See the comment below */ |
1409 | /* map to the color model */ | 1414 | /* map to the color model */ |
1410 | for (i=0; i < ncomps; i++) | 1415 | for (i=0; i < ncomps; i++) |
@@ -1979,6 +1984,7 @@ gx_device_uses_std_cmap_procs(gx_device * dev, const gs_imager_state * pis) | |||
1979 | { | 1984 | { |
1980 | const gx_cm_color_map_procs *pprocs; | 1985 | const gx_cm_color_map_procs *pprocs; |
1981 | gsicc_rendering_intents_t rendering_intent; | 1986 | gsicc_rendering_intents_t rendering_intent; |
1987 | gsicc_blackptcomp_t blackptcomp; | ||
1982 | int code; | 1988 | int code; |
1983 | cmm_dev_profile_t *dev_profile = NULL; | 1989 | cmm_dev_profile_t *dev_profile = NULL; |
1984 | cmm_profile_t *des_profile = NULL; | 1990 | cmm_profile_t *des_profile = NULL; |
@@ -1986,7 +1992,7 @@ gx_device_uses_std_cmap_procs(gx_device * dev, const gs_imager_state * pis) | |||
1986 | code = dev_proc(dev, get_profile)(dev, &dev_profile); | 1992 | code = dev_proc(dev, get_profile)(dev, &dev_profile); |
1987 | gsicc_extract_profile(dev->graphics_type_tag, | 1993 | gsicc_extract_profile(dev->graphics_type_tag, |
1988 | dev_profile, &des_profile, | 1994 | dev_profile, &des_profile, |
1989 | &rendering_intent); | 1995 | &rendering_intent, &blackptcomp); |
1990 | 1996 | ||
1991 | if (des_profile != NULL) { | 1997 | if (des_profile != NULL) { |
1992 | pprocs = dev_proc(dev, get_color_mapping_procs)(dev); | 1998 | pprocs = dev_proc(dev, get_color_mapping_procs)(dev); |
diff --git a/gs/base/gxi12bit.c b/gs/base/gxi12bit.c index 6e560f793..b6ab27cad 100644 --- a/gs/base/gxi12bit.c +++ b/gs/base/gxi12bit.c | |||
@@ -158,7 +158,7 @@ gs_image_class_2_fracs(gx_image_enum * penum) | |||
158 | } | 158 | } |
159 | } | 159 | } |
160 | /* Define the rendering intents */ | 160 | /* Define the rendering intents */ |
161 | rendering_params.black_point_comp = BP_ON; | 161 | rendering_params.black_point_comp = penum->pis->blackptcomp; |
162 | rendering_params.graphics_type_tag = GS_IMAGE_TAG; | 162 | rendering_params.graphics_type_tag = GS_IMAGE_TAG; |
163 | rendering_params.rendering_intent = penum->pis->renderingintent; | 163 | rendering_params.rendering_intent = penum->pis->renderingintent; |
164 | if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) { | 164 | if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) { |
diff --git a/gs/base/gxicolor.c b/gs/base/gxicolor.c index 2162603e0..fa47c120a 100644 --- a/gs/base/gxicolor.c +++ b/gs/base/gxicolor.c | |||
@@ -133,7 +133,7 @@ gs_image_class_4_color(gx_image_enum * penum) | |||
133 | } | 133 | } |
134 | } | 134 | } |
135 | /* Define the rendering intents */ | 135 | /* Define the rendering intents */ |
136 | rendering_params.black_point_comp = BP_ON; | 136 | rendering_params.black_point_comp = penum->pis->blackptcomp; |
137 | rendering_params.graphics_type_tag = GS_IMAGE_TAG; | 137 | rendering_params.graphics_type_tag = GS_IMAGE_TAG; |
138 | rendering_params.rendering_intent = penum->pis->renderingintent; | 138 | rendering_params.rendering_intent = penum->pis->renderingintent; |
139 | if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) { | 139 | if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) { |
diff --git a/gs/base/gximono.c b/gs/base/gximono.c index ec696a23c..b8b39bc43 100644 --- a/gs/base/gximono.c +++ b/gs/base/gximono.c | |||
@@ -115,7 +115,7 @@ gs_image_class_3_mono(gx_image_enum * penum) | |||
115 | code = dev_proc(penum->dev, get_profile)(penum->dev, &dev_profile); | 115 | code = dev_proc(penum->dev, get_profile)(penum->dev, &dev_profile); |
116 | num_des_comps = gsicc_get_device_profile_comps(dev_profile); | 116 | num_des_comps = gsicc_get_device_profile_comps(dev_profile); |
117 | /* Define the rendering intents */ | 117 | /* Define the rendering intents */ |
118 | rendering_params.black_point_comp = BP_ON; | 118 | rendering_params.black_point_comp = penum->pis->blackptcomp; |
119 | rendering_params.graphics_type_tag = GS_IMAGE_TAG; | 119 | rendering_params.graphics_type_tag = GS_IMAGE_TAG; |
120 | rendering_params.rendering_intent = penum->pis->renderingintent; | 120 | rendering_params.rendering_intent = penum->pis->renderingintent; |
121 | if (gs_color_space_get_index(penum->pcs) == | 121 | if (gs_color_space_get_index(penum->pcs) == |
diff --git a/gs/base/gxiscale.c b/gs/base/gxiscale.c index 77048966d..833742c27 100644 --- a/gs/base/gxiscale.c +++ b/gs/base/gxiscale.c | |||
@@ -336,7 +336,7 @@ gs_image_class_0_interpolate(gx_image_enum * penum) | |||
336 | } | 336 | } |
337 | } | 337 | } |
338 | /* Define the rendering intents */ | 338 | /* Define the rendering intents */ |
339 | rendering_params.black_point_comp = BP_ON; | 339 | rendering_params.black_point_comp = penum->pis->blackptcomp; |
340 | rendering_params.graphics_type_tag = GS_IMAGE_TAG; | 340 | rendering_params.graphics_type_tag = GS_IMAGE_TAG; |
341 | rendering_params.rendering_intent = penum->pis->renderingintent; | 341 | rendering_params.rendering_intent = penum->pis->renderingintent; |
342 | if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) { | 342 | if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) { |
diff --git a/gs/base/gxistate.h b/gs/base/gxistate.h index 886733534..d3e9c6e6d 100644 --- a/gs/base/gxistate.h +++ b/gs/base/gxistate.h | |||
@@ -272,6 +272,7 @@ typedef struct gs_xstate_trans_flags { | |||
272 | bool have_pattern_streams;\ | 272 | bool have_pattern_streams;\ |
273 | float smoothness;\ | 273 | float smoothness;\ |
274 | int renderingintent; /* See gsstate.c */\ | 274 | int renderingintent; /* See gsstate.c */\ |
275 | bool blackptcomp;\ | ||
275 | gsicc_manager_t *icc_manager; /* ICC color manager, profile */\ | 276 | gsicc_manager_t *icc_manager; /* ICC color manager, profile */\ |
276 | gsicc_link_cache_t *icc_link_cache; /* ICC linked transforms */\ | 277 | gsicc_link_cache_t *icc_link_cache; /* ICC linked transforms */\ |
277 | gsicc_profile_cache_t *icc_profile_cache; /* ICC profiles from PS. */\ | 278 | gsicc_profile_cache_t *icc_profile_cache; /* ICC profiles from PS. */\ |
@@ -308,7 +309,7 @@ struct gs_imager_state_s { | |||
308 | lop_default, gx_max_color_value, BLEND_MODE_Compatible,\ | 309 | lop_default, gx_max_color_value, BLEND_MODE_Compatible,\ |
309 | { 1.0 }, { 1.0 }, {0, 0}, 0, 0/*false*/, 0, 0, 0, 0/*false*/, 0, 0, 0/*false*/, 0, 0, 1.0, \ | 310 | { 1.0 }, { 1.0 }, {0, 0}, 0, 0/*false*/, 0, 0, 0, 0/*false*/, 0, 0, 0/*false*/, 0, 0, 1.0, \ |
310 | { fixed_half, fixed_half }, 0/*false*/, 0/*false*/, 0/*false*/, 1.0,\ | 311 | { fixed_half, fixed_half }, 0/*false*/, 0/*false*/, 0/*false*/, 1.0,\ |
311 | 1, 0, 0, 0, INIT_CUSTOM_COLOR_PTR /* 'Custom color' callback pointer */ \ | 312 | 1, 1/* bpt true */, 0, 0, 0, INIT_CUSTOM_COLOR_PTR /* 'Custom color' callback pointer */ \ |
312 | gx_default_get_cmap_procs | 313 | gx_default_get_cmap_procs |
313 | 314 | ||
314 | /* The imager state structure is public only for subclassing. */ | 315 | /* The imager state structure is public only for subclassing. */ |
diff --git a/gs/base/gxshade.c b/gs/base/gxshade.c index cd5fd9c3f..42344180c 100644 --- a/gs/base/gxshade.c +++ b/gs/base/gxshade.c | |||
@@ -382,7 +382,7 @@ top: | |||
382 | if (gs_color_space_is_PSCIE(pcs) && pcs->icc_equivalent == NULL) { | 382 | if (gs_color_space_is_PSCIE(pcs) && pcs->icc_equivalent == NULL) { |
383 | gs_colorspace_set_icc_equivalent((gs_color_space *)pcs, &(is_lab), pis->memory); | 383 | gs_colorspace_set_icc_equivalent((gs_color_space *)pcs, &(is_lab), pis->memory); |
384 | } | 384 | } |
385 | rendering_params.black_point_comp = BP_ON; | 385 | rendering_params.black_point_comp = pis->blackptcomp; |
386 | rendering_params.graphics_type_tag = GS_PATH_TAG; | 386 | rendering_params.graphics_type_tag = GS_PATH_TAG; |
387 | rendering_params.rendering_intent = pis->renderingintent; | 387 | rendering_params.rendering_intent = pis->renderingintent; |
388 | /* Grab the icc link transform that we need now */ | 388 | /* Grab the icc link transform that we need now */ |
diff --git a/gs/psi/zcolor3.c b/gs/psi/zcolor3.c index 75a6b4549..a90d6e645 100644 --- a/gs/psi/zcolor3.c +++ b/gs/psi/zcolor3.c | |||
@@ -72,6 +72,31 @@ zsetrenderingintent(i_ctx_t * i_ctx_p) | |||
72 | return 0; | 72 | return 0; |
73 | } | 73 | } |
74 | 74 | ||
75 | /* - .currentblackptcomp <int> */ | ||
76 | static int | ||
77 | zcurrentblackptcomp(i_ctx_t *i_ctx_p) | ||
78 | { | ||
79 | os_ptr op = osp; | ||
80 | |||
81 | push(1); | ||
82 | make_int(op, gs_currentblackptcomp(igs)); | ||
83 | return 0; | ||
84 | } | ||
85 | |||
86 | /* <int> .setblackptcomp */ | ||
87 | static int | ||
88 | zsetblackptcomp(i_ctx_t * i_ctx_p) | ||
89 | { | ||
90 | os_ptr op = osp; | ||
91 | int param; | ||
92 | int code = int_param(op, max_int, ¶m); | ||
93 | |||
94 | if (code < 0 || (code = gs_setblackptcomp(igs, param)) < 0) | ||
95 | return code; | ||
96 | pop(1); | ||
97 | return 0; | ||
98 | } | ||
99 | |||
75 | /* | 100 | /* |
76 | * Initialization procedure | 101 | * Initialization procedure |
77 | */ | 102 | */ |
@@ -81,5 +106,7 @@ const op_def zcolor3_l3_op_defs[] = { | |||
81 | { "0.setuseciecolor", zsetuseciecolor }, | 106 | { "0.setuseciecolor", zsetuseciecolor }, |
82 | { "0.currentrenderintent", zcurrentrenderingintent }, | 107 | { "0.currentrenderintent", zcurrentrenderingintent }, |
83 | { "1.setrenderingintent", zsetrenderingintent }, | 108 | { "1.setrenderingintent", zsetrenderingintent }, |
109 | { "2.currentblackptcomp", zcurrentblackptcomp }, | ||
110 | { "3.setblackptcomp", zsetblackptcomp }, | ||
84 | op_def_end(0) | 111 | op_def_end(0) |
85 | }; | 112 | }; |
diff --git a/gs/psi/zusparam.c b/gs/psi/zusparam.c index b86b2b92d..7d74c73d0 100644 --- a/gs/psi/zusparam.c +++ b/gs/psi/zusparam.c | |||
@@ -632,6 +632,19 @@ set_OverrideRI(i_ctx_t *i_ctx_p, bool val) | |||
632 | return 0; | 632 | return 0; |
633 | } | 633 | } |
634 | static bool | 634 | static bool |
635 | current_OverrideBP(i_ctx_t *i_ctx_p) | ||
636 | { | ||
637 | const gs_imager_state * pis = (gs_imager_state *) igs; | ||
638 | return gs_currentoverride_bp(pis); | ||
639 | } | ||
640 | static int | ||
641 | set_OverrideBP(i_ctx_t *i_ctx_p, bool val) | ||
642 | { | ||
643 | gs_imager_state * pis = (gs_imager_state *) igs; | ||
644 | gs_setoverride_bp(pis, val); | ||
645 | return 0; | ||
646 | } | ||
647 | static bool | ||
635 | current_OverrideICC(i_ctx_t *i_ctx_p) | 648 | current_OverrideICC(i_ctx_t *i_ctx_p) |
636 | { | 649 | { |
637 | const gs_imager_state * pis = (gs_imager_state *) igs; | 650 | const gs_imager_state * pis = (gs_imager_state *) igs; |
@@ -675,7 +688,8 @@ static const bool_param_def_t user_bool_params[] = | |||
675 | {"LockFilePermissions", current_LockFilePermissions, set_LockFilePermissions}, | 688 | {"LockFilePermissions", current_LockFilePermissions, set_LockFilePermissions}, |
676 | {"RenderTTNotdef", current_RenderTTNotdef, set_RenderTTNotdef}, | 689 | {"RenderTTNotdef", current_RenderTTNotdef, set_RenderTTNotdef}, |
677 | {"OverrideICC", current_OverrideICC, set_OverrideICC}, | 690 | {"OverrideICC", current_OverrideICC, set_OverrideICC}, |
678 | {"OverrideRI", current_OverrideRI, set_OverrideRI} | 691 | {"OverrideRI", current_OverrideRI, set_OverrideRI}, |
692 | {"OverrideBP", current_OverrideBP, set_OverrideBP} | ||
679 | }; | 693 | }; |
680 | 694 | ||
681 | /* The user parameter set */ | 695 | /* The user parameter set */ |
diff --git a/gs/toolbin/color/src_color/objsrc_profiles_example.txt b/gs/toolbin/color/src_color/objsrc_profiles_example.txt index 4bdd36c04..b416b62ac 100644 --- a/gs/toolbin/color/src_color/objsrc_profiles_example.txt +++ b/gs/toolbin/color/src_color/objsrc_profiles_example.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | Graphic_CMYK cmyk_src_cyan.icc 0 | 1 | Graphic_CMYK cmyk_src_cyan.icc 0 1 |
2 | Image_CMYK cmyk_src_magenta.icc 0 | 2 | Image_CMYK cmyk_src_magenta.icc 0 1 |
3 | Text_CMYK cmyk_src_yellow.icc 0 | 3 | Text_CMYK cmyk_src_yellow.icc 0 1 |
4 | Graphic_RGB rgb_source_red.icc 0 | 4 | Graphic_RGB rgb_source_red.icc 0 1 |
5 | Image_RGB rgb_source_green.icc 0 | 5 | Image_RGB rgb_source_green.icc 0 1 |
6 | Text_RGB rgb_source_blue.icc 0 | 6 | Text_RGB rgb_source_blue.icc 0 1 |
diff --git a/xps/xpsgradient.c b/xps/xpsgradient.c index efafd6795..3aed3fb26 100644 --- a/xps/xpsgradient.c +++ b/xps/xpsgradient.c | |||
@@ -81,7 +81,7 @@ xps_parse_gradient_stops(xps_context_t *ctx, char *base_uri, xps_item_t *node, | |||
81 | xps_parse_color(ctx, base_uri, color, &colorspace, sample); | 81 | xps_parse_color(ctx, base_uri, color, &colorspace, sample); |
82 | 82 | ||
83 | /* Set the rendering parameters */ | 83 | /* Set the rendering parameters */ |
84 | rendering_params.black_point_comp = BP_ON; | 84 | rendering_params.black_point_comp = gsBLACKPTCOMP_ON; |
85 | rendering_params.graphics_type_tag = GS_PATH_TAG; | 85 | rendering_params.graphics_type_tag = GS_PATH_TAG; |
86 | rendering_params.rendering_intent = gsPERCEPTUAL; | 86 | rendering_params.rendering_intent = gsPERCEPTUAL; |
87 | 87 | ||