diff options
author | rsc <devnull@localhost> | 2003-09-30 17:47:42 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2003-09-30 17:47:42 +0000 |
commit | ed7c8e8d02c02bdbff1e88a6d8d1419f39af48ad (patch) | |
tree | ebcd32d20b0df2584bce713fefa87620ecd1cce7 /src/libdraw/line.c | |
parent | b2cfc4e2e71d0f0a5113ddfbd93c8285cc4d74e4 (diff) | |
download | plan9port-ed7c8e8d02c02bdbff1e88a6d8d1419f39af48ad.tar.gz plan9port-ed7c8e8d02c02bdbff1e88a6d8d1419f39af48ad.tar.bz2 plan9port-ed7c8e8d02c02bdbff1e88a6d8d1419f39af48ad.zip |
Initial import.
Diffstat (limited to 'src/libdraw/line.c')
-rw-r--r-- | src/libdraw/line.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/libdraw/line.c b/src/libdraw/line.c new file mode 100644 index 00000000..a06b5927 --- /dev/null +++ b/src/libdraw/line.c @@ -0,0 +1,35 @@ +#include <u.h> +#include <libc.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){ + fprint(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); +} |