summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2018-09-07 10:17:44 -0700
committerMichael Vrhel <michael.vrhel@artifex.com>2018-09-07 10:56:40 -0700
commitd4c2e30bc057bc99e8d0fac04f6ecaae4721f435 (patch)
tree550c2051ffcaeac3d58fb16daf56db2384c67eee
parentfa78d81c37afc28950020df4accf58d7bb1d01e7 (diff)
downloadghostpdl-d4c2e30bc057bc99e8d0fac04f6ecaae4721f435.tar.gz
Get formats set properly in gscms_transform_color
The color space was not getting set in the input and output formats when we had a change in the lcms formatters.
-rw-r--r--base/gsicc_lcms2mt.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/base/gsicc_lcms2mt.c b/base/gsicc_lcms2mt.c
index ade99f356..03117d04b 100644
--- a/base/gsicc_lcms2mt.c
+++ b/base/gsicc_lcms2mt.c
@@ -542,7 +542,7 @@ gscms_transform_color(gx_device *dev, gsicc_link_t *icclink, void *inputcolor,
{
gsicc_lcms2mt_link_list_t *link_handle = (gsicc_lcms2mt_link_list_t *)(icclink->link_handle);
cmsHTRANSFORM hTransform = (cmsHTRANSFORM)link_handle->hTransform;
- cmsUInt32Number dwInputFormat,dwOutputFormat;
+ cmsUInt32Number dwInputFormat, dwOutputFormat;
cmsContext ctx = gs_lib_ctx_get_cms_context(icclink->memory);
int big_endianIN, big_endianOUT, needed_flags;
@@ -581,14 +581,21 @@ gscms_transform_color(gx_device *dev, gsicc_link_t *icclink, void *inputcolor,
hTransform = link_handle->hTransform;
/* the variant we want wasn't present, clone it from the HEAD (no alpha, not planar) */
- dwInputFormat = (dwInputFormat & (~LCMS_BYTES_MASK)) | BYTES_SH(num_bytes);
- dwOutputFormat = (dwOutputFormat & (~LCMS_BYTES_MASK)) | BYTES_SH(num_bytes);
- dwInputFormat = (dwInputFormat & (~LCMS_ENDIAN16_MASK)) | ENDIAN16_SH(big_endianIN);
- dwOutputFormat = (dwOutputFormat & (~LCMS_ENDIAN16_MASK)) | ENDIAN16_SH(big_endianOUT);
+ dwInputFormat = COLORSPACE_SH(T_COLORSPACE(cmsGetTransformInputFormat(ctx, hTransform)));
+ dwOutputFormat = COLORSPACE_SH(T_COLORSPACE(cmsGetTransformOutputFormat(ctx, hTransform)));
+ dwInputFormat = dwInputFormat | CHANNELS_SH(T_CHANNELS(cmsGetTransformInputFormat(ctx, hTransform)));
+ dwOutputFormat = dwOutputFormat | CHANNELS_SH(T_CHANNELS(cmsGetTransformOutputFormat(ctx, hTransform)));
+ dwInputFormat = dwInputFormat | ENDIAN16_SH(big_endianIN);
+ dwOutputFormat = dwOutputFormat | ENDIAN16_SH(big_endianOUT);
+ dwInputFormat = dwInputFormat | BYTES_SH(num_bytes);
+ dwOutputFormat = dwOutputFormat | BYTES_SH(num_bytes);
+
/* Get the transform with the settings we need */
hTransform = cmsCloneTransformChangingFormats(ctx, hTransform, dwInputFormat, dwOutputFormat);
+
if (hTransform == NULL)
return_error(gs_error_unknownerror);
+
/* Now we have a new hTransform to add to the list, BUT some other thread */
/* may have been working in the same one. Lock, check again and add to */
/* the (potentially new) end of the list */