summaryrefslogtreecommitdiff
path: root/module/imagefile.m
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-22 20:52:35 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-22 20:52:35 +0000
commit46439007cf417cbd9ac8049bb4122c890097a0fa (patch)
tree6fdb25e5f3a2b6d5657eb23b35774b631d4d97e4 /module/imagefile.m
parent37da2899f40661e3e9631e497da8dc59b971cbd0 (diff)
20060303-partial
Diffstat (limited to 'module/imagefile.m')
-rw-r--r--module/imagefile.m48
1 files changed, 48 insertions, 0 deletions
diff --git a/module/imagefile.m b/module/imagefile.m
new file mode 100644
index 00000000..2e386aa7
--- /dev/null
+++ b/module/imagefile.m
@@ -0,0 +1,48 @@
+RImagefile: module
+{
+ READGIFPATH: con "/dis/lib/readgif.dis";
+ READJPGPATH: con "/dis/lib/readjpg.dis";
+ READXBMPATH: con "/dis/lib/readxbitmap.dis";
+ READPICPATH: con "/dis/lib/readpicfile.dis";
+ READPNGPATH: con "/dis/lib/readpng.dis";
+
+ Rawimage: adt
+ {
+ r: Draw->Rect;
+ cmap: array of byte;
+ transp: int; # transparency flag (only for nchans=1)
+ trindex: byte; # transparency index
+ nchans: int;
+ chans: array of array of byte;
+ chandesc:int;
+
+ fields: int; # defined by format
+ };
+
+ # chandesc
+ CRGB: con 0; # three channels, no map
+ CY: con 1; # one channel, luminance
+ CRGB1: con 2; # one channel, map present
+
+ init: fn(bufio: Bufio);
+ read: fn(fd: ref Bufio->Iobuf): (ref Rawimage, string);
+ readmulti: fn(fd: ref Bufio->Iobuf): (array of ref Rawimage, string);
+};
+
+WImagefile: module
+{
+ WRITEGIFPATH: con "/dis/lib/writegif.dis";
+
+ init: fn(bufio: Bufio);
+# write: fn(fd: ref Bufio->Iobuf, ref RImagefile->Rawimage): string;
+ writeimage: fn(fd: ref Bufio->Iobuf, image: ref Draw->Image): string;
+};
+
+
+Imageremap: module
+{
+ PATH: con "/dis/lib/imageremap.dis";
+
+ init: fn(d: ref Draw->Display);
+ remap: fn(i: ref RImagefile->Rawimage, d: ref Draw->Display, errdiff: int): (ref Draw->Image, string);
+};