Home » Archimedes archive » Zipped Apps » ArtWorks » !ArtWorks/Auto/!SPoolTool/SprProcs

!ArtWorks/Auto/!SPoolTool/SprProcs

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Zipped Apps » ArtWorks
Filename: !ArtWorks/Auto/!SPoolTool/SprProcs
Read OK:
File size: 113A bytes
Load address: 0000
Exec address: 0000
File contents
/s_gw{currentfile 4 string readhexstring pop dup 3 get exch dup 2 get exch
dup 1 get exch 0 get 24 bitshift exch 16 bitshift or exch 8 bitshift or or
}bind def/s_getbyte{currentfile 1 string readhexstring pop 0 get}bind def
/s_comparrays{/s_a2 exch def/s_a1 exch def/s_cindex 0 def/s_cbool true def
s_a1 length s_a2 length eq{s_a1{s_a2 s_cindex get eq s_cbool and/s_cbool
exch def/s_cindex s_cindex 1 add def}forall s_cbool}{false}ifelse}bind def
/s_paldict 256 array def 0 1 255{s_paldict exch dup[exch dup dup dup]put}for
/s_freshword{/s_word s_gw def/w_mask s_mask{s_gw}{-1}ifelse def/bitsleft 32
def}def/aes{}bd/ass{pop 1 eq{true}{false}ifelse/s_mask exch def/s_lastbit
exch def/s_firstbit exch def/s_width exch def/s_height exch def pop/s_y3
exch def/s_x3 exch def/s_y2 exch def/s_x2 exch def/s_y1 exch def/s_x1 exch
def/s_y0 exch def/s_x0 exch def pop/s_yeig exch def/s_xeig exch def
/s_pixheight exch def/s_pixwidth exch def/s_bpp exch def gsave[s_x3 s_x0 sub
s_pixwidth div s_y3 s_y0 sub s_pixwidth div s_x1 s_x0 sub s_pixheight div
s_y1 s_y0 sub s_pixheight div s_x0 s_y0]concat/s_andmask 2 s_bpp exp cvi 1
sub def currentfile token pop 1 sub 0 exch 1 exch{s_gw pop s_paldict exch
[currentfile token pop currentfile token pop currentfile token pop
currentfile token pop]put}for s_freshword/bitsleft bitsleft s_firstbit sub
def/s_word s_word s_firstbit neg bitshift def/w_mask w_mask s_firstbit neg
bitshift def s_pixheight 1 sub -1 0{/s_ypos exch def/s_whichpix 0 def{
/s_xpos s_whichpix def s_getpixel dup -2 eq{exit}if/s_run 1 def{dup
s_nextpixel eq{/s_run s_run 1 add def s_skippixel}{exit}ifelse}loop dup -1
ne{s_paldict exch get dup 0 get exch dup 1 get exch dup 2 get exch 3 get
setcmykcolor newpath s_xpos s_ypos moveto 0 1 rlineto s_run 0 rlineto 0 -1
rlineto s_run neg 0 rlineto closepath fill}{pop}ifelse}loop/bitsleft 0 def
}for grestore}bind def/s_gmask{/s_pixmask s_mask{currentfile read pop 49 eq}
{false}ifelse def}def/assd{pop 1 eq{true}{false}ifelse/s_mask exch def
/s_lastbit exch def/s_firstbit exch def/s_width exch def/s_height exch def
pop/s_y3 exch def/s_x3 exch def/s_y2 exch def/s_x2 exch def/s_y1 exch def
/s_x1 exch def/s_y0 exch def/s_x0 exch def pop/s_yeig exch def/s_xeig exch
def/s_pixheight exch def/s_pixwidth exch def/s_bpp exch def s_bpp 16 eq{
/s_numchans 3 def/s_pixcol s_numchans array def/s_gpix{s_getbyte s_getbyte 8
bitshift or s_pixcol 0 2 index 31 and 31 div put -5 bitshift s_pixcol 1 2
index 31 and 31 div put -5 bitshift s_pixcol 2 2 index 31 and 31 div put pop
}def/s_pixelcolour{s_pixcol aload pop setrgbcolor}def}if s_bpp 24 eq{
/s_numchans 3 def/s_pixcol s_numchans array def/s_gpix{s_pixcol 0 s_getbyte
255 div put s_pixcol 1 s_getbyte 255 div put s_pixcol 2 s_getbyte 255 div
put}def/s_pixelcolour{s_pixcol aload pop setrgbcolor}def}if s_bpp 32 eq{
/s_numchans 4 def/s_pixcol s_numchans array def/s_gpix{s_pixcol 0 s_getbyte
255 div put s_pixcol 1 s_getbyte 255 div put s_pixcol 2 s_getbyte 255 div
put s_pixcol 3 s_getbyte 255 div put}def/s_pixelcolour{s_pixcol aload pop
setcmykcolor}def}if gsave[s_x3 s_x0 sub s_pixwidth div s_y3 s_y0 sub
s_pixwidth div s_x1 s_x0 sub s_pixheight div s_y1 s_y0 sub s_pixheight div
s_x0 s_y0]concat s_bpp 32 eq{1024}{768}ifelse{s_getbyte pop}repeat
s_pixheight 1 sub -1 0{/s_ypos exch def/s_whichpix 0 def{/s_xpos s_whichpix
def s_xpos s_pixwidth eq{exit}if s_gpix s_gmask s_pixmask not{s_pixelcolour
newpath s_xpos s_ypos moveto 0 1 rlineto 1 0 rlineto 0 -1 rlineto -1 0
rlineto closepath fill}{}ifelse/s_whichpix s_whichpix 1 add def}loop}for
grestore}bind def/s_getdeeppixel{s_whichpix s_pixwidth eq{-2}{bitsleft 0 eq
{s_freshword}if s_word s_andmask and w_mask s_andmask and 0 eq{pop -1}if
/s_word s_word s_bpp neg bitshift def/w_mask w_mask s_bpp neg bitshift def
/bitsleft bitsleft s_bpp sub def/s_whichpix s_whichpix 1 add def}ifelse}def
/s_getpixel{s_whichpix s_pixwidth eq{-2}{bitsleft 0 eq{s_freshword}if s_word
s_andmask and w_mask s_andmask and 0 eq{pop -1}if/s_word s_word s_bpp neg
bitshift def/w_mask w_mask s_bpp neg bitshift def/bitsleft bitsleft s_bpp
sub def/s_whichpix s_whichpix 1 add def}ifelse}def/s_nextpixel{s_whichpix
s_pixwidth eq{-2}{bitsleft 0 eq{s_freshword}if s_word s_andmask and w_mask
s_andmask and 0 eq{pop -1}if}ifelse}def/s_skippixel{/s_word s_word s_bpp neg
bitshift def/w_mask w_mask s_bpp neg bitshift def/bitsleft bitsleft s_bpp
sub def/s_whichpix s_whichpix 1 add def}def
00000000  2f 73 5f 67 77 7b 63 75  72 72 65 6e 74 66 69 6c  |/s_gw{currentfil|
00000010  65 20 34 20 73 74 72 69  6e 67 20 72 65 61 64 68  |e 4 string readh|
00000020  65 78 73 74 72 69 6e 67  20 70 6f 70 20 64 75 70  |exstring pop dup|
00000030  20 33 20 67 65 74 20 65  78 63 68 20 64 75 70 20  | 3 get exch dup |
00000040  32 20 67 65 74 20 65 78  63 68 0a 64 75 70 20 31  |2 get exch.dup 1|
00000050  20 67 65 74 20 65 78 63  68 20 30 20 67 65 74 20  | get exch 0 get |
00000060  32 34 20 62 69 74 73 68  69 66 74 20 65 78 63 68  |24 bitshift exch|
00000070  20 31 36 20 62 69 74 73  68 69 66 74 20 6f 72 20  | 16 bitshift or |
00000080  65 78 63 68 20 38 20 62  69 74 73 68 69 66 74 20  |exch 8 bitshift |
00000090  6f 72 20 6f 72 0a 7d 62  69 6e 64 20 64 65 66 2f  |or or.}bind def/|
000000a0  73 5f 67 65 74 62 79 74  65 7b 63 75 72 72 65 6e  |s_getbyte{curren|
000000b0  74 66 69 6c 65 20 31 20  73 74 72 69 6e 67 20 72  |tfile 1 string r|
000000c0  65 61 64 68 65 78 73 74  72 69 6e 67 20 70 6f 70  |eadhexstring pop|
000000d0  20 30 20 67 65 74 7d 62  69 6e 64 20 64 65 66 0a  | 0 get}bind def.|
000000e0  2f 73 5f 63 6f 6d 70 61  72 72 61 79 73 7b 2f 73  |/s_comparrays{/s|
000000f0  5f 61 32 20 65 78 63 68  20 64 65 66 2f 73 5f 61  |_a2 exch def/s_a|
00000100  31 20 65 78 63 68 20 64  65 66 2f 73 5f 63 69 6e  |1 exch def/s_cin|
00000110  64 65 78 20 30 20 64 65  66 2f 73 5f 63 62 6f 6f  |dex 0 def/s_cboo|
00000120  6c 20 74 72 75 65 20 64  65 66 0a 73 5f 61 31 20  |l true def.s_a1 |
00000130  6c 65 6e 67 74 68 20 73  5f 61 32 20 6c 65 6e 67  |length s_a2 leng|
00000140  74 68 20 65 71 7b 73 5f  61 31 7b 73 5f 61 32 20  |th eq{s_a1{s_a2 |
00000150  73 5f 63 69 6e 64 65 78  20 67 65 74 20 65 71 20  |s_cindex get eq |
00000160  73 5f 63 62 6f 6f 6c 20  61 6e 64 2f 73 5f 63 62  |s_cbool and/s_cb|
00000170  6f 6f 6c 0a 65 78 63 68  20 64 65 66 2f 73 5f 63  |ool.exch def/s_c|
00000180  69 6e 64 65 78 20 73 5f  63 69 6e 64 65 78 20 31  |index s_cindex 1|
00000190  20 61 64 64 20 64 65 66  7d 66 6f 72 61 6c 6c 20  | add def}forall |
000001a0  73 5f 63 62 6f 6f 6c 7d  7b 66 61 6c 73 65 7d 69  |s_cbool}{false}i|
000001b0  66 65 6c 73 65 7d 62 69  6e 64 20 64 65 66 0a 2f  |felse}bind def./|
000001c0  73 5f 70 61 6c 64 69 63  74 20 32 35 36 20 61 72  |s_paldict 256 ar|
000001d0  72 61 79 20 64 65 66 20  30 20 31 20 32 35 35 7b  |ray def 0 1 255{|
000001e0  73 5f 70 61 6c 64 69 63  74 20 65 78 63 68 20 64  |s_paldict exch d|
000001f0  75 70 5b 65 78 63 68 20  64 75 70 20 64 75 70 20  |up[exch dup dup |
00000200  64 75 70 5d 70 75 74 7d  66 6f 72 0a 2f 73 5f 66  |dup]put}for./s_f|
00000210  72 65 73 68 77 6f 72 64  7b 2f 73 5f 77 6f 72 64  |reshword{/s_word|
00000220  20 73 5f 67 77 20 64 65  66 2f 77 5f 6d 61 73 6b  | s_gw def/w_mask|
00000230  20 73 5f 6d 61 73 6b 7b  73 5f 67 77 7d 7b 2d 31  | s_mask{s_gw}{-1|
00000240  7d 69 66 65 6c 73 65 20  64 65 66 2f 62 69 74 73  |}ifelse def/bits|
00000250  6c 65 66 74 20 33 32 0a  64 65 66 7d 64 65 66 2f  |left 32.def}def/|
00000260  61 65 73 7b 7d 62 64 2f  61 73 73 7b 70 6f 70 20  |aes{}bd/ass{pop |
00000270  31 20 65 71 7b 74 72 75  65 7d 7b 66 61 6c 73 65  |1 eq{true}{false|
00000280  7d 69 66 65 6c 73 65 2f  73 5f 6d 61 73 6b 20 65  |}ifelse/s_mask e|
00000290  78 63 68 20 64 65 66 2f  73 5f 6c 61 73 74 62 69  |xch def/s_lastbi|
000002a0  74 0a 65 78 63 68 20 64  65 66 2f 73 5f 66 69 72  |t.exch def/s_fir|
000002b0  73 74 62 69 74 20 65 78  63 68 20 64 65 66 2f 73  |stbit exch def/s|
000002c0  5f 77 69 64 74 68 20 65  78 63 68 20 64 65 66 2f  |_width exch def/|
000002d0  73 5f 68 65 69 67 68 74  20 65 78 63 68 20 64 65  |s_height exch de|
000002e0  66 20 70 6f 70 2f 73 5f  79 33 0a 65 78 63 68 20  |f pop/s_y3.exch |
000002f0  64 65 66 2f 73 5f 78 33  20 65 78 63 68 20 64 65  |def/s_x3 exch de|
00000300  66 2f 73 5f 79 32 20 65  78 63 68 20 64 65 66 2f  |f/s_y2 exch def/|
00000310  73 5f 78 32 20 65 78 63  68 20 64 65 66 2f 73 5f  |s_x2 exch def/s_|
00000320  79 31 20 65 78 63 68 20  64 65 66 2f 73 5f 78 31  |y1 exch def/s_x1|
00000330  20 65 78 63 68 0a 64 65  66 2f 73 5f 79 30 20 65  | exch.def/s_y0 e|
00000340  78 63 68 20 64 65 66 2f  73 5f 78 30 20 65 78 63  |xch def/s_x0 exc|
00000350  68 20 64 65 66 20 70 6f  70 2f 73 5f 79 65 69 67  |h def pop/s_yeig|
00000360  20 65 78 63 68 20 64 65  66 2f 73 5f 78 65 69 67  | exch def/s_xeig|
00000370  20 65 78 63 68 20 64 65  66 0a 2f 73 5f 70 69 78  | exch def./s_pix|
00000380  68 65 69 67 68 74 20 65  78 63 68 20 64 65 66 2f  |height exch def/|
00000390  73 5f 70 69 78 77 69 64  74 68 20 65 78 63 68 20  |s_pixwidth exch |
000003a0  64 65 66 2f 73 5f 62 70  70 20 65 78 63 68 20 64  |def/s_bpp exch d|
000003b0  65 66 20 67 73 61 76 65  5b 73 5f 78 33 20 73 5f  |ef gsave[s_x3 s_|
000003c0  78 30 20 73 75 62 0a 73  5f 70 69 78 77 69 64 74  |x0 sub.s_pixwidt|
000003d0  68 20 64 69 76 20 73 5f  79 33 20 73 5f 79 30 20  |h div s_y3 s_y0 |
000003e0  73 75 62 20 73 5f 70 69  78 77 69 64 74 68 20 64  |sub s_pixwidth d|
000003f0  69 76 20 73 5f 78 31 20  73 5f 78 30 20 73 75 62  |iv s_x1 s_x0 sub|
00000400  20 73 5f 70 69 78 68 65  69 67 68 74 20 64 69 76  | s_pixheight div|
00000410  0a 73 5f 79 31 20 73 5f  79 30 20 73 75 62 20 73  |.s_y1 s_y0 sub s|
00000420  5f 70 69 78 68 65 69 67  68 74 20 64 69 76 20 73  |_pixheight div s|
00000430  5f 78 30 20 73 5f 79 30  5d 63 6f 6e 63 61 74 2f  |_x0 s_y0]concat/|
00000440  73 5f 61 6e 64 6d 61 73  6b 20 32 20 73 5f 62 70  |s_andmask 2 s_bp|
00000450  70 20 65 78 70 20 63 76  69 20 31 0a 73 75 62 20  |p exp cvi 1.sub |
00000460  64 65 66 20 63 75 72 72  65 6e 74 66 69 6c 65 20  |def currentfile |
00000470  74 6f 6b 65 6e 20 70 6f  70 20 31 20 73 75 62 20  |token pop 1 sub |
00000480  30 20 65 78 63 68 20 31  20 65 78 63 68 7b 73 5f  |0 exch 1 exch{s_|
00000490  67 77 20 70 6f 70 20 73  5f 70 61 6c 64 69 63 74  |gw pop s_paldict|
000004a0  20 65 78 63 68 0a 5b 63  75 72 72 65 6e 74 66 69  | exch.[currentfi|
000004b0  6c 65 20 74 6f 6b 65 6e  20 70 6f 70 20 63 75 72  |le token pop cur|
000004c0  72 65 6e 74 66 69 6c 65  20 74 6f 6b 65 6e 20 70  |rentfile token p|
000004d0  6f 70 20 63 75 72 72 65  6e 74 66 69 6c 65 20 74  |op currentfile t|
000004e0  6f 6b 65 6e 20 70 6f 70  0a 63 75 72 72 65 6e 74  |oken pop.current|
000004f0  66 69 6c 65 20 74 6f 6b  65 6e 20 70 6f 70 5d 70  |file token pop]p|
00000500  75 74 7d 66 6f 72 20 73  5f 66 72 65 73 68 77 6f  |ut}for s_freshwo|
00000510  72 64 2f 62 69 74 73 6c  65 66 74 20 62 69 74 73  |rd/bitsleft bits|
00000520  6c 65 66 74 20 73 5f 66  69 72 73 74 62 69 74 20  |left s_firstbit |
00000530  73 75 62 0a 64 65 66 2f  73 5f 77 6f 72 64 20 73  |sub.def/s_word s|
00000540  5f 77 6f 72 64 20 73 5f  66 69 72 73 74 62 69 74  |_word s_firstbit|
00000550  20 6e 65 67 20 62 69 74  73 68 69 66 74 20 64 65  | neg bitshift de|
00000560  66 2f 77 5f 6d 61 73 6b  20 77 5f 6d 61 73 6b 20  |f/w_mask w_mask |
00000570  73 5f 66 69 72 73 74 62  69 74 20 6e 65 67 0a 62  |s_firstbit neg.b|
00000580  69 74 73 68 69 66 74 20  64 65 66 20 73 5f 70 69  |itshift def s_pi|
00000590  78 68 65 69 67 68 74 20  31 20 73 75 62 20 2d 31  |xheight 1 sub -1|
000005a0  20 30 7b 2f 73 5f 79 70  6f 73 20 65 78 63 68 20  | 0{/s_ypos exch |
000005b0  64 65 66 2f 73 5f 77 68  69 63 68 70 69 78 20 30  |def/s_whichpix 0|
000005c0  20 64 65 66 7b 0a 2f 73  5f 78 70 6f 73 20 73 5f  | def{./s_xpos s_|
000005d0  77 68 69 63 68 70 69 78  20 64 65 66 20 73 5f 67  |whichpix def s_g|
000005e0  65 74 70 69 78 65 6c 20  64 75 70 20 2d 32 20 65  |etpixel dup -2 e|
000005f0  71 7b 65 78 69 74 7d 69  66 2f 73 5f 72 75 6e 20  |q{exit}if/s_run |
00000600  31 20 64 65 66 7b 64 75  70 0a 73 5f 6e 65 78 74  |1 def{dup.s_next|
00000610  70 69 78 65 6c 20 65 71  7b 2f 73 5f 72 75 6e 20  |pixel eq{/s_run |
00000620  73 5f 72 75 6e 20 31 20  61 64 64 20 64 65 66 20  |s_run 1 add def |
00000630  73 5f 73 6b 69 70 70 69  78 65 6c 7d 7b 65 78 69  |s_skippixel}{exi|
00000640  74 7d 69 66 65 6c 73 65  7d 6c 6f 6f 70 20 64 75  |t}ifelse}loop du|
00000650  70 20 2d 31 0a 6e 65 7b  73 5f 70 61 6c 64 69 63  |p -1.ne{s_paldic|
00000660  74 20 65 78 63 68 20 67  65 74 20 64 75 70 20 30  |t exch get dup 0|
00000670  20 67 65 74 20 65 78 63  68 20 64 75 70 20 31 20  | get exch dup 1 |
00000680  67 65 74 20 65 78 63 68  20 64 75 70 20 32 20 67  |get exch dup 2 g|
00000690  65 74 20 65 78 63 68 20  33 20 67 65 74 0a 73 65  |et exch 3 get.se|
000006a0  74 63 6d 79 6b 63 6f 6c  6f 72 20 6e 65 77 70 61  |tcmykcolor newpa|
000006b0  74 68 20 73 5f 78 70 6f  73 20 73 5f 79 70 6f 73  |th s_xpos s_ypos|
000006c0  20 6d 6f 76 65 74 6f 20  30 20 31 20 72 6c 69 6e  | moveto 0 1 rlin|
000006d0  65 74 6f 20 73 5f 72 75  6e 20 30 20 72 6c 69 6e  |eto s_run 0 rlin|
000006e0  65 74 6f 20 30 20 2d 31  0a 72 6c 69 6e 65 74 6f  |eto 0 -1.rlineto|
000006f0  20 73 5f 72 75 6e 20 6e  65 67 20 30 20 72 6c 69  | s_run neg 0 rli|
00000700  6e 65 74 6f 20 63 6c 6f  73 65 70 61 74 68 20 66  |neto closepath f|
00000710  69 6c 6c 7d 7b 70 6f 70  7d 69 66 65 6c 73 65 7d  |ill}{pop}ifelse}|
00000720  6c 6f 6f 70 2f 62 69 74  73 6c 65 66 74 20 30 20  |loop/bitsleft 0 |
00000730  64 65 66 0a 7d 66 6f 72  20 67 72 65 73 74 6f 72  |def.}for grestor|
00000740  65 7d 62 69 6e 64 20 64  65 66 2f 73 5f 67 6d 61  |e}bind def/s_gma|
00000750  73 6b 7b 2f 73 5f 70 69  78 6d 61 73 6b 20 73 5f  |sk{/s_pixmask s_|
00000760  6d 61 73 6b 7b 63 75 72  72 65 6e 74 66 69 6c 65  |mask{currentfile|
00000770  20 72 65 61 64 20 70 6f  70 20 34 39 20 65 71 7d  | read pop 49 eq}|
00000780  0a 7b 66 61 6c 73 65 7d  69 66 65 6c 73 65 20 64  |.{false}ifelse d|
00000790  65 66 7d 64 65 66 2f 61  73 73 64 7b 70 6f 70 20  |ef}def/assd{pop |
000007a0  31 20 65 71 7b 74 72 75  65 7d 7b 66 61 6c 73 65  |1 eq{true}{false|
000007b0  7d 69 66 65 6c 73 65 2f  73 5f 6d 61 73 6b 20 65  |}ifelse/s_mask e|
000007c0  78 63 68 20 64 65 66 0a  2f 73 5f 6c 61 73 74 62  |xch def./s_lastb|
000007d0  69 74 20 65 78 63 68 20  64 65 66 2f 73 5f 66 69  |it exch def/s_fi|
000007e0  72 73 74 62 69 74 20 65  78 63 68 20 64 65 66 2f  |rstbit exch def/|
000007f0  73 5f 77 69 64 74 68 20  65 78 63 68 20 64 65 66  |s_width exch def|
00000800  2f 73 5f 68 65 69 67 68  74 20 65 78 63 68 20 64  |/s_height exch d|
00000810  65 66 0a 70 6f 70 2f 73  5f 79 33 20 65 78 63 68  |ef.pop/s_y3 exch|
00000820  20 64 65 66 2f 73 5f 78  33 20 65 78 63 68 20 64  | def/s_x3 exch d|
00000830  65 66 2f 73 5f 79 32 20  65 78 63 68 20 64 65 66  |ef/s_y2 exch def|
00000840  2f 73 5f 78 32 20 65 78  63 68 20 64 65 66 2f 73  |/s_x2 exch def/s|
00000850  5f 79 31 20 65 78 63 68  20 64 65 66 0a 2f 73 5f  |_y1 exch def./s_|
00000860  78 31 20 65 78 63 68 20  64 65 66 2f 73 5f 79 30  |x1 exch def/s_y0|
00000870  20 65 78 63 68 20 64 65  66 2f 73 5f 78 30 20 65  | exch def/s_x0 e|
00000880  78 63 68 20 64 65 66 20  70 6f 70 2f 73 5f 79 65  |xch def pop/s_ye|
00000890  69 67 20 65 78 63 68 20  64 65 66 2f 73 5f 78 65  |ig exch def/s_xe|
000008a0  69 67 20 65 78 63 68 0a  64 65 66 2f 73 5f 70 69  |ig exch.def/s_pi|
000008b0  78 68 65 69 67 68 74 20  65 78 63 68 20 64 65 66  |xheight exch def|
000008c0  2f 73 5f 70 69 78 77 69  64 74 68 20 65 78 63 68  |/s_pixwidth exch|
000008d0  20 64 65 66 2f 73 5f 62  70 70 20 65 78 63 68 20  | def/s_bpp exch |
000008e0  64 65 66 20 73 5f 62 70  70 20 31 36 20 65 71 7b  |def s_bpp 16 eq{|
000008f0  0a 2f 73 5f 6e 75 6d 63  68 61 6e 73 20 33 20 64  |./s_numchans 3 d|
00000900  65 66 2f 73 5f 70 69 78  63 6f 6c 20 73 5f 6e 75  |ef/s_pixcol s_nu|
00000910  6d 63 68 61 6e 73 20 61  72 72 61 79 20 64 65 66  |mchans array def|
00000920  2f 73 5f 67 70 69 78 7b  73 5f 67 65 74 62 79 74  |/s_gpix{s_getbyt|
00000930  65 20 73 5f 67 65 74 62  79 74 65 20 38 0a 62 69  |e s_getbyte 8.bi|
00000940  74 73 68 69 66 74 20 6f  72 20 73 5f 70 69 78 63  |tshift or s_pixc|
00000950  6f 6c 20 30 20 32 20 69  6e 64 65 78 20 33 31 20  |ol 0 2 index 31 |
00000960  61 6e 64 20 33 31 20 64  69 76 20 70 75 74 20 2d  |and 31 div put -|
00000970  35 20 62 69 74 73 68 69  66 74 20 73 5f 70 69 78  |5 bitshift s_pix|
00000980  63 6f 6c 20 31 20 32 0a  69 6e 64 65 78 20 33 31  |col 1 2.index 31|
00000990  20 61 6e 64 20 33 31 20  64 69 76 20 70 75 74 20  | and 31 div put |
000009a0  2d 35 20 62 69 74 73 68  69 66 74 20 73 5f 70 69  |-5 bitshift s_pi|
000009b0  78 63 6f 6c 20 32 20 32  20 69 6e 64 65 78 20 33  |xcol 2 2 index 3|
000009c0  31 20 61 6e 64 20 33 31  20 64 69 76 20 70 75 74  |1 and 31 div put|
000009d0  20 70 6f 70 0a 7d 64 65  66 2f 73 5f 70 69 78 65  | pop.}def/s_pixe|
000009e0  6c 63 6f 6c 6f 75 72 7b  73 5f 70 69 78 63 6f 6c  |lcolour{s_pixcol|
000009f0  20 61 6c 6f 61 64 20 70  6f 70 20 73 65 74 72 67  | aload pop setrg|
00000a00  62 63 6f 6c 6f 72 7d 64  65 66 7d 69 66 20 73 5f  |bcolor}def}if s_|
00000a10  62 70 70 20 32 34 20 65  71 7b 0a 2f 73 5f 6e 75  |bpp 24 eq{./s_nu|
00000a20  6d 63 68 61 6e 73 20 33  20 64 65 66 2f 73 5f 70  |mchans 3 def/s_p|
00000a30  69 78 63 6f 6c 20 73 5f  6e 75 6d 63 68 61 6e 73  |ixcol s_numchans|
00000a40  20 61 72 72 61 79 20 64  65 66 2f 73 5f 67 70 69  | array def/s_gpi|
00000a50  78 7b 73 5f 70 69 78 63  6f 6c 20 30 20 73 5f 67  |x{s_pixcol 0 s_g|
00000a60  65 74 62 79 74 65 0a 32  35 35 20 64 69 76 20 70  |etbyte.255 div p|
00000a70  75 74 20 73 5f 70 69 78  63 6f 6c 20 31 20 73 5f  |ut s_pixcol 1 s_|
00000a80  67 65 74 62 79 74 65 20  32 35 35 20 64 69 76 20  |getbyte 255 div |
00000a90  70 75 74 20 73 5f 70 69  78 63 6f 6c 20 32 20 73  |put s_pixcol 2 s|
00000aa0  5f 67 65 74 62 79 74 65  20 32 35 35 20 64 69 76  |_getbyte 255 div|
00000ab0  0a 70 75 74 7d 64 65 66  2f 73 5f 70 69 78 65 6c  |.put}def/s_pixel|
00000ac0  63 6f 6c 6f 75 72 7b 73  5f 70 69 78 63 6f 6c 20  |colour{s_pixcol |
00000ad0  61 6c 6f 61 64 20 70 6f  70 20 73 65 74 72 67 62  |aload pop setrgb|
00000ae0  63 6f 6c 6f 72 7d 64 65  66 7d 69 66 20 73 5f 62  |color}def}if s_b|
00000af0  70 70 20 33 32 20 65 71  7b 0a 2f 73 5f 6e 75 6d  |pp 32 eq{./s_num|
00000b00  63 68 61 6e 73 20 34 20  64 65 66 2f 73 5f 70 69  |chans 4 def/s_pi|
00000b10  78 63 6f 6c 20 73 5f 6e  75 6d 63 68 61 6e 73 20  |xcol s_numchans |
00000b20  61 72 72 61 79 20 64 65  66 2f 73 5f 67 70 69 78  |array def/s_gpix|
00000b30  7b 73 5f 70 69 78 63 6f  6c 20 30 20 73 5f 67 65  |{s_pixcol 0 s_ge|
00000b40  74 62 79 74 65 0a 32 35  35 20 64 69 76 20 70 75  |tbyte.255 div pu|
00000b50  74 20 73 5f 70 69 78 63  6f 6c 20 31 20 73 5f 67  |t s_pixcol 1 s_g|
00000b60  65 74 62 79 74 65 20 32  35 35 20 64 69 76 20 70  |etbyte 255 div p|
00000b70  75 74 20 73 5f 70 69 78  63 6f 6c 20 32 20 73 5f  |ut s_pixcol 2 s_|
00000b80  67 65 74 62 79 74 65 20  32 35 35 20 64 69 76 0a  |getbyte 255 div.|
00000b90  70 75 74 20 73 5f 70 69  78 63 6f 6c 20 33 20 73  |put s_pixcol 3 s|
00000ba0  5f 67 65 74 62 79 74 65  20 32 35 35 20 64 69 76  |_getbyte 255 div|
00000bb0  20 70 75 74 7d 64 65 66  2f 73 5f 70 69 78 65 6c  | put}def/s_pixel|
00000bc0  63 6f 6c 6f 75 72 7b 73  5f 70 69 78 63 6f 6c 20  |colour{s_pixcol |
00000bd0  61 6c 6f 61 64 20 70 6f  70 0a 73 65 74 63 6d 79  |aload pop.setcmy|
00000be0  6b 63 6f 6c 6f 72 7d 64  65 66 7d 69 66 20 67 73  |kcolor}def}if gs|
00000bf0  61 76 65 5b 73 5f 78 33  20 73 5f 78 30 20 73 75  |ave[s_x3 s_x0 su|
00000c00  62 20 73 5f 70 69 78 77  69 64 74 68 20 64 69 76  |b s_pixwidth div|
00000c10  20 73 5f 79 33 20 73 5f  79 30 20 73 75 62 0a 73  | s_y3 s_y0 sub.s|
00000c20  5f 70 69 78 77 69 64 74  68 20 64 69 76 20 73 5f  |_pixwidth div s_|
00000c30  78 31 20 73 5f 78 30 20  73 75 62 20 73 5f 70 69  |x1 s_x0 sub s_pi|
00000c40  78 68 65 69 67 68 74 20  64 69 76 20 73 5f 79 31  |xheight div s_y1|
00000c50  20 73 5f 79 30 20 73 75  62 20 73 5f 70 69 78 68  | s_y0 sub s_pixh|
00000c60  65 69 67 68 74 20 64 69  76 0a 73 5f 78 30 20 73  |eight div.s_x0 s|
00000c70  5f 79 30 5d 63 6f 6e 63  61 74 20 73 5f 62 70 70  |_y0]concat s_bpp|
00000c80  20 33 32 20 65 71 7b 31  30 32 34 7d 7b 37 36 38  | 32 eq{1024}{768|
00000c90  7d 69 66 65 6c 73 65 7b  73 5f 67 65 74 62 79 74  |}ifelse{s_getbyt|
00000ca0  65 20 70 6f 70 7d 72 65  70 65 61 74 0a 73 5f 70  |e pop}repeat.s_p|
00000cb0  69 78 68 65 69 67 68 74  20 31 20 73 75 62 20 2d  |ixheight 1 sub -|
00000cc0  31 20 30 7b 2f 73 5f 79  70 6f 73 20 65 78 63 68  |1 0{/s_ypos exch|
00000cd0  20 64 65 66 2f 73 5f 77  68 69 63 68 70 69 78 20  | def/s_whichpix |
00000ce0  30 20 64 65 66 7b 2f 73  5f 78 70 6f 73 20 73 5f  |0 def{/s_xpos s_|
00000cf0  77 68 69 63 68 70 69 78  0a 64 65 66 20 73 5f 78  |whichpix.def s_x|
00000d00  70 6f 73 20 73 5f 70 69  78 77 69 64 74 68 20 65  |pos s_pixwidth e|
00000d10  71 7b 65 78 69 74 7d 69  66 20 73 5f 67 70 69 78  |q{exit}if s_gpix|
00000d20  20 73 5f 67 6d 61 73 6b  20 73 5f 70 69 78 6d 61  | s_gmask s_pixma|
00000d30  73 6b 20 6e 6f 74 7b 73  5f 70 69 78 65 6c 63 6f  |sk not{s_pixelco|
00000d40  6c 6f 75 72 0a 6e 65 77  70 61 74 68 20 73 5f 78  |lour.newpath s_x|
00000d50  70 6f 73 20 73 5f 79 70  6f 73 20 6d 6f 76 65 74  |pos s_ypos movet|
00000d60  6f 20 30 20 31 20 72 6c  69 6e 65 74 6f 20 31 20  |o 0 1 rlineto 1 |
00000d70  30 20 72 6c 69 6e 65 74  6f 20 30 20 2d 31 20 72  |0 rlineto 0 -1 r|
00000d80  6c 69 6e 65 74 6f 20 2d  31 20 30 0a 72 6c 69 6e  |lineto -1 0.rlin|
00000d90  65 74 6f 20 63 6c 6f 73  65 70 61 74 68 20 66 69  |eto closepath fi|
00000da0  6c 6c 7d 7b 7d 69 66 65  6c 73 65 2f 73 5f 77 68  |ll}{}ifelse/s_wh|
00000db0  69 63 68 70 69 78 20 73  5f 77 68 69 63 68 70 69  |ichpix s_whichpi|
00000dc0  78 20 31 20 61 64 64 20  64 65 66 7d 6c 6f 6f 70  |x 1 add def}loop|
00000dd0  7d 66 6f 72 0a 67 72 65  73 74 6f 72 65 7d 62 69  |}for.grestore}bi|
00000de0  6e 64 20 64 65 66 2f 73  5f 67 65 74 64 65 65 70  |nd def/s_getdeep|
00000df0  70 69 78 65 6c 7b 73 5f  77 68 69 63 68 70 69 78  |pixel{s_whichpix|
00000e00  20 73 5f 70 69 78 77 69  64 74 68 20 65 71 7b 2d  | s_pixwidth eq{-|
00000e10  32 7d 7b 62 69 74 73 6c  65 66 74 20 30 20 65 71  |2}{bitsleft 0 eq|
00000e20  0a 7b 73 5f 66 72 65 73  68 77 6f 72 64 7d 69 66  |.{s_freshword}if|
00000e30  20 73 5f 77 6f 72 64 20  73 5f 61 6e 64 6d 61 73  | s_word s_andmas|
00000e40  6b 20 61 6e 64 20 77 5f  6d 61 73 6b 20 73 5f 61  |k and w_mask s_a|
00000e50  6e 64 6d 61 73 6b 20 61  6e 64 20 30 20 65 71 7b  |ndmask and 0 eq{|
00000e60  70 6f 70 20 2d 31 7d 69  66 0a 2f 73 5f 77 6f 72  |pop -1}if./s_wor|
00000e70  64 20 73 5f 77 6f 72 64  20 73 5f 62 70 70 20 6e  |d s_word s_bpp n|
00000e80  65 67 20 62 69 74 73 68  69 66 74 20 64 65 66 2f  |eg bitshift def/|
00000e90  77 5f 6d 61 73 6b 20 77  5f 6d 61 73 6b 20 73 5f  |w_mask w_mask s_|
00000ea0  62 70 70 20 6e 65 67 20  62 69 74 73 68 69 66 74  |bpp neg bitshift|
00000eb0  20 64 65 66 0a 2f 62 69  74 73 6c 65 66 74 20 62  | def./bitsleft b|
00000ec0  69 74 73 6c 65 66 74 20  73 5f 62 70 70 20 73 75  |itsleft s_bpp su|
00000ed0  62 20 64 65 66 2f 73 5f  77 68 69 63 68 70 69 78  |b def/s_whichpix|
00000ee0  20 73 5f 77 68 69 63 68  70 69 78 20 31 20 61 64  | s_whichpix 1 ad|
00000ef0  64 20 64 65 66 7d 69 66  65 6c 73 65 7d 64 65 66  |d def}ifelse}def|
00000f00  0a 2f 73 5f 67 65 74 70  69 78 65 6c 7b 73 5f 77  |./s_getpixel{s_w|
00000f10  68 69 63 68 70 69 78 20  73 5f 70 69 78 77 69 64  |hichpix s_pixwid|
00000f20  74 68 20 65 71 7b 2d 32  7d 7b 62 69 74 73 6c 65  |th eq{-2}{bitsle|
00000f30  66 74 20 30 20 65 71 7b  73 5f 66 72 65 73 68 77  |ft 0 eq{s_freshw|
00000f40  6f 72 64 7d 69 66 20 73  5f 77 6f 72 64 0a 73 5f  |ord}if s_word.s_|
00000f50  61 6e 64 6d 61 73 6b 20  61 6e 64 20 77 5f 6d 61  |andmask and w_ma|
00000f60  73 6b 20 73 5f 61 6e 64  6d 61 73 6b 20 61 6e 64  |sk s_andmask and|
00000f70  20 30 20 65 71 7b 70 6f  70 20 2d 31 7d 69 66 2f  | 0 eq{pop -1}if/|
00000f80  73 5f 77 6f 72 64 20 73  5f 77 6f 72 64 20 73 5f  |s_word s_word s_|
00000f90  62 70 70 20 6e 65 67 0a  62 69 74 73 68 69 66 74  |bpp neg.bitshift|
00000fa0  20 64 65 66 2f 77 5f 6d  61 73 6b 20 77 5f 6d 61  | def/w_mask w_ma|
00000fb0  73 6b 20 73 5f 62 70 70  20 6e 65 67 20 62 69 74  |sk s_bpp neg bit|
00000fc0  73 68 69 66 74 20 64 65  66 2f 62 69 74 73 6c 65  |shift def/bitsle|
00000fd0  66 74 20 62 69 74 73 6c  65 66 74 20 73 5f 62 70  |ft bitsleft s_bp|
00000fe0  70 0a 73 75 62 20 64 65  66 2f 73 5f 77 68 69 63  |p.sub def/s_whic|
00000ff0  68 70 69 78 20 73 5f 77  68 69 63 68 70 69 78 20  |hpix s_whichpix |
00001000  31 20 61 64 64 20 64 65  66 7d 69 66 65 6c 73 65  |1 add def}ifelse|
00001010  7d 64 65 66 2f 73 5f 6e  65 78 74 70 69 78 65 6c  |}def/s_nextpixel|
00001020  7b 73 5f 77 68 69 63 68  70 69 78 0a 73 5f 70 69  |{s_whichpix.s_pi|
00001030  78 77 69 64 74 68 20 65  71 7b 2d 32 7d 7b 62 69  |xwidth eq{-2}{bi|
00001040  74 73 6c 65 66 74 20 30  20 65 71 7b 73 5f 66 72  |tsleft 0 eq{s_fr|
00001050  65 73 68 77 6f 72 64 7d  69 66 20 73 5f 77 6f 72  |eshword}if s_wor|
00001060  64 20 73 5f 61 6e 64 6d  61 73 6b 20 61 6e 64 20  |d s_andmask and |
00001070  77 5f 6d 61 73 6b 0a 73  5f 61 6e 64 6d 61 73 6b  |w_mask.s_andmask|
00001080  20 61 6e 64 20 30 20 65  71 7b 70 6f 70 20 2d 31  | and 0 eq{pop -1|
00001090  7d 69 66 7d 69 66 65 6c  73 65 7d 64 65 66 2f 73  |}if}ifelse}def/s|
000010a0  5f 73 6b 69 70 70 69 78  65 6c 7b 2f 73 5f 77 6f  |_skippixel{/s_wo|
000010b0  72 64 20 73 5f 77 6f 72  64 20 73 5f 62 70 70 20  |rd s_word s_bpp |
000010c0  6e 65 67 0a 62 69 74 73  68 69 66 74 20 64 65 66  |neg.bitshift def|
000010d0  2f 77 5f 6d 61 73 6b 20  77 5f 6d 61 73 6b 20 73  |/w_mask w_mask s|
000010e0  5f 62 70 70 20 6e 65 67  20 62 69 74 73 68 69 66  |_bpp neg bitshif|
000010f0  74 20 64 65 66 2f 62 69  74 73 6c 65 66 74 20 62  |t def/bitsleft b|
00001100  69 74 73 6c 65 66 74 20  73 5f 62 70 70 0a 73 75  |itsleft s_bpp.su|
00001110  62 20 64 65 66 2f 73 5f  77 68 69 63 68 70 69 78  |b def/s_whichpix|
00001120  20 73 5f 77 68 69 63 68  70 69 78 20 31 20 61 64  | s_whichpix 1 ad|
00001130  64 20 64 65 66 7d 64 65  66 0a                    |d def}def.|
0000113a