Back to index

radiance  4R0+20100331
Functions
psplot.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void init (char *s)
void done (void)
void segopen (char *s)
void segclose (void)
void doseg (register PRIMITIVE *p)
void plotvstr (register PRIMITIVE *p)

Function Documentation

void done ( void  )

Definition at line 230 of file psplot.c.

{
       printf("end\nrestore\ngrestore\n");
}

Here is the caller graph for this function:

void doseg ( register PRIMITIVE *  p)

Definition at line 266 of file psplot.c.

{
       checkline();

       printf("/%s %d %d %d ", convertname(p->args),
                     WIDTH(p->arg0>>2 & 03),
                     p->arg0>>2 & 03, p->arg0 & 03);
       printf("%d %d %d %d %d segment\n", p->arg0>>4,
                     p->xy[XMN], p->xy[YMN], p->xy[XMX], p->xy[YMX]);
}

Here is the call graph for this function:

void init ( char *  s)

Definition at line 96 of file psplot.c.

{
       printf("%%!PS-Adobe-2.0 EPSF-2.0\n");
       printf("%%%%BoundingBox: %.0f %.0f %.0f %.0f\n",
                     HMARGIN+(PWIDTH-PSQUARE)/2.,
                     VMARGIN+(PHEIGHT-PSQUARE)/2.,
                     HMARGIN+(PWIDTH-PSQUARE)/2.+PSQUARE,
                     VMARGIN+(PHEIGHT-PSQUARE)/2.+PSQUARE);
       printf("%%%%DocumentFonts: Helvetica Courier\n");
       if (id != NULL)
              printf("%%%%Creator: %s\n", id);
       printf("gsave\n");
       printf("save\n");
       printf("256 dict begin\n");
       printf("%f %f translate\n", HMARGIN+(PWIDTH-PSQUARE)/2.,
                     VMARGIN+(PHEIGHT-PSQUARE)/2.);
       printf("%f %f scale\n", (double)PSQUARE/XYSIZE,
                     (double)PSQUARE/XYSIZE);
       printf("/mapping matrix currentmatrix def\n");
       printf("/segment {\t\t%% name lth pat col dir xmn ymn xmx ymx\n");
       printf("\t/startstate save def\n");
       printf("\t128 dict begin\t\t%% get parameters\n");
       printf("\t/ymax exch def /xmax exch def\n");
       printf("\t/ymin exch def /xmin exch def\n");
       printf("\t/orient exch def\n");
       printf("\t/colndx exch def /patndx exch def /lthick exch def\n");
       printf("\t%% segment name left on stack\n");
       printf("\txmax xmin add 2 div ymax ymin add 2 div translate\n");
       printf("\txmax xmin sub %d div ymax ymin sub %d div scale\n",
                     XYSIZE, XYSIZE);
       printf("\torient 90 mul rotate\n");
       printf("\t%d %d translate\n", -XYSIZE/2, -XYSIZE/2);
       printf("\tcvx exec\t\t\t%% execute segment\n");
       printf("\tend\n");
       printf("\tstartstate restore\n");
       printf("} def\n");
       printf("/vstr {\t\t\t%% string\n");
       printf("\t0 setcolor\n");
       printf("\t/Helvetica findfont setfont\n");
       printf("\tdup stringwidth pop %d exch div %d scale\n", XYSIZE, XYSIZE);
       printf("\tcurrentfont charorigin translate\n");
       printf("\t0 0 moveto show\n");
       printf("} def\n");
       printf("/charorigin {\t\t\t%% font charorigin xorg yorg\n");
       printf("\tdup /FontBBox get aload pop pop pop\n");
       printf("\t3 2 roll /FontMatrix get transform\n");
       printf("\texch neg exch neg\n");
       printf("} def\n");
       printf("/newline {\t\t\t%% lpat lthick col x0 y0\n");
       printf("\tnewpath moveto\n");
       printf("\tsetcolor setlthick setlpat\n");
       printf("} def\n");
       printf("/rfilldict 4 dict def\n");
       printf("/rfill {\t\t\t%% pat col xmn ymn xmx ymx\n");
       printf("\trfilldict begin\n");
       printf("\t/ymax exch def /xmax exch def\n");
       printf("\t/ymin exch def /xmin exch def\n");
       printf("\tsetcolor setpattern\n");
       printf("\tnewpath\n");
       printf("\txmin ymin moveto\n");
       printf("\txmax ymin lineto\n");
       printf("\txmax ymax lineto\n");
       printf("\txmin ymax lineto\n");
       printf("\tclosepath patfill\n");
       printf("\tend\n");
       printf("} def\n");
       printf("/fillpoly {\t\t\t%% pat col mark x1 y1 .. xn yn\n");
       printf("\tnewpath moveto\n");
       printf("\tcounttomark 2 idiv { lineto } repeat cleartomark\n");
       printf("\tclosepath\n");
       printf("\tsetcolor setpattern\n");
       printf("\t{ gsave 0 setlinewidth stroke grestore } if\n");
       printf("\tpatfill\n");
       printf("} def\n");
       printf("/mstr {\t\t\t%% fnt col x y\n");
       printf("\t100 add moveto setcolor setmfont show\n");
       printf("} def\n");
       printf("/patfill {\n");
       printf("\tfill\t\t\t\t%% unimplemented\n");
       printf("} def\n");
       printf("/setmfont {\t\t\t%% fontndx\n");
       printf("\tmfontab exch get setfont\n");
       printf("} def\n");
       printf("/setcolor {\t\t\t%% colndx\n");
       printf("\tcolndx 0 ne { pop colndx } if\n");
       printf("\trgbcoltab exch get aload pop setrgbcolor\n");
       printf("} def\n");
       printf("/setlthick {\t\t\t%% lthick\n");
       printf("\tlthick 0 ne { pop lthick } if\n");
       printf("\tsetlinewidth\n");
       printf("} def\n");
       printf("/setlpat {\t\t\t%% lpatndx\n");
       printf("\tdashtab exch get 0 setdash\n");
       printf("} def\n");
       printf("/setpattern {\t\t\t%% patndx\n");
       printf("\tpop\t\t\t\t%% unimplemented\n");
       printf("} def\n");
       printf("/canonfont\t\t\t%% canonical matrix string font\n");
       printf("\t/Courier findfont\n");
       printf("\tdup charorigin matrix translate\n");
       printf("\tmakefont\n");
       printf("def\n");
       printf("/mfontab [\t\t\t%% hardware font table\n");
       printf("\t[\n");
       printf("\t\t[ 340 0 0 340 0 -340 ]\n");
       printf("\t\t[ 681 0 0 340 0 -340 ]\n");
       printf("\t\t[ 340 0 0 681 0 -681 ]\n");
       printf("\t\t[ 681 0 0 681 0 -681 ]\n");
       printf("\t\t[ 282 0 0 282 0 -282 ]\n");
       printf("\t\t[ 564 0 0 282 0 -282 ]\n");
       printf("\t\t[ 282 0 0 564 0 -564 ]\n");
       printf("\t\t[ 564 0 0 564 0 -564 ]\n");
       printf("\t\t[ 199 0 0 199 0 -199 ]\n");
       printf("\t\t[ 398 0 0 199 0 -199 ]\n");
       printf("\t\t[ 199 0 0 398 0 -398 ]\n");
       printf("\t\t[ 398 0 0 398 0 -398 ]\n");
       printf("\t\t[ 169 0 0 169 0 -169 ]\n");
       printf("\t\t[ 339 0 0 169 0 -169 ]\n");
       printf("\t\t[ 169 0 0 339 0 -339 ]\n");
       printf("\t\t[ 339 0 0 339 0 -339 ]\n");
       printf("\t]\n");
       printf("\t{ canonfont exch makefont }\n");
       printf("\tforall\n");
       printf("] def\n");
       printf("/dashtab [ [ ] [ 200 80 ] [ 80 80 ] [ 200 80 80 80 ] ] def\n");
       printf("/rgbcoltab [ [ 0 0 0 ] [ 1 0 0 ] [ 0 1 0 ] [ 0 0 1 ] ] def\n");
       printf("/colndx 0 def /patndx 0 def /lthick 0 def\n");
       printf("%%%%EndProlog\n");
}
void plotvstr ( register PRIMITIVE *  p)

Definition at line 293 of file psplot.c.

{
       checkline();

       printf("(%s) /vstr %d 0 %d ", convertstring(p->args),
                     WIDTH(p->arg0>>2 & 03), p->arg0 & 03);
       printf("%d %d %d %d %d segment\n", p->arg0>>4,
                     p->xy[XMN], p->xy[YMN], p->xy[XMX], p->xy[YMX]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void segclose ( void  )

Definition at line 257 of file psplot.c.

{
       checkline();

       printf("} def\n");
}

Here is the caller graph for this function:

void segopen ( char *  s)

Definition at line 246 of file psplot.c.

{
       checkline();

       printf("/%s {\n", convertname(s));
}

Here is the call graph for this function:

Here is the caller graph for this function: