Fix for 687607 Text missing with TextALphaBits=2 and tiffsep device

"Dan Coby" <[email protected]> Fri, 27 Aug 2004 21:53:51 -0700
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
Fix for 687607   Text missing with TextALphaBits=2 and tiffsep device.

DETAILS:

The TextAlphaBits and GraphicsAlphaBits device parameters were not working
for devices with a depth of more than 32 bits.  The fix involves replacing
the copy_alpha device procs in the 40, 48, 56, and 64 bit memory devices
with the gx_default_copy_alpha routine.  These devices previously had a
copy_alpha routine which did nothing.  This was a mistake from when these
devices were created as part of the DeviceN work.

_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review
687607.txt (text/plain, 5.6 KB)
Index: src/gdevm40.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevm40.c,v
retrieving revision 1.1
diff -u -r1.1 gdevm40.c
--- src/gdevm40.c	22 Aug 2002 07:12:28 -0000	1.1
+++ src/gdevm40.c	28 Aug 2004 04:43:49 -0000
@@ -46,14 +46,13 @@
 
 /* Procedures */
 declare_mem_procs(mem_true40_copy_mono, mem_true40_copy_color, mem_true40_fill_rectangle);
-private dev_proc_copy_alpha(mem_true40_copy_alpha);
 
 /* The device descriptor. */
 const gx_device_memory mem_true40_device =
 mem_full_alpha_device("image40", 40, 0, mem_open,
 		 gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb,
      mem_true40_copy_mono, mem_true40_copy_color, mem_true40_fill_rectangle,
-		      gx_default_map_cmyk_color, mem_true40_copy_alpha,
+		      gx_default_map_cmyk_color, gx_default_copy_alpha,
 		 gx_default_strip_tile_rectangle, mem_default_strip_copy_rop,
 		      mem_get_bits_rectangle);
 
@@ -408,18 +407,6 @@
     return 0;
 }
 
-/* Copy an alpha map. */
-private int
-mem_true40_copy_alpha(gx_device * dev, const byte * base, int sourcex,
-		   int sraster, gx_bitmap_id id, int x, int y, int w, int h,
-		      gx_color_index color, int depth)
-{
-    /*
-     * I do not know what to do about alpha.
-     */
-    return 0;
-}
-
 /* ================ "Word"-oriented device ================ */
 
 /* Note that on a big-endian machine, this is the same as the */
Index: src/gdevm48.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevm48.c,v
retrieving revision 1.1
diff -u -r1.1 gdevm48.c
--- src/gdevm48.c	22 Aug 2002 07:12:28 -0000	1.1
+++ src/gdevm48.c	28 Aug 2004 04:43:49 -0000
@@ -46,14 +46,13 @@
 
 /* Procedures */
 declare_mem_procs(mem_true48_copy_mono, mem_true48_copy_color, mem_true48_fill_rectangle);
-private dev_proc_copy_alpha(mem_true48_copy_alpha);
 
 /* The device descriptor. */
 const gx_device_memory mem_true48_device =
 mem_full_alpha_device("image48", 48, 0, mem_open,
 		 gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb,
      mem_true48_copy_mono, mem_true48_copy_color, mem_true48_fill_rectangle,
-		      gx_default_map_cmyk_color, mem_true48_copy_alpha,
+		      gx_default_map_cmyk_color, gx_default_copy_alpha,
 		 gx_default_strip_tile_rectangle, mem_default_strip_copy_rop,
 		      mem_get_bits_rectangle);
 
@@ -377,18 +376,6 @@
     return 0;
 }
 
-/* Copy an alpha map. */
-private int
-mem_true48_copy_alpha(gx_device * dev, const byte * base, int sourcex,
-		   int sraster, gx_bitmap_id id, int x, int y, int w, int h,
-		      gx_color_index color, int depth)
-{
-    /*
-     * I do not know what to do about alpha.
-     */
-    return 0;
-}
-
 /* ================ "Word"-oriented device ================ */
 
 /* Note that on a big-endian machine, this is the same as the */
Index: src/gdevm56.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevm56.c,v
retrieving revision 1.2
diff -u -r1.2 gdevm56.c
--- src/gdevm56.c	11 Oct 2002 05:58:22 -0000	1.2
+++ src/gdevm56.c	28 Aug 2004 04:43:50 -0000
@@ -46,14 +46,13 @@
 
 /* Procedures */
 declare_mem_procs(mem_true56_copy_mono, mem_true56_copy_color, mem_true56_fill_rectangle);
-private dev_proc_copy_alpha(mem_true56_copy_alpha);
 
 /* The device descriptor. */
 const gx_device_memory mem_true56_device =
 mem_full_alpha_device("image56", 56, 0, mem_open,
 		 gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb,
      mem_true56_copy_mono, mem_true56_copy_color, mem_true56_fill_rectangle,
-		      gx_default_map_cmyk_color, mem_true56_copy_alpha,
+		      gx_default_map_cmyk_color, gx_default_copy_alpha,
 		 gx_default_strip_tile_rectangle, mem_default_strip_copy_rop,
 		      mem_get_bits_rectangle);
 
@@ -432,18 +431,6 @@
     return 0;
 }
 
-/* Copy an alpha map. */
-private int
-mem_true56_copy_alpha(gx_device * dev, const byte * base, int sourcex,
-		   int sraster, gx_bitmap_id id, int x, int y, int w, int h,
-		      gx_color_index color, int depth)
-{
-    /*
-     * I do not know what to do about alpha.
-     */
-    return 0;
-}
-
 /* ================ "Word"-oriented device ================ */
 
 /* Note that on a big-endian machine, this is the same as the */
Index: src/gdevm64.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevm64.c,v
retrieving revision 1.2
diff -u -r1.2 gdevm64.c
--- src/gdevm64.c	12 May 2004 00:04:49 -0000	1.2
+++ src/gdevm64.c	28 Aug 2004 04:43:50 -0000
@@ -46,14 +46,13 @@
 
 /* Procedures */
 declare_mem_procs(mem_true64_copy_mono, mem_true64_copy_color, mem_true64_fill_rectangle);
-private dev_proc_copy_alpha(mem_true64_copy_alpha);
 
 /* The device descriptor. */
 const gx_device_memory mem_true64_device =
 mem_full_alpha_device("image64", 64, 0, mem_open,
 		 gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb,
      mem_true64_copy_mono, mem_true64_copy_color, mem_true64_fill_rectangle,
-		      gx_default_map_cmyk_color, mem_true64_copy_alpha,
+		      gx_default_map_cmyk_color, gx_default_copy_alpha,
 		 gx_default_strip_tile_rectangle, mem_default_strip_copy_rop,
 		      mem_get_bits_rectangle);
 
@@ -335,18 +334,6 @@
     return 0;
 }
 
-/* Copy an alpha map. */
-private int
-mem_true64_copy_alpha(gx_device * dev, const byte * base, int sourcex,
-		   int sraster, gx_bitmap_id id, int x, int y, int w, int h,
-		      gx_color_index color, int depth)
-{
-    /*
-     * I do not know what to do about alpha.
-     */
-    return 0;
-}
-
 /* ================ "Word"-oriented device ================ */
 
 /* Note that on a big-endian machine, this is the same as the */