xref: /csrg-svn/lib/libplot/imagen/line.c (revision 24996)
1*24996Ssam /*
2*24996Ssam  * Copyright (c) 1985 Regents of the University of California.
3*24996Ssam  * All rights reserved.  The Berkeley software License Agreement
4*24996Ssam  * specifies the terms and conditions for redistribution.
5*24996Ssam  */
6*24996Ssam 
7*24996Ssam #ifndef lint
8*24996Ssam static char sccsid[] = "@(#)line.c	5.1 (Berkeley) 09/21/85";
9*24996Ssam #endif not lint
10*24996Ssam 
11*24996Ssam #include "imp.h"
12*24996Ssam #include "imPcodes.h"
13*24996Ssam 
14*24996Ssam float obotx = 0.;
15*24996Ssam float oboty = 0.;
16*24996Ssam float botx = 0.;
17*24996Ssam float boty = 0.;
18*24996Ssam float scalex = 1.;
19*24996Ssam float scaley = 1.;
20*24996Ssam line(x0,y0,x1,y1)
21*24996Ssam {
22*24996Ssam 	putch(imP_CREATE_PATH);
23*24996Ssam 	putwd(2);		/* two coordinates follow */
24*24996Ssam 	putwd((int)((x0-obotx)*scalex+botx+1));
25*24996Ssam 	putwd((int)((y0-oboty)*scaley+boty+1));
26*24996Ssam 	putwd((int)((x1-obotx)*scalex+botx+1));
27*24996Ssam 	putwd((int)((y1-oboty)*scaley+boty+1));
28*24996Ssam 	putch(imP_DRAW_PATH);
29*24996Ssam 	putch(15);		/* "black" lines */
30*24996Ssam 	imPx = x1;
31*24996Ssam 	imPy = y1;
32*24996Ssam }
33*24996Ssam putch(c)
34*24996Ssam {
35*24996Ssam 	putc(c, stdout);
36*24996Ssam }
37*24996Ssam putwd(w)
38*24996Ssam {
39*24996Ssam 	putch(w>>8);
40*24996Ssam 	putch(w);
41*24996Ssam }
42