[gs-cvs] rev 8015 - trunk/gs/src
ray at ghostscript.com
ray at ghostscript.com
Mon May 28 11:47:29 PDT 2007
Author: ray
Date: 2007-05-28 11:47:29 -0700 (Mon, 28 May 2007)
New Revision: 8015
Modified:
trunk/gs/src/gdevpsd.c
Log:
Fix for Segv with psdcmyk device when a job specifies DeviceGray.
Test file 477-04.ps, Bug #689179.
DETAILS:
Thanks for this patch from "fatty" at po'twenty-nine'.lcv.ne.jp (email
mangled to avoid this being harvested for spam.
EXPECTED DIFFERENCES:
None. Segv is specific to psdcmyk device which is not (currently)
tested during regression testing.
Modified: trunk/gs/src/gdevpsd.c
===================================================================
--- trunk/gs/src/gdevpsd.c 2007-05-28 16:58:07 UTC (rev 8014)
+++ trunk/gs/src/gdevpsd.c 2007-05-28 18:47:29 UTC (rev 8015)
@@ -320,6 +320,29 @@
return code;
}
+/* 2007/05/04
+psdgray device
+*/
+private void
+gray_cs_to_psdgray_cm(gx_device * dev, frac gray, frac out[])
+{
+ out[0] = gray;
+}
+
+private void
+rgb_cs_to_psdgray_cm(gx_device * dev, const gs_imager_state *pis,
+ frac r, frac g, frac b, frac out[])
+{
+ out[0] = color_rgb_to_gray(r, g, b, NULL);
+}
+
+private void
+cmyk_cs_to_psdgray_cm(gx_device * dev, frac c, frac m, frac y, frac k, frac out[])
+{
+ out[0] = color_cmyk_to_gray(c, m, y, k, NULL);
+}
+
+
/*
* The following procedures are used to map the standard color spaces into
* the color components for the psdrgb device.
@@ -456,6 +479,10 @@
}
}
+private const gx_cm_color_map_procs psdGray_procs = {/* 2007/05/04 Test */
+ gray_cs_to_psdgray_cm, rgb_cs_to_psdgray_cm, cmyk_cs_to_psdgray_cm
+};
+
private const gx_cm_color_map_procs psdRGB_procs = {
gray_cs_to_psdrgb_cm, rgb_cs_to_psdrgb_cm, cmyk_cs_to_psdrgb_cm
};
@@ -489,6 +516,8 @@
return &psdCMYK_procs;
else if (xdev->color_model == psd_DEVICE_N)
return &psdN_procs;
+ else if (xdev->color_model == psd_DEVICE_GRAY)
+ return &psdGray_procs;
else
return NULL;
}
More information about the gs-cvs
mailing list