diff options
author | rsc <devnull@localhost> | 2005-01-13 04:49:19 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-01-13 04:49:19 +0000 |
commit | c8b6342d3c2a167dec16931815926e9e4387e7ef (patch) | |
tree | 80d3ec6ea074462b30639168113def880476dad6 /src/libdraw/writecolmap.c | |
parent | 741f510ce758f77ed5193256fb693a09a7daecce (diff) | |
download | plan9port-c8b6342d3c2a167dec16931815926e9e4387e7ef.tar.gz plan9port-c8b6342d3c2a167dec16931815926e9e4387e7ef.tar.bz2 plan9port-c8b6342d3c2a167dec16931815926e9e4387e7ef.zip |
Many small edits.
Diffstat (limited to 'src/libdraw/writecolmap.c')
-rw-r--r-- | src/libdraw/writecolmap.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/libdraw/writecolmap.c b/src/libdraw/writecolmap.c deleted file mode 100644 index 30b026f9..00000000 --- a/src/libdraw/writecolmap.c +++ /dev/null @@ -1,35 +0,0 @@ -#include <u.h> -#include <libc.h> -#include <draw.h> - -/* - * This code (and the devdraw interface) will have to change - * if we ever get bitmaps with ldepth > 3, because the - * colormap will have to be written in chunks - */ - -void -writecolmap(Display *d, RGB *m) -{ - int i, n, fd; - char buf[64], *t; - ulong r, g, b; - - sprint(buf, "/dev/draw/%d/colormap", d->dirno); - fd = open(buf, OWRITE); - if(fd < 0) - drawerror(d, "wrcolmap: open colormap failed"); - t = malloc(8192); - n = 0; - for(i = 0; i < 256; i++) { - r = m[i].red>>24; - g = m[i].green>>24; - b = m[i].blue>>24; - n += sprint(t+n, "%d %lud %lud %lud\n", 255-i, r, g, b); - } - i = write(fd, t, n); - free(t); - close(fd); - if(i != n) - drawerror(d, "wrcolmap: bad write"); -} |