File gs.svn_diff-c_12005.diff of Package ghostscript-library
Index: base/gxcmap.h
===================================================================
--- base/gxcmap.h (revision 12004)
+++ base/gxcmap.h (revision 12005)
@@ -284,5 +284,11 @@
* [0,1]
*/
frac gx_unit_frac(float fvalue);
+/* Determine if the device is using the standard color mapping procs. In
+ such a case, we can make use of the faster icc color conversions for
+ images */
+bool gx_device_uses_std_cmap_procs(gx_device * dev);
+bool fwd_uses_fwd_cmap_procs(gx_device * dev);
+const gx_cm_color_map_procs* fwd_get_target_cmap_procs(gx_device * dev);
#endif /* gxcmap_INCLUDED */
Index: base/gxi12bit.c
===================================================================
--- base/gxi12bit.c (revision 12004)
+++ base/gxi12bit.c (revision 12005)
@@ -113,6 +113,8 @@
irender_proc_t
gs_image_class_2_fracs(gx_image_enum * penum)
{
+ bool std_cmap_procs;
+
if (penum->bps > 8) {
if (penum->use_mask_color) {
/* Convert color mask values to fracs. */
@@ -122,9 +124,14 @@
penum->mask_color.values[i] =
bits2frac(penum->mask_color.values[i], 12);
}
+ /* If the device has some unique color mapping procs due to its color space,
+ then we will need to use those and go through pixel by pixel instead
+ of blasting through buffers. This is true for example with many of
+ the color spaces for CUPs */
+ std_cmap_procs = gx_device_uses_std_cmap_procs(penum->dev);
if ( (gs_color_space_get_index(penum->pcs) == gs_color_space_index_DeviceN &&
penum->pcs->cmm_icc_profile_data == NULL) || penum->use_mask_color ||
- penum->bps != 16 ||
+ penum->bps != 16 || !std_cmap_procs ||
gs_color_space_get_index(penum->pcs) == gs_color_space_index_DevicePixel) {
/* DevicePixel color space used in mask from 3x type. Basically
a simple color space that just is scaled to the device bit
Index: base/lib.mak
===================================================================
--- base/lib.mak (revision 12004)
+++ base/lib.mak (revision 12005)
@@ -602,7 +602,7 @@
$(gxalpha_h) $(gxcspace_h) $(gxfarith_h) $(gxfrac_h)\
$(gxdcconv_h) $(gxdevice_h) $(gxcmap_h) $(gsnamecl_h) $(gxlum_h)\
$(gzstate_h) $(gxdither_h) $(gxcdevn_h) $(string__h)\
- $(gsicc_manage_h) $(gdevdevn_h) $(gsicc_cache_h)
+ $(gsicc_manage_h) $(gdevdevn_h) $(gsicc_cache_h) $(gscms_h)
$(GLCC) $(GLO_)gxcmap.$(OBJ) $(C_) $(GLSRC)gxcmap.c
$(GLOBJ)gxcpath.$(OBJ) : $(GLSRC)gxcpath.c $(GXERR)\
Index: base/gxiscale.c
===================================================================
--- base/gxiscale.c (revision 12004)
+++ base/gxiscale.c (revision 12005)
@@ -104,6 +104,13 @@
!= penum->dev->color_info.num_components) {
use_icc = false;
}
+ /* If the device has some unique color mapping procs due to its color space,
+ then we will need to use those and go through pixel by pixel instead
+ of blasting through buffers. This is true for example with many of
+ the color spaces for CUPs */
+ if(!gx_device_uses_std_cmap_procs(penum->dev)) {
+ use_icc = false;
+ }
/*
* USE_CONSERVATIVE_INTERPOLATION_RULES is normally NOT defined since
* the MITCHELL digital filter seems OK as long as we are going out to
Index: base/gdevnfwd.c
===================================================================
--- base/gdevnfwd.c (revision 12004)
+++ base/gdevnfwd.c (revision 12005)
@@ -1117,3 +1117,29 @@
{
return 0;
}
+
+bool
+fwd_uses_fwd_cmap_procs(gx_device * dev)
+{
+ const gx_cm_color_map_procs *pprocs;
+
+ pprocs = dev_proc(dev, get_color_mapping_procs)(dev);
+ if (pprocs == &FwdDevice_cm_map_procs) {
+ return true;
+ }
+ return false;
+}
+
+const gx_cm_color_map_procs*
+fwd_get_target_cmap_procs(gx_device * dev)
+{
+ const gx_cm_color_map_procs *pprocs;
+ gx_device_forward * const fdev = (gx_device_forward *)dev;
+ gx_device * const tdev = fdev->target;
+
+ pprocs = dev_proc(tdev, get_color_mapping_procs(tdev));
+ while (pprocs == &FwdDevice_cm_map_procs) {
+ pprocs = fwd_get_target_cmap_procs(tdev);
+ }
+ return pprocs;
+}
\ No newline at end of file