[Bug 687629] display device 1bit/pixel native doesn't halftone.

"Russell Lang" <[email protected]> Thu, 26 Aug 2004 19:06:45 +1000
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <412E34C5.30799.480A66B3@localhost>
This was discussed with Dan on IRC and will be committed.

Log Message:
Fix half-toning for display device.

DETAILS:
Prior to DeviceN, dither_gray/max_gray were used if ncomp==1.
With DeviceN, dither_gray/max_gray are used if gray_index >= 0.
The display device was not correctly setting gray_index for
native 1-bit/pixel format.


Russell Lang                   [email protected]
Ghostgum Software Pty Ltd      http://www.ghostgum.com.au/

diff -u l:/cvs/gs/src/gdevdsp.c src/gdevdsp.c
--- l:/cvs/gs/src/gdevdsp.c	Mon Aug 23 09:57:21 2004
+++ src/gdevdsp.c	Tue Aug 24 22:31:04 2004
@@ -1592,6 +1592,10 @@
     check_device_separable(pdev);
     switch (nFormat & DISPLAY_COLORS_MASK) {
 	case DISPLAY_COLORS_NATIVE:
+	    ddev->color_info.gray_index = GX_CINFO_COMP_NO_INDEX;
+	    if ((nFormat & DISPLAY_DEPTH_MASK) == DISPLAY_DEPTH_1)
+	        ddev->color_info.gray_index = 0;
+	    break;
 	case DISPLAY_COLORS_RGB:
 	    ddev->color_info.gray_index = GX_CINFO_COMP_NO_INDEX;
 	    break;

_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review