[Oberon] ETH - RLE compression
Tomas Kral
thomas.kral at email.cz
Sat Sep 23 15:31:40 CEST 2017
Hi,
I am looking into ETH `Picture.Mod' module. Please consider the
following code excerpt decoding `RLE' sequence.
c := P.height;
WHILE c > 0 DO
Files.Read(R, ch); k := ORD(ch);
IF k < 128 THEN
REPEAT
Files.Read(R, ch);
Bitmaps.PutPix(b,ce,ch,d);
IF b>=ce THEN ce := ce-P.wth; b := a-P.wth; a := b; c := c-1
END; k := k -1;
UNTIL k < 0
ELSIF k >= 128 THEN
k := 257 - k;
Files.Read(R, ch);
REPEAT
Bitmaps.PutPix(b,ce,ch,d);
IF b>=ce THEN ce := ce-P.wth; b := a-P.wth; a := b; c := c-1
END; k := k -1
UNTIL k < 1
END
=============================
QUESTIONS:
I wish to know how `RLE', `start' and `end' are identified?
What is encoded in single bytes in each run, as we read by bytes?
Why we set a single pixel from a byte, instead of the whole bitmap word?
Many thanks in advance.
--
Tomas Kral <thomas.kral at email.cz>
More information about the Oberon
mailing list