[Oberon] FPGA - Pictures.Mod composition

Tomas Kral thomas.kral at email.cz
Wed Sep 27 11:04:01 CEST 2017

On Tue, 26 Sep 2017 20:55:55 +0200
Jörg <joerg.straube at iaeth.ch> wrote:

> indeed, we could. With your propsal Pictures are supersets of Bitmaps
> and hence type compatible (meaning PROCEDUREs accepting Bitmaps could
> accept Pictures as well, not the otherway around) With the existing
> separate type definitions, types are not compatible.

Well I declared as type extension, for the time being. See if it proves
a good idea, when working on `Picture.Frames' and `Paint.Mod'. Not sure
it makes sense to add JPEG, GIF, and other converters to FPGA
implementation, as the idea is to keep it simple.

This is interesting... 

What happens to allocated `b' structure? Is it in
the heap as long as `P' is, as `b' duplicates some `P' fields, and is
not needed after `P' is created/loaded?

PROCEDURE Load*(P: Picture...
VAR b: Bitmaps.Bitmap;

  ReadShort(R, P.width);
  ReadShort(R, P.height);
  ReadShort(R, P.depth);

  b := Bitmaps.New(P.width, P.height, P.depth);
  IF b # NIL THEN 
    P.base := b.base;
    P.size := b.size;
    LoadRLE(P, R, P.depth = 1)

Many thanks.

Tomas Kral <thomas.kral at email.cz>

More information about the Oberon mailing list