Article View: comp.lang.postscript
Article #57Semantic of `datasrc' in imagemask ? (Does Corel 3.0 generate illegal P
From: Peter Funk
Date: Thu, 29 Oct 1992 07:41
Date: Thu, 29 Oct 1992 07:41
39 lines
2595 bytes
2595 bytes
A while ago we had to redefine the 'imagemask' operator in postscript.
We stored all operands including the 'datasrc' procedure in a temporary
dictonary and called the procedure whenever we needed new image data.
Before calling it, we used to leave something on the operand stack for
our own needs.
A good time this worked fine emulating 'imagemask' with postscript from
many programs. To my very surprise my own imagemask procedure crashed
with postscript code from CorelDraw 3.0. The reason for this was easy
to find: They put all data in strings on the operand stack and after
that they call imagemask with a empty procedure (i.e. {}) as 'datasrc'.
This is okay for the builtin imagemask, because it does not use the
operand stack at all other than calling 'datasrc' and taking a string
from the stack after that. We found a workaround for this with a slight
loss of performance by fetching all our things from the op-stack before
we call 'datasrc' and puting them elsewhere.
Nevertheless we would like to know if this fashion of calling imagemask
shown by CorelDraw 3.0 is considered as legal postscript by the public
eye. In the PLRM 2.ed. you can read:
"imagemask uses the [...] and datasrc operands in precisely the same
way image uses them." (p. 435)
and
" If datasrc is a procedure, image executes datasrc repeatedly to
obtain the actual image data. datasrc must return (on the operand
stack) a string [...] of sample data." (p. 434)
Is it good postscript to put the image data on the stack and give image
or imagemask a empty datasrc procedure?
I would appriciate it if somebody could comment on this either public
or preferred by email to : crew@artcom0.north.de
Regards, Peter
Note: The usual "english_is_not_my_native_language"-disclaimer applies
to this "kraut"-babble.
-=-=-
Peter Funk \\ ArtCom GmbH, Schwachhauser Heerstr. 78, D-2800 Bremen 1
Work at home: Oldenburger Str.86, D-2875 Ganderkesee 1 / voice : top secret
Technical Details
Message-ID:
<4394@artcom0.north.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!uniol!artcom0!pfShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sol.ctr.columbia.edu!ira.uka.de!math.fu-berlin.de!uniol!artcom0!pf From: pf@artcom0.north.de (Peter Funk) Newsgroups: comp.lang.postscript Subject: Semantic of `datasrc' in imagemask ? (Does Corel 3.0 generate illegal P Summary: Corel Draw 3.0 seems to generate rather weird PostScript Keywords: Corel Draw, imagemask, datasrc, operand stack, PS-clones Message-ID: <4394@artcom0.north.de> Date: 29 Oct 92 07:41:17 GMT Article-I.D.: artcom0.4394 Reply-To: crew@artcom0.north.de Organization: ArtCom GmbH, Atelier f. Computergrafik, Bremen(FRG) Lines: 39