%%Start_Prologue %%Prologue_Version: @(#)psraster.ps 2.2 leonid@math.tau.ac.IL 88/06/16 % Prologue for psraster command which converts SUN standard raster imager % into PostScript. The program uses repeated bytes encoding and following % are PostScript routines to decode the format. /FillString { % size value FillString string exch dup string exch % value string size dup { % repeat "size" times. 1 sub % size-- 1 index % value string size string 1 index % value string size string size 4 index % value string size string size value put % value string size } repeat pop exch pop % string } bind def /GetImageRow { currentfile % Get the "count" byte from 1 string readhexstring pop 0 get % currentfile dup 128 lt { % if "count" < 128 string currentfile exch readhexstring pop } { % if "count" >128 128 sub % fix the count currentfile 1 string readhexstring pop 0 get % and the value FillString } ifelse } bind def %%End_Prologue