summaryrefslogtreecommitdiff
path: root/gs/base
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-02-16 20:03:26 +0000
committerChris Liddell <chris.liddell@artifex.com>2012-03-15 11:54:23 +0000
commit52d7ee77381bd8dfd3f124e3bbc71e2c9c708da9 (patch)
treee0a61e0f90572567d11cdf7b301b725a74bce704 /gs/base
parent9305580b1c415bfc1bf68e279a628009acf1ab8b (diff)
Fix interpolation of indexed colorspaces.
WMB1102317A01.pdf (supplied by a customer) shows a problem with Interpolation of Index colorspaces. Specifically, we have an Indexed DeviceGrey space (which is, in the new world order, an Indexed ICC space, with 1 component). At line 678 of gxiscale.c we correctly detect that pcs->type->index is Indexed, and therefore use the base space as the 'actual' space. At line 683 we find the concrete space (which in this case is exactly the same space). We then decide whether we are working in an icc world, or a device_color world by checking for the presence of icc data. The old code used to (incorrectly) check pcs (the indexed space), when it should really have checked the concrete space. The remaining changes in the code are purely tidying: * avoid calling concrete_space a second time (when pconcs already holds the answer) * pass pconcs as an arg when calling pconcs->type->remap_concrete_color rather than pactual_cs. At that point pactual_cs and pconcs must be identical, but it's nicer to be consistent. This produces 3 differences in the cluster tests, all in the cups tests. These can be reproduced locally using tiffsep. comparefiles/148-11.ps.cups.300.1 Definite progression PDFIA1.7_SUBSET/CATX1028.pdf.cups.300.1 Looks like progression to me ps/ps3cet/12-07B.PS.cups.300.1 Definite progressions on page 12-15. A problem still exists on page 12 though, but that's unaffected by this change.
Diffstat (limited to 'gs/base')
-rw-r--r--gs/base/gxiscale.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gs/base/gxiscale.c b/gs/base/gxiscale.c
index 1975c65fd..5720a0d39 100644
--- a/gs/base/gxiscale.c
+++ b/gs/base/gxiscale.c
@@ -681,16 +681,15 @@ image_render_interpolate(gx_image_enum * penum, const byte * buffer,
pactual_cs = pcs;
}
pconcs = cs_concrete_space(pactual_cs, pis);
- if (pcs->cmm_icc_profile_data != NULL) {
+ if (pconcs->cmm_icc_profile_data != NULL) {
device_color = false;
} else {
- device_color =
- (pactual_cs->type->concrete_space) (pactual_cs, pis) == pactual_cs;
+ device_color = (pconcs == pactual_cs);
}
if (device_color) {
/* Use the underlying concrete space remap */
code = (*pconcs->type->remap_concrete_color)
- (psrc, pactual_cs, &devc, pis, dev, gs_color_select_source);
+ (psrc, pconcs, &devc, pis, dev, gs_color_select_source);
} else {
/* if we are device dependent we need to get back to
float prior to remap. This stuff needs to be