🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #9236

new patch for psraster

#9236
From: Mike Khaw
Date: Wed, 23 Nov 1988 08:23
60 lines
2794 bytes
I found that on printing multiple pages in a single run, the Postscript
put out by the psraster filter would make all pages after the first black.
In response to a question I posted to the net, Ned Batchelder
(betcheldern@hannah.dec.com) said that psraster should invert black/white
by inverting the data rather than using "{ 1 exch sub} settransfer", and
also said that the order of "showpage" and "grestore" should be reversed.

I've implemented his suggestions and cleaned up the spelling in the
comments for psraster.c.  I've also substituted a color to greyscale
mapping function
	0.299R + 0.587G + 0.11B
for the original
	sqrt( (R^2 + G^2 + B^2) / 3) )
in the form of a #if ... #else ... #endif clause. The following patch
should apply to the unpatched version 2.3 psraster.c.

<--- cut here --->
*** /tmp/geta25986      Wed Aug 24 19:30:53 1988
--- /tmp/getb25986      Wed Aug 24 19:31:03 1988
***************
*** 117,123 ****
        Canvas.off_y = -1;


!       for (; optind < argc; optind++) {

                /*
                 * Process argc/argv.
--- 117,123 ----
        Canvas.off_y = -1;


!       for (; optind < argc || optind == 1; optind++) {

                /*
                 * Process argc/argv.
***************
*** 374,380 ****
        (void) fprintf(stderr, "Image size %d %d, offset %d %d\n",
                  Bounds.size_x, Bounds.size_y, Bounds.off_x, Bounds.off_y);
  #endif
!       (void) fprintf(outfile, "%%%%BoundingBox [ %d %d %d %d ]\n",
                       Bounds.off_x, Bounds.off_y,
                       Bounds.off_x + Bounds.size_x,
                       Bounds.off_y + Bounds.size_y);
--- 374,380 ----
        (void) fprintf(stderr, "Image size %d %d, offset %d %d\n",
                  Bounds.size_x, Bounds.size_y, Bounds.off_x, Bounds.off_y);
  #endif
!       (void) fprintf(outfile, "%%%%BoundingBox: %d %d %d %d\n",
                       Bounds.off_x, Bounds.off_y,
                       Bounds.off_x + Bounds.size_x,
                       Bounds.off_y + Bounds.size_y);
<--- cut here --->

Mike Khaw
-- 
internet: mkhaw@teknowledge.arpa
uucp:	  {uunet|sun|ucbvax|decwrl|ames|hplabs}!mkhaw%teknowledge.arpa
hardcopy: Teknowledge Inc, 1850 Embarcadero Rd, POB 10119, Palo Alto, CA 94303
Technical Details
Message-ID: <8811112307.AA18192@teknowledge-vaxc.ARPA>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!rice!sun-spots-request
From: mkhaw@teknowledge-vaxc.arpa (Mike Khaw)
Newsgroups: comp.sys.sun
Subject: new patch for psraster
Message-ID: <8811112307.AA18192@teknowledge-vaxc.ARPA>
Date: 23 Nov 88 08:23:22 GMT
Sender: usenet@rice.edu
Reply-To: Sun-Spots@Rice.edu
Organization: Rice University, Houston, Texas
Lines: 60
Approved: Sun-Spots@rice.edu
Original-Date: 11 Nov 88 23:07:25 GMT
X-Sun-Spots-Digest: Volume 7, Issue 24, message 8 of 12