zellers@sun.soe.clarkson.edu (Steve Zellers) (02/21/89)
In my brief browsing of a local NeXT machine, I came across an extension to PostScript which I'd like to know more about. I saw it in a file called icon.ps which uses this quasi-PostScript primitive called "alphaimage". It is very similar to the RedBook PS primitive "image", but there is a twist. RedBook PostScript's image operator works like this: x y depth matrix proc image where: x, y are the dimensions of the image data. depth is either 1, 2, 4, or 8 levels of gray. matrix is the transformation matrix to apply to the image, (usually [x 0 0 y neg 0 y] to scale to unity and flip vertically) proc is called repeatedly and should return strings on the stack which are interpreted as image data. (usually { currentfile str readhexstring pop } where str is usually defined as "/str x depth mul 8 div string def" i.e. enough memory for one scanline.) alphaimage is the new NeXT primitive which looks like this: x y depth matrix proc1 proc2 bool number alphaimage where: x, y, depth and matrix are the same as in image. The question is: What does alphaimage do with the other parameters? I'm guessing it must combine the images generated from the two procs in some way dependant on the "bool" and "number", sort of the way a cursor image is generated from an image and a mask. A very small example (using contrived image data) below demonstrates legitimate usage of this operator. 4 4 2 [4 0 0 4 neg 0 4] {<AAA347FA>} {<AFFF0055>} true 1 alphaimage is there some boolean relationship which could fill in this table with equations involving "bool" and "number"? proc2 0 1 2 3 proc1 0 . . . . 1 . . . . 2 . . . . 3 . . . . Does it require knowledge about the destination image, i.e. for transparency (SRC AND !DST), or inversion (SRC XOR DST) and other rasterop codes which involve the destination? Is this all in the documentation? Thanks in advance. -Steve M. Zellers <zellers@sun.soe.clarkson.edu> /ps love {honk} if