summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2012-04-30 15:11:38 -0700
committerMichael Vrhel <michael.vrhel@artifex.com>2012-04-30 15:11:38 -0700
commitaf102f5fe9a91a071b2d01c3e8ee35a0c99275ea (patch)
tree242ea508bca52d9f0d65eb397b74132e8c747e5a
parente8f8eed2369d5e8709acd0aa65306758aa322e3d (diff)
Fix for indeterminism introduced in 60640aeb33b18f9a9fcd76fc6f1083d7c7635f24
The shading code was using the number of components of the target device in making a linearity determination. It should make use of the destination ICC profile in that computation.
-rw-r--r--gs/base/gsicc.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gs/base/gsicc.c b/gs/base/gsicc.c
index 4d173c04d..6b7ce867e 100644
--- a/gs/base/gsicc.c
+++ b/gs/base/gsicc.c
@@ -87,7 +87,9 @@ gx_icc_is_linear_in_line(const gs_color_space *cs, const gs_imager_state * pis,
float smoothness, gsicc_link_t *icclink)
{
int nsrc = cs->type->num_components(cs);
- int ndes = dev->color_info.num_components;
+ cmm_dev_profile_t *dev_profile;
+ int ndes;
+ int code;
unsigned short src0[GS_CLIENT_COLOR_MAX_COMPONENTS];
unsigned short src1[GS_CLIENT_COLOR_MAX_COMPONENTS];
unsigned short src01[GS_CLIENT_COLOR_MAX_COMPONENTS];
@@ -98,6 +100,9 @@ gx_icc_is_linear_in_line(const gs_color_space *cs, const gs_imager_state * pis,
unsigned short max_diff = (unsigned short) max(1, 65535 * smoothness);
int k;
+ code = dev_proc(dev, get_profile)(dev, &(dev_profile));
+ ndes = gsicc_get_device_profile_comps(dev_profile);
+
/* Get us to ushort and get mid point */
for (k = 0; k < nsrc; k++) {
src0[k] = (unsigned short) (c0->paint.values[k]*65535);
@@ -141,10 +146,14 @@ gx_icc_is_linear_in_triangle(const gs_color_space *cs, const gs_imager_state * p
unsigned short des02[GS_CLIENT_COLOR_MAX_COMPONENTS];
unsigned short des012[GS_CLIENT_COLOR_MAX_COMPONENTS];
int nsrc = cs->type->num_components(cs);
- int ndes = dev->color_info.num_components;
+ int ndes, code;
unsigned short max_diff = (unsigned short) max(1, 65535 * smoothness);
unsigned int interp_des;
int k;
+ cmm_dev_profile_t *dev_profile;
+
+ code = dev_proc(dev, get_profile)(dev, &(dev_profile));
+ ndes = gsicc_get_device_profile_comps(dev_profile);
/* This needs to be optimized. And range corrected */
for (k = 0; k < nsrc; k++){