summaryrefslogtreecommitdiff
path: root/gs/base/gdevdflt.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-10-29 20:20:22 +0000
committerRobin Watts <robin.watts@artifex.com>2012-10-29 22:52:57 +0000
commitaa7d7ffcc390b05a8e36b6cf85e4688ae69c2a85 (patch)
treecac8f4330219d119574bd866f2bc14b14c9dcb7b /gs/base/gdevdflt.c
parent49f1bba50c096dee3230e5221db4d5275b8e12e7 (diff)
downloadghostpdl-aa7d7ffcc390b05a8e36b6cf85e4688ae69c2a85.tar.gz
Fix interpolation code to behave consistently in the presence of pdf14.
There are special cases in the setup of the image interpolation code designed to kick in in the presence of halftoning devices and either limit the amount or change the nature of the interpolation done. The test for this is confused by the presence of a pdf14 device though. We move the special cases down into a device specific op call to avoid this. This also means that devices can have finer control over exactly when these operations are used. One possibility would be to expose them as device params, but I haven't done that here yet.
Diffstat (limited to 'gs/base/gdevdflt.c')
-rw-r--r--gs/base/gdevdflt.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gs/base/gdevdflt.c b/gs/base/gdevdflt.c
index 6ac0410ba..057264b14 100644
--- a/gs/base/gdevdflt.c
+++ b/gs/base/gdevdflt.c
@@ -934,6 +934,26 @@ gx_default_dev_spec_op(gx_device *pdev, int dev_spec_op, void *data, int size)
return (pdev->procs.fill_path == gx_default_fill_path);
case gxdso_is_std_cmyk_1bit:
return (pdev->procs.map_cmyk_color == cmyk_1bit_map_cmyk_color);
+ case gxdso_interpolate_antidropout:
+ if ((pdev->color_info.num_components == 1 &&
+ pdev->color_info.max_gray < 15) ||
+ (pdev->color_info.num_components > 1 &&
+ pdev->color_info.max_color < 15)) {
+ /* If we are are limited color device (i.e. we are halftoning)
+ * then use the antidropout interpolators. */
+ return 1;
+ }
+ return 0;
+ case gxdso_interpolate_threshold:
+ if ((pdev->color_info.num_components == 1 &&
+ pdev->color_info.max_gray < 15) ||
+ (pdev->color_info.num_components > 1 &&
+ pdev->color_info.max_color < 15)) {
+ /* If we are a limited color device (i.e. we are halftoning)
+ * then only interpolate if we are upscaling by at least 4 */
+ return 4;
+ }
+ return 0; /* Otherwise no change */
}
return gs_error_undefined;
}