A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
24
Task/Bitmap/Modula-3/bitmap-1.mod3
Normal file
24
Task/Bitmap/Modula-3/bitmap-1.mod3
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
INTERFACE Bitmap;
|
||||
|
||||
TYPE UByte = BITS 8 FOR [0 .. 16_FF];
|
||||
Pixel = RECORD R, G, B: UByte; END;
|
||||
Point = RECORD x, y: UByte; END;
|
||||
T = REF ARRAY OF ARRAY OF Pixel;
|
||||
|
||||
CONST
|
||||
Black = Pixel{0, 0, 0};
|
||||
White = Pixel{255, 255, 255};
|
||||
Red = Pixel{255, 0, 0};
|
||||
Green = Pixel{0, 255, 0};
|
||||
Blue = Pixel{0, 0, 255};
|
||||
Yellow = Pixel{255, 255, 0};
|
||||
|
||||
EXCEPTION BadImage;
|
||||
BadColor;
|
||||
|
||||
PROCEDURE NewImage(height, width: UByte): T RAISES {BadImage};
|
||||
PROCEDURE Fill(VAR pic: T; color: Pixel);
|
||||
PROCEDURE GetPixel(VAR pic: T; point: Point): Pixel RAISES {BadColor};
|
||||
PROCEDURE SetPixel(VAR pic: T; point: Point; color: Pixel);
|
||||
|
||||
END Bitmap.
|
||||
Loading…
Add table
Add a link
Reference in a new issue