axle OS
x86_32 UNIX-like hobby OS
src
gfx
lib
shapes.h
1
#ifndef SHAPES_H
2
#define SHAPES_H
3
4
#include "gfx.h"
5
6
typedef
struct
line
{
7
Point
p1;
8
Point
p2;
9
}
Line
;
10
11
typedef
struct
circle
{
12
Point
center;
13
int
radius;
14
}
Circle
;
15
16
typedef
struct
triangle
{
17
Point
p1;
18
Point
p2;
19
Point
p3;
20
}
Triangle
;
21
22
void
normalize_coordinate(ca_layer* layer,
Point
* p);
23
24
Point
point_make(
int
x,
int
y);
25
Size
size_make(
int
w,
int
h);
26
Rect
rect_make(
Point
origin,
Size
size
);
27
Line
line_make(
Point
p1,
Point
p2);
28
Circle
circle_make(
Point
center,
int
radius);
29
Triangle
triangle_make(
Point
p1,
Point
p2,
Point
p3);
30
31
#define THICKNESS_FILLED -1
32
33
void
draw_rect(ca_layer* layer,
Rect
rect
,
Color
color
,
int
thickness);
34
void
draw_line(ca_layer* layer,
Line
line
,
Color
color,
int
thickness);
35
void
draw_triangle(ca_layer* layer,
Triangle
triangle
,
Color
color,
int
thickness);
36
void
draw_circle(ca_layer* layer,
Circle
circle
,
Color
color,
int
thickness);
37
38
#endif
triangle
Definition:
shapes.h:16
circle
Definition:
shapes.h:11
color
Definition:
color.h:7
size
Definition:
size.h:4
line
Definition:
shapes.h:6
coordinate
Definition:
point.h:4
rect
Definition:
rect.h:14
Generated by
1.8.14