From f3aaf279fff916a2ce8865ae940e32a724fcf5f3 Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Thu, 10 Jun 2021 14:38:27 +0100 Subject: Change get_color_mapping_procs device procedure. Previously, devices would call 'get_color_mapping_procs' to get a procedure table from a device. They would then call those procs, passing in the device as an argument. For forwarding/subclassing devices, this is problematic, because getting a child device's color_mapping_procs, and passing it a parent's device pointer will lead to failures. Accordingly lots of wrapping functions have to be written. Here we try an alternative formulation. When we 'get_color_mapping_procs' we get both the procedure table, and the device pointer to pass to them. For most devices this will be the incoming device pointer parrotted back. For forwarding and subclass devices, it will be the appropriate child device. --- base/gsicc_lcms2.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'base/gsicc_lcms2.c') diff --git a/base/gsicc_lcms2.c b/base/gsicc_lcms2.c index 5e9355e62..ccf1d7051 100644 --- a/base/gsicc_lcms2.c +++ b/base/gsicc_lcms2.c @@ -461,6 +461,13 @@ gscms_transform_color_buffer(gx_device *dev, gsicc_link_t *icclink, int gscms_transform_color(gx_device *dev, gsicc_link_t *icclink, void *inputcolor, void *outputcolor, int num_bytes) +{ + return gscms_transformm_color_const(dev, icclink, inputcolor, outputcolor, num_bytes); +} + +int +gscms_transform_color_const(const gx_device *dev, gsicc_link_t *icclink, void *inputcolor, + void *outputcolor, int num_bytes) { cmsHTRANSFORM hTransform = (cmsHTRANSFORM)icclink->link_handle; cmsUInt32Number dwInputFormat,dwOutputFormat; -- cgit v1.2.1