[gs-cvs] rev 8000 - trunk/gs/src

ray at ghostscript.com ray at ghostscript.com
Wed May 23 16:33:45 PDT 2007


Author: ray
Date: 2007-05-23 16:33:45 -0700 (Wed, 23 May 2007)
New Revision: 8000

Modified:
   trunk/gs/src/gdevwts.c
Log:
Change the .ppm output from the wtsimdi device to write a P6 with
a max value of 255 (instead of 1). Some viewers assume a max value
of 255, so the previous output looked all black. A max value of 255
works with all known viewers.


Modified: trunk/gs/src/gdevwts.c
===================================================================
--- trunk/gs/src/gdevwts.c	2007-05-23 20:27:42 UTC (rev 7999)
+++ trunk/gs/src/gdevwts.c	2007-05-23 23:33:45 UTC (rev 8000)
@@ -918,7 +918,7 @@
 /*
  * Create a row of output data.  The output is the same as the pkmraw
  * device.  This a pseudo 1 bit CMYK output.  Actually the output is
- * 3 byte RGB with each byte being either 0 or 1.
+ * 3 byte RGB with each byte being either 0 or 255.
  *
  * The input data is 1 bit per component CMYK.  The data is separated
  * into planes.
@@ -955,9 +955,9 @@
 		*outp++ = 0;
 		*outp++ = 0;
 	    } else {
-		*outp++ = 1 - ((c >> bit) & 1);
-		*outp++ = 1 - ((m >> bit) & 1);
-		*outp++ = 1 - ((y >> bit) & 1);
+		*outp++ = 255 & (255 + ((c >> bit) & 1));
+		*outp++ = 255 & (255 + ((m >> bit) & 1));
+		*outp++ = 255 & (255 + ((y >> bit) & 1));
 	    }
 	    if (bit == 0) {
 	        c = *cdata++;
@@ -1019,7 +1019,7 @@
     fprintf(prn_stream, "# Image generated by %s %d.%02d (device=wtsimdi)\n",
 	   	gs_program_name(), gs_revision_number() / 100,
 	   			gs_revision_number() % 100);
-    fprintf(prn_stream, "%d\n", 1);
+    fprintf(prn_stream, "%d\n", 255);
 
     /*
      * Get raster data and then write data to output file.



More information about the gs-cvs mailing list