This repository has been archived by the owner on Apr 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gr_shapes.ads
57 lines (47 loc) · 1.57 KB
/
gr_shapes.ads
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
with
Ada_SDL_Video;
use
Ada_SDL_Video;
package Gr_Shapes is
-- Image structure
type Image is record
basePixel : PixelPtr; -- address of the first pixel of the image
iR, iG, iB, iA : Integer; -- indices of the red, green, blue and alpha channels
width, height : Integer; -- size of the image
end record;
type ImagePtr is access all Image;
-- Point data type
type Point;
type PointPtr is access all Point;
type Point is record
x, y : Integer;
next : PointPtr;
end record;
-- Rectangle data type
type Rectangle is record
topLeft, bottomRight : Point;
end record;
type RectanglePtr is access all Rectangle;
--
-- Draw in the image <image> clipped by the rectangle <clipRect>
-- the polyline defined by the points list <points>
-- with the pixel value <pixelValue>.
-- If <clipRect> is NULL, then clip against the entire image.
--
procedure Polyline
(image : ImagePtr;
points : PointPtr;
pixelValue : Pixel;
clipRect : RectanglePtr := NULL);
--
-- Draw in the image <image> clipped by the rectangle <clipRect>
-- the filled polygone defined by the points list <points>
-- with the pixel value <pixelValue>
-- If <clipRect> is NULL, then clip against the entire image.
--
procedure Polygone
(image : ImagePtr;
points : PointPtr;
pixelValue : Pixel;
clipRect : RectanglePtr := NULL);
end Gr_Shapes;