summaryrefslogtreecommitdiff
path: root/pcl
diff options
context:
space:
mode:
authorHenry Stiles <henry.stiles@artifex.com>2012-03-01 13:47:18 -0700
committerChris Liddell <chris.liddell@artifex.com>2012-03-15 11:54:24 +0000
commit6e4277cbb452b62cb48d7e518061716c30b75191 (patch)
tree111ca3bf44387465ea955880379fb594e21c32e7 /pcl
parenta17629a4f31f5397b86436d4afb42a8e0d66f419 (diff)
Add command line parsing for icc user parameters.
Diffstat (limited to 'pcl')
-rw-r--r--pcl/pctop.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/pcl/pctop.c b/pcl/pctop.c
index c270196e8..3cd9d3a9b 100644
--- a/pcl/pctop.c
+++ b/pcl/pctop.c
@@ -339,6 +339,36 @@ pcl_get_personality(pl_interp_instance_t *instance, gx_device *device)
return pcl5c;
}
+static int
+pcl_set_icc_params(pl_interp_instance_t *instance, gs_state *pgs)
+{
+ gs_param_string p;
+
+ int code = 0;
+
+ if (instance->pdefault_gray_icc) {
+ param_string_from_transient_string(p, instance->pdefault_gray_icc);
+ code = gs_setdefaultgrayicc(pgs, &p);
+ if (code < 0)
+ return gs_throw_code(gs_error_Fatal);
+ }
+
+ if (instance->pdefault_rgb_icc) {
+ param_string_from_transient_string(p, instance->pdefault_rgb_icc);
+ code = gs_setdefaultrgbicc(pgs, &p);
+ if (code < 0)
+ return gs_throw_code(gs_error_Fatal);
+ }
+
+ if (instance->piccdir) {
+ param_string_from_transient_string(p, instance->piccdir);
+ code = gs_seticcdirectory(pgs, &p);
+ if (code < 0)
+ return gs_throw_code(gs_error_Fatal);
+ }
+ return code;
+}
+
static bool
pcl_get_interpolation(pl_interp_instance_t *instance)
{
@@ -406,6 +436,10 @@ pcl_impl_set_device(
if (code < 0)
goto pisdEnd;
+ code = pcl_set_icc_params(instance, pcli->pcs.pgs);
+ if (code < 0)
+ goto pisdEnd;
+
stage = Sgsave1;
if ( (code = gs_gsave(pcli->pcs.pgs)) < 0 )
goto pisdEnd;