summaryrefslogtreecommitdiff
path: root/base/gxdevsop.h
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2022-08-23 11:44:11 -0700
committerMichael Vrhel <michael.vrhel@artifex.com>2022-09-14 13:39:41 -0700
commitb7bdb0f124f8b1f4b3b743000a8bfd7e0eec76eb (patch)
tree561f26aa59445256f52772b146a0be4b8b50792f /base/gxdevsop.h
parent481b32c82db2a3265523eb93ba4b0c614ff10502 (diff)
downloadghostpdl-b7bdb0f124f8b1f4b3b743000a8bfd7e0eec76eb.tar.gz
Color replacement example
Add example of how to perform color replacement for devn devices for source colors that are gray, rgb, cmyk, or cielab. Thanks to Robin Watts for the suggestion on using the special ops for this. This commit adds a new special op called gxdso_replacecolor. The PDF14 device (transparency device) will not allow color replacement if we are in a soft mask or if the PDF14 color space is different than the target device color space. The psd devices are set up as a demo to show the use of color replacement. See gdevpsd.c and set ENABLE_COLOR_REPLACE to 1 to activate the example code. This code shows the setting of specific device color values based upon specific source values. Note that access to the pgs and hence the named color profile is provided so that a database of colors mappings can be provided at runtime. How the memory devices deal with the special_op procedure was reworked. Thanks to Robin Watts for his help on this. Now any memory special ops should be handled in mem_spec_op. If it does not handle it and a target device exists, then the target device will have an opportunity to handle the special op.
Diffstat (limited to 'base/gxdevsop.h')
-rw-r--r--base/gxdevsop.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/base/gxdevsop.h b/base/gxdevsop.h
index 89eed4b3b..b217321bb 100644
--- a/base/gxdevsop.h
+++ b/base/gxdevsop.h
@@ -134,6 +134,14 @@ typedef struct pattern_accum_param_t {
int pinst_id;
}pattern_accum_param_s;
+/* Structure used for device specific color setting */
+typedef struct color_replace_t {
+ gx_device_color *pdc;
+ const gs_color_space *pcs;
+ const gs_client_color *pcc;
+ const gs_gstate *pgs; /* Perhaps needed for named color profile information */
+} color_replace_s;
+
enum {
/* All gxdso_ keys must be defined in this structure.
* Do NOT rely on your particular gxdso_ having a particular value.
@@ -458,6 +466,16 @@ enum {
*/
gxdso_overprint_op,
+ /* Color replacement method. Intercepts remap color method(s) to
+ * enable the device map source colors to device colors directly
+ * in a method defined in the device.
+ * data = color_replace_s
+ * size = sizeof(color_replace_s)
+ *
+ * Returns 0 is no replacment is made.
+ * Returns >0 if replacement occurred. */
+ gxdso_replacecolor,
+
/* Add new gxdso_ keys above this. */
gxdso_pattern__LAST
};