summaryrefslogtreecommitdiff
path: root/pcl
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2022-03-09 14:16:30 +0000
committerRobin Watts <Robin.Watts@artifex.com>2022-03-10 14:43:30 +0000
commitb882cd2052f6b8feaa52ecfcf16eac4ad1b04d0d (patch)
treec51e307daa0ff4ffc39e1db21396a20e9ab3fe79 /pcl
parent2430a78c2d1cfac492a8811553a4863eb6dae019 (diff)
downloadghostpdl-b882cd2052f6b8feaa52ecfcf16eac4ad1b04d0d.tar.gz
Fix and extend chameleon device.
This wasn't working, possibly due to device changes, more likely due to insufficient testing when it was first written. We fix it here, and change the way we handle post render color conversion. We were using ICC before in the case when we had a PostRenderProfile, but not otherwise. If no PostRenderProfile is specifically set, we now stash the device profile before we change our colormodel, and use that as the target for our post render conversion. This has required a new downscaler helper function to make an icc link from a given profile. This means that we now only really support contone operation (as doing ICC conversions from pre-dithered results will not look good). If we want to support dithered output, then we'll really need to do the dithering as part of the conversion from contone rendered RGB, as otherwise it'll look really bad.
Diffstat (limited to 'pcl')
-rw-r--r--pcl/pcl/pctop.c15
-rw-r--r--pcl/pxl/pxtop.c18
2 files changed, 17 insertions, 16 deletions
diff --git a/pcl/pcl/pctop.c b/pcl/pcl/pctop.c
index ad4ebf4cc..224614d5d 100644
--- a/pcl/pcl/pctop.c
+++ b/pcl/pcl/pctop.c
@@ -346,6 +346,14 @@ pcl_impl_init_job(pl_interp_implementation_t * impl, /* interp instance to
if ((code = gs_setdevice_no_erase(pcli->pcs.pgs, device)) < 0) /* can't erase yet */
goto pisdEnd;
+ /* Warn the device we use ROPs. Do this early, as it may cause the
+ * device to change color model. */
+ code = put_param1_bool(&pcli->pcs, "LanguageUsesROPs", true);
+ if (!device->is_open)
+ code = gs_opendevice(device);
+ if (code < 0)
+ return code;
+
stage = Sinitg;
/* Do inits of gstate that may be reset by setdevice */
/* PCL no longer uses the graphic library transparency mechanism */
@@ -417,13 +425,6 @@ pcl_impl_init_job(pl_interp_implementation_t * impl, /* interp instance to
break;
}
- /* Warn the device we use ROPs */
- if (code == 0) {
- code = put_param1_bool(&pcli->pcs, "LanguageUsesROPs", true);
- if (!device->is_open)
- code = gs_opendevice(device);
- }
-
return code;
}
diff --git a/pcl/pxl/pxtop.c b/pcl/pxl/pxtop.c
index 93435ceef..b9a6291f3 100644
--- a/pcl/pxl/pxtop.c
+++ b/pcl/pxl/pxtop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -277,6 +277,14 @@ pxl_impl_init_job(pl_interp_implementation_t * impl,
if ((code = gs_setdevice_no_erase(pxli->pgs, device)) < 0) /* can't erase yet */
goto pisdEnd;
+ /* Warn the device that PXL uses ROPs. */
+ if (code == 0) {
+ code = put_param_bool(pxli, "LanguageUsesROPs", true);
+
+ if (!device->is_open)
+ code = gs_opendevice(device);
+ }
+
/* Init XL graphics */
stage = Sinitg;
if ((code = px_initgraphics(pxli->pxs)) < 0)
@@ -322,14 +330,6 @@ pxl_impl_init_job(pl_interp_implementation_t * impl,
break;
}
- /* Warn the device that PXL uses ROPs. */
- if (code == 0) {
- code = put_param_bool(pxli, "LanguageUsesROPs", true);
-
- if (!device->is_open)
- code = gs_opendevice(device);
- }
-
return code;
}