Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Bitmap/Ada/bitmap-1.ada
Normal file
17
Task/Bitmap/Ada/bitmap-1.ada
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package Bitmap_Store is
|
||||
type Luminance is mod 2**8;
|
||||
type Pixel is record
|
||||
R, G, B : Luminance := Luminance'First;
|
||||
end record;
|
||||
Black : constant Pixel := (others => Luminance'First);
|
||||
White : constant Pixel := (others => Luminance'Last);
|
||||
type Image is array (Positive range <>, Positive range <>) of Pixel;
|
||||
|
||||
procedure Fill (Picture : in out Image; Color : Pixel);
|
||||
|
||||
procedure Print (Picture : Image);
|
||||
|
||||
type Point is record
|
||||
X, Y : Positive;
|
||||
end record;
|
||||
end Bitmap_Store;
|
||||
20
Task/Bitmap/Ada/bitmap-2.ada
Normal file
20
Task/Bitmap/Ada/bitmap-2.ada
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
package body Bitmap_Store is
|
||||
|
||||
procedure Fill (Picture : in out Image; Color : Pixel) is
|
||||
begin
|
||||
for p of Picture loop x:= Color;end loop;
|
||||
end Fill;
|
||||
|
||||
procedure Print (Picture : Image) is
|
||||
begin
|
||||
for I in Picture'Range (1) loop
|
||||
for J in Picture'Range (2) loop
|
||||
Put (if Picture (I, J) = White then ' ' else 'H');
|
||||
end loop;
|
||||
New_Line;
|
||||
end loop;
|
||||
end Print;
|
||||
|
||||
end Bitmap_Store;
|
||||
7
Task/Bitmap/Ada/bitmap-3.ada
Normal file
7
Task/Bitmap/Ada/bitmap-3.ada
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
use Bitmap_Store; with Bitmap_Store;
|
||||
...
|
||||
X : Image (1..64, 1..64);
|
||||
begin
|
||||
Fill (X, (255, 255, 255));
|
||||
X (1, 2) := (R => 255, others => 0);
|
||||
X (3, 4) := X (1, 2);
|
||||
Loading…
Add table
Add a link
Reference in a new issue