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 /appl/wm/mpeg/makergbvmap.b | |
| parent | 54bc8ff236ac10b3eaa928fd6bcfc0cdb2ba46ae (diff) | |
20060303a
Diffstat (limited to 'appl/wm/mpeg/makergbvmap.b')
| -rw-r--r-- | appl/wm/mpeg/makergbvmap.b | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/appl/wm/mpeg/makergbvmap.b b/appl/wm/mpeg/makergbvmap.b new file mode 100644 index 00000000..9e7e7ffa --- /dev/null +++ b/appl/wm/mpeg/makergbvmap.b @@ -0,0 +1,31 @@ +implement MakeRGBVMap; + +include "sys.m"; +include "draw.m"; + +draw: Draw; +sys: Sys; + +Display: import draw; + +MakeRGBVMap: module +{ + init: fn(ctxt: ref Draw->Context, nil: list of string); +}; + +init(ctxt: ref Draw->Context, nil: list of string) +{ + sys = load Sys Sys->PATH; + draw = load Draw Draw->PATH; + if (draw == nil) { + sys->print("could not load %s: %r\n", Draw->PATH); + exit; + } + d := ctxt.display; + sys->print("rgbvmap := array[3*256] of {\n"); + for (i := 0; i < 256; i++) { + (r, g, b) := d.cmap2rgb(i); + sys->print("\tbyte\t%d,byte\t%d,byte\t%d,\n", r, g, b); + } + sys->print("};\n"); +} |
