diff options
| author | Charles.Forsyth <devnull@localhost> | 2006-12-22 17:07:39 +0000 |
|---|---|---|
| committer | Charles.Forsyth <devnull@localhost> | 2006-12-22 17:07:39 +0000 |
| commit | 37da2899f40661e3e9631e497da8dc59b971cbd0 (patch) | |
| tree | cbc6d4680e347d906f5fa7fca73214418741df72 /libdraw/line.c | |
| parent | 54bc8ff236ac10b3eaa928fd6bcfc0cdb2ba46ae (diff) | |
20060303a
Diffstat (limited to 'libdraw/line.c')
| -rw-r--r-- | libdraw/line.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libdraw/line.c b/libdraw/line.c new file mode 100644 index 00000000..32a1213d --- /dev/null +++ b/libdraw/line.c @@ -0,0 +1,34 @@ +#include "lib9.h" +#include "draw.h" + +void +line(Image *dst, Point p0, Point p1, int end0, int end1, int radius, Image *src, Point sp) +{ + lineop(dst, p0, p1, end0, end1, radius, src, sp, SoverD); +} + +void +lineop(Image *dst, Point p0, Point p1, int end0, int end1, int radius, Image *src, Point sp, Drawop op) +{ + uchar *a; + + _setdrawop(dst->display, op); + + a = bufimage(dst->display, 1+4+2*4+2*4+4+4+4+4+2*4); + if(a == 0){ + _drawprint(2, "image line: %r\n"); + return; + } + a[0] = 'L'; + BPLONG(a+1, dst->id); + BPLONG(a+5, p0.x); + BPLONG(a+9, p0.y); + BPLONG(a+13, p1.x); + BPLONG(a+17, p1.y); + BPLONG(a+21, end0); + BPLONG(a+25, end1); + BPLONG(a+29, radius); + BPLONG(a+33, src->id); + BPLONG(a+37, sp.x); + BPLONG(a+41, sp.y); +} |
