1 %!PS-Adobe-2.0 EPSF-2.0
3 %%Creator: XV Version 2.20 Rev: 4/24/92 - by John Bradley
4 %%BoundingBox: 254 375 282 403
12 % remember original state
15 % build a temporary dictionary
21 % size of image (on paper, in 1/72inch coords)
24 % define 'colorimage' if it isn't defined
25 % ('colortogray' and 'mergeprocs' come from xwd2ps
27 /colorimage where % do we know about 'colorimage'?
28 { pop } % yes: pop off the 'dict' returned
30 /colortogray { % define an RGB->I function
31 /rgbdata exch store % call input 'rgbdata'
35 /grays npixls string store % str to hold the result
38 rgbdata rgbindx get 20 mul % Red
39 rgbdata rgbindx 1 add get 32 mul % Green
40 rgbdata rgbindx 2 add get 12 mul % Blue
41 add add 64 idiv % I = .5G + .31R + .18B
43 /rgbindx rgbindx 3 add store
48 % Utility procedure for colorimage operator.
49 % This procedure takes two procedures off the
50 % stack and merges them into a single procedure.
72 pop pop % remove 'false 3' operands
73 {colortogray} mergeprocs
76 } ifelse % end of 'false' case
84 % load up the colormap
85 currentfile cmap readhexstring
86 000000 c0c0c0 808080 ffffff
87 pop pop % lose return values from readhexstring
90 % rlecmapimage expects to have 'w h bits matrix' on stack
96 % proc to read a block from file, and return RGB data
97 { currentfile buffer readhexstring pop
98 /bcount exch 0 get store
100 { % it's a non-run block
102 { currentfile buffer readhexstring pop pop
104 % look up value in color map
105 /rgbval cmap buffer 0 get 3 mul 3 getinterval store
107 % and put it in position i*3 in block
108 block exch 3 mul rgbval putinterval
110 block 0 bcount 127 sub 3 mul getinterval
113 { % else it's a run block
114 currentfile buffer readhexstring pop pop
116 % look up value in colormap
117 /rgbval cmap buffer 0 get 3 mul 3 getinterval store
119 0 1 bcount { block exch 3 mul rgbval putinterval } for
121 block 0 bcount 1 add 3 mul getinterval
128 28 28 8 % dimensions of data
129 [28 0 0 -28 0 28] % mapping matrix
138 820003018101001200810102810200
139 820003018201000105018100010601010382000102810200
140 82000301820100010101010001018100010601010382000102810200
141 8200030182010001020181000181010002000401010282000102810200
142 820003018201000181010001000101810001820100010301010282000102810200
143 820003018201000184010001000182010001820100010301010282000102810200
144 8200030182010001810100010081010003000401010282000102810200
145 82000301820100010e01010282000102810200
146 820003018201000108018100010301010282000102810200
147 820003018201000108018100010301010282000102810200
148 82000301820100018101000100010103000401010282000102810200
149 8200030182010001820100010201810001820100010301010282000102810200
150 8200030182010001820100010201810001820100010301010282000102810200
151 82000301820100018101000100010104000301010382000102810200
152 82000301820100010e01010382000102810200
153 820003018101001200810102810200
162 % Compression made this file 22.07% of the uncompressed size.
168 % stop using temporary dictionary
171 % restore original state