Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!sdd.hp.com!mips!apple!well!shiva From: shiva@well.sf.ca.us (Kenneth Porter) Newsgroups: comp.lang.postscript Subject: Replacing the transfer function to get a negative Keywords: currenttransfer settransfer setgray negative Message-ID: <24507@well.sf.ca.us> Date: 30 Apr 91 08:48:57 GMT Distribution: comp Lines: 23 Remember that when changing the transfer function, you should carry along the old definition. It may contain code to compensate for a non-linear marking engine, or it may have been previously modified by an enclosing application to achieve a special effect. ================================================================ % We must call existing transfer function after ours % for proper mapping of user grays to device grays. /oldtransfer currenttransfer def % Function just subtracts requested gray from 1, then % calls device transfer function. { 1 exch sub oldtransfer } bind settransfer % init page to logical "white" gsave 1 setgray clippath fill grestore ================================================================ Ken (shiva@well.sf.ca.us)