Article View: comp.lang.postscript
Article #7821Re: Question on settransfer operator.
From: Tony Olekshy
Date: Sat, 14 Jan 1989 06:36
Date: Sat, 14 Jan 1989 06:36
34 lines
1533 bytes
1533 bytes
In <3648@phri.UUCP>, Roy Smith (roy@phri.UUCP) asks about settransfer:
>
> Does postscript automatically truncate grays to the 0-1 range...?
Good Question! [Paraphrased from Gene Rayburn, Match Game '76].
I tried the following on a NEC LC-890 SilentWriter and it seems to work.
Now we have a hypothesis. Anyone care to disprove it by counter-example?
Yours, etc., Tony Olekshy (...!alberta!oha!tony or tony@oha.UUCP).
% Cut Here ------------------------------------------------------------
72 dup scale /x 6.5 256 div def
/shade {
exch /a exch def /b exch a sub 1 exch div def
{ a sub b mul } settransfer
1 1 256 { /i exch def i 1 sub x mul 0 moveto
x 0 rlineto 0 1 rlineto x neg 0 rlineto closepath
i 1 sub 255 div setgray fill
} for
0 0 moveto 6.5 0 rlineto 0 1 rlineto -6.5 0 rlineto
closepath 1 300 div setlinewidth 0 setgray stroke
} def % shade
gsave 1 9 translate 0.0 1.0 shade grestore
gsave 1 8 translate 0.1 0.9 shade grestore showpage
% Cut Here -------------------------------------------------------------
Technical Details
Message-ID:
<296@oha.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!purdue!decwrl!pyramid!ncc!alberta!oha!tonyReferences:
<3648@phri.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!purdue!decwrl!pyramid!ncc!alberta!oha!tony From: tony@oha.UUCP (Tony Olekshy) Newsgroups: comp.lang.postscript Subject: Re: Question on settransfer operator. Summary: Here is a test program, it works on my 890. Message-ID: <296@oha.UUCP> Date: 14 Jan 89 06:36:45 GMT References: <3648@phri.UUCP> Organization: Olekshy Hoover & Associates Ltd., Edmonton,Alberta,Canada Lines: 34