Vuo
2.0.2
type
VuoRectangle.h
Go to the documentation of this file.
1
10
#pragma once
11
12
#include "
VuoPoint2d.h
"
13
25
typedef
struct
26
{
27
VuoPoint2d center;
28
VuoPoint2d size;
29
}
VuoRectangle
;
30
31
VuoRectangle
VuoRectangle_makeFromJson
(
struct
json_object
*js);
32
struct
json_object
*
VuoRectangle_getJson
(
const
VuoRectangle
r);
33
char
*
VuoRectangle_getSummary
(
const
VuoRectangle
r);
34
35
#define VuoRectangle_SUPPORTS_COMPARISON
36
bool
VuoRectangle_areEqual
(
const
VuoRectangle
a,
const
VuoRectangle
b);
37
bool
VuoRectangle_isLessThan
(
const
VuoRectangle
a,
const
VuoRectangle
b);
38
40
43
VuoRectangle
VuoRectangle_makeFromString
(
const
char
*str);
44
char
*
VuoRectangle_getString
(
const
VuoRectangle
r);
45
void
VuoRectangle_retain
(
VuoRectangle
r);
46
void
VuoRectangle_release
(
VuoRectangle
r);
48
52
static
inline
VuoRectangle
VuoRectangle_make
(
float
centerX,
float
centerY,
float
width,
float
height)
__attribute__
((
const
));
53
static
inline
VuoRectangle
VuoRectangle_make
(
float
centerX,
float
centerY,
float
width,
float
height)
54
{
55
return
(
VuoRectangle
){ { centerX, centerY }, { width, height } };
56
}
57
61
static
inline
VuoRectangle
VuoRectangle_makeTopLeft
(
float
leftX,
float
topY,
float
width,
float
height)
__attribute__
((
const
));
62
static
inline
VuoRectangle
VuoRectangle_makeTopLeft
(
float
leftX,
float
topY,
float
width,
float
height)
63
{
64
return
(
VuoRectangle
){ { leftX + width / 2.f, topY + height / 2.f }, { width, height } };
65
}
66
67
bool
VuoRectangle_isPointInside
(
VuoRectangle
r, VuoPoint2d p);
68
69
VuoRectangle
VuoRectangle_intersection
(
VuoRectangle
rectangleA,
VuoRectangle
rectangleB);
70
VuoRectangle
VuoRectangle_union
(
VuoRectangle
rectangleA,
VuoRectangle
rectangleB);
71
Generated on Thu Mar 19 2020 23:16:04 for Vuo by
1.8.17