64 lines
1.2 KiB
C
64 lines
1.2 KiB
C
char *PSprologue =
|
|
"%%!PS\n\
|
|
%%%%BoundingBox: 72 410 540 684\n\
|
|
%%%%Title:\n\
|
|
%%%%Creator: Topograph version 1.0\n\
|
|
%% Copyright (C) 1995\n\
|
|
%% Marc Culler\n\
|
|
%%%%CreationDate: %s\
|
|
%%%%EndComments\n\
|
|
\n\
|
|
%%Prologue\n\
|
|
/xsize 460 def\n\
|
|
/ysize 266 def\n\
|
|
/dx 76 def\n\
|
|
/dy 414 def\n\
|
|
/width %d def\n\
|
|
/height %d def\n\
|
|
/pixel 1 string def\n\
|
|
/count 1 string def\n\
|
|
/N 0 def\n\
|
|
\n\
|
|
/Nneg {\n\
|
|
/N N 1 add def\n\
|
|
pixel\n\
|
|
} bind def\n\
|
|
\n\
|
|
/Npos {\n\
|
|
/N N 1 sub def\n\
|
|
currentfile pixel readhexstring pop\n\
|
|
} bind def\n\
|
|
\n\
|
|
/Nzero {\n\
|
|
{currentfile count readhexstring pop 0 get dup 128 ne {exit} if} loop\n\
|
|
dup 128 gt {256 sub} if\n\
|
|
/N exch def\n\
|
|
currentfile pixel readhexstring pop\n\
|
|
} bind def\n\
|
|
\n\
|
|
/getpix {\n\
|
|
N 0 eq {Nzero}\n\
|
|
{ N 0 lt {Nneg} {Npos} ifelse} ifelse\n\
|
|
} bind def\n\
|
|
\n\
|
|
/print {\n\
|
|
width height 8 [width 0 0 height neg 0 height]\n\
|
|
{getpix} image\n\
|
|
} bind def\n\
|
|
gsave\n\
|
|
\n\
|
|
%%Box\n\
|
|
72 410 moveto 0 274 rlineto 468 0 rlineto 0 -274 rlineto closepath stroke\n\
|
|
\n\
|
|
%%Graph\n\
|
|
dx dy translate\n\
|
|
xsize ysize scale\n\
|
|
print\n";
|
|
|
|
char *PSepilogue =
|
|
"%%Epilogue\n\
|
|
grestore\n\
|
|
showpage\n\
|
|
\n";
|
|
|