Article View: comp.lang.postscript
Article #5392Re: Setscreen question
From: Andrew Bernard
Date: Wed, 17 Apr 1991 19:39
Date: Wed, 17 Apr 1991 19:39
42 lines
2345 bytes
2345 bytes
In article <91106.223332CXT105@psuvm.psu.edu> CXT105@psuvm.psu.edu (Christopher Tate) writes:
>Does binding the procedure argument to setscreen have any effect? I.e. is
>
> 85 35 {dup mul exch dup mul add 1.0 exch sub} bind setscreen
>
>equivalent in function to
>
> 85 35 {dup mul exch dup mul add 1.0 exch sub} setscreen ?
>
>Does binding the spot function give incorrect results? If not, it seems
>like binding it should give an appreciable savings in speed, since it's
>called often. Or, it could be that the setscreen operator binds it itself,
>or some other part of the imaging system does. In that case, binding it
>would have essentially no effect....
>
>Which of the above is correct? :-)
>
It shouldn't give different results unless you've got a dictionary on the
dict stack which shadows the normal operator bindings. As far as speed, it
probably won't make any difference, since a good interpreter will compile
the results of the samples into its own internal matrix. So, I suspect
the sample procedure will only get called once for each pixel in the halftone
square, no matter how many times you render with it. Of course, if you're
changing the screen a lot, I suppose it could have an impact on performance,
but that's an unusual case.
BTW, a good interpreter will do a similar optimization for _settransfer_:
the procedure gets called once for each possible grey value (this is limited
by the interpreter's internal color representation and the size of the
halftone spot) and the results are stuffed into an array which is used later
to look up the actual color values.
Try putting _print_ operators into your screen procs and you can tell how
often they get called.
--
andrew bernard ring the doorbell on your mind
software engineer but it's locked from the outside
visix software -dinosaur jr.
andrew@visix.com
Technical Details
Message-ID:
<1991Apr17.193900.23920@visix.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!visix!andrewReferences:
<91106.223332CXT105@psuvm.psu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!visix!andrew From: andrew@visix.com (Andrew Bernard) Newsgroups: comp.lang.postscript Subject: Re: Setscreen question Message-ID: <1991Apr17.193900.23920@visix.com> Date: 17 Apr 91 19:39:00 GMT References: <91106.223332CXT105@psuvm.psu.edu> Organization: Visix Software Inc., Reston, VA Lines: 42