[H-GEN] Laser Printer

Paul Gearon pag at tucanatech.com
Thu Mar 18 19:56:13 EST 2004


Tony Melia wrote:
> Can I ask a dumb question - how the hell does a complex image like that only
> take up 705 bytes of source??

PostScript is actually quite a powerful language... albeit one with an obscure 
syntax.  The code I posted (including the author's name - that man is a DUDE) 
does several complex things.

Firstly, it creates a dictionary to map all sorts of commands into single 
letters (sort of like macros).  Then it runs a little bit of code written with 
these single letter commands to decompress the block of data that forms the 
majority of the text.

The decompressed data forms code which is also written with the single letter 
macros.  This code does a raytrace rendering of a simple image.  The program 
jumps into this code, does the raytrace, and then upon exiting it executes a 
"showpage" so you can see what it did.

Thanks go to David Makepeace for pulling this code apart.  :-)

-- 
Regards,
Paul Gearon

Software Engineer                Telephone:   +61 7 3876 2188
Tucana Technologies              Fax:         +61 7 3876 4899
                                  http://www.tucanatech.com

Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum
immane mittam.
(Translation from latin: "I have a catapult. Give me all the money,
or I will fling an enormous rock at your head.")





More information about the General mailing list