1 | /* |
---|
2 | * see COPYRIGHT |
---|
3 | */ |
---|
4 | |
---|
5 | |
---|
6 | /* |
---|
7 | * Screen for drawing the Bezier curves in text mode |
---|
8 | */ |
---|
9 | |
---|
10 | struct screen { |
---|
11 | unsigned physx; |
---|
12 | unsigned physy; |
---|
13 | unsigned cols; |
---|
14 | unsigned rows; |
---|
15 | unsigned xoff; |
---|
16 | unsigned yoff; |
---|
17 | unsigned minx; |
---|
18 | unsigned miny; |
---|
19 | char *dots; |
---|
20 | double xscale; |
---|
21 | double yscale; |
---|
22 | } screen; |
---|
23 | |
---|
24 | #define screenabsdot(x,y) (screen.dots[(y)*screen.cols+(x)]) |
---|
25 | #define screendot(x,y) screenabsdot((x)+screen.xoff, (y)+screen.yoff) |
---|
26 | |
---|
27 | /* prototypes */ |
---|
28 | double fmin(double a, double b); |
---|
29 | int abs(int x); |
---|
30 | void initscreen(unsigned physx, unsigned physy, |
---|
31 | unsigned cols, unsigned rows, unsigned xoff, unsigned yoff, |
---|
32 | unsigned minx, unsigned miny, unsigned maxx, unsigned maxy); |
---|
33 | void drawcurve(int mark, int ax,int ay, |
---|
34 | int bx,int by, int cx,int cy, int dx,int dy); |
---|
35 | void drawcurvedir(int mark, int ax,int ay, |
---|
36 | int bx,int by, int cx,int cy, int dx,int dy); |
---|
37 | void drawdot(int mark, int x, int y); |
---|
38 | void setabsdot(int mark, int x, int y); |
---|
39 | void setfdot(int mark, double x, double y); |
---|
40 | void printscreen(FILE *f); |
---|