[Oberon] FPGA - Pictures.Mod composition
Alexander Ilin
ajsoft at yandex.ru
Tue Sep 26 20:52:26 CEST 2017
The meaning of the terms depends on the context of the bigger system (and their usage).
If a Picture is a special kind of Bitmap, the kind that also has a ColorTable, then you can make a Picture an extension of Bitmap. Intuitively, though, "picture" sounds like a more generic term, and "bitmap" sounds like an implementation detail. For this case I'd suggest PalettedBitmap(Bitmap).
If a Picture is a screen object with its dimensions, which may contain a Bitmap (necessarily, with its own dimensions), then you should not make one an extension of the other. If you may take a 100x100 Bitmap and display it in a smaller preview Picture, say 30x30, then you need two sets of width/height/depth properties to scale from one to the other.
26.09.2017, 21:25, "Tomas Kral" <thomas.kral at email.cz>:
> Hi,
>
> Looking at these two structures, I am scratching my head, is a
> picture `kind of' bitmap, or `makes use of' bitmap, as we repeat
> fields: width, height, depth, and base, while only adding colour table?
>
> TYPE
> Bitmap* = POINTER TO BitmapDesc;
> BitmapDesc* = RECORD
> width*, height*, depth*: INTEGER;
> base*: INTEGER;
> size*: INTEGER
> END;
>
> TYPE
> Picture* = POINTER TO PictureDesc;
> PictureDesc* = RECORD
> width*, height*, depth*: INTEGER;
> bitmap: Bitmaps.Bitmap;
> base: INTEGER;
> ct: ColorTable
> END;
>
> Should we not just extend it?
>
> TYPE
> PictureDesc* = RECORD (Bitmaps)
> ct: ColorTable
> END;
>
> --
> Tomas Kral <thomas.kral at email.cz>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
---=====---
Александр
More information about the Oberon
mailing list