Vuo
2.4.4
Loading...
Searching...
No Matches
type
VuoRectangle.h
Go to the documentation of this file.
1
10
#ifndef VuoRectangle_h
11
#define VuoRectangle_h
12
13
#ifdef __cplusplus
14
extern
"C"
{
15
#endif
16
17
#include "
VuoPoint2d.h
"
18
30
typedef
struct
31
{
32
VuoPoint2d center;
33
VuoPoint2d size;
34
}
VuoRectangle
;
35
36
#define VuoRectangle_SUPPORTS_COMPARISON
37
38
VuoRectangle
VuoRectangle_makeFromJson
(
struct
json_object *js);
39
struct
json_object *
VuoRectangle_getJson
(
const
VuoRectangle
r);
40
char
*
VuoRectangle_getSummary
(
const
VuoRectangle
r);
41
42
bool
VuoRectangle_areEqual
(
const
VuoRectangle
a,
const
VuoRectangle
b);
43
bool
VuoRectangle_isLessThan
(
const
VuoRectangle
a,
const
VuoRectangle
b);
44
46
49
char
*
VuoRectangle_getString
(
const
VuoRectangle
r);
50
void
VuoRectangle_retain
(
VuoRectangle
r);
51
void
VuoRectangle_release
(
VuoRectangle
r);
53
57
static
inline
VuoRectangle
VuoRectangle_make
(
float
centerX,
float
centerY,
float
width,
float
height) __attribute__((
const
));
58
static
inline
VuoRectangle
VuoRectangle_make
(
float
centerX,
float
centerY,
float
width,
float
height)
59
{
60
return
(
VuoRectangle
){ { centerX, centerY }, { width, height } };
61
}
62
66
static
inline
VuoRectangle
VuoRectangle_makeTopLeft
(
float
leftX,
float
topY,
float
width,
float
height) __attribute__((
const
));
67
static
inline
VuoRectangle
VuoRectangle_makeTopLeft
(
float
leftX,
float
topY,
float
width,
float
height)
68
{
69
return
(
VuoRectangle
){ { leftX + width / 2.f, topY + height / 2.f }, { width, height } };
70
}
71
72
bool
VuoRectangle_isPointInside
(
VuoRectangle
r, VuoPoint2d p);
73
74
VuoRectangle
VuoRectangle_intersection
(
VuoRectangle
rectangleA,
VuoRectangle
rectangleB);
75
VuoRectangle
VuoRectangle_union
(
VuoRectangle
rectangleA,
VuoRectangle
rectangleB);
76
81
#ifdef __cplusplus
82
}
83
#endif
84
85
#endif
Generated on Thu Nov 9 2023 16:59:30 for Vuo by
1.9.8