Vuo
2.4.1
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
char
*
VuoRectangle_getString
(
const
VuoRectangle
r);
44
void
VuoRectangle_retain
(
VuoRectangle
r);
45
void
VuoRectangle_release
(
VuoRectangle
r);
47
51
static
inline
VuoRectangle
VuoRectangle_make
(
float
centerX,
float
centerY,
float
width,
float
height) __attribute__((
const
));
52
static
inline
VuoRectangle
VuoRectangle_make
(
float
centerX,
float
centerY,
float
width,
float
height)
53
{
54
return
(
VuoRectangle
){ { centerX, centerY }, { width, height } };
55
}
56
60
static
inline
VuoRectangle
VuoRectangle_makeTopLeft
(
float
leftX,
float
topY,
float
width,
float
height) __attribute__((
const
));
61
static
inline
VuoRectangle
VuoRectangle_makeTopLeft
(
float
leftX,
float
topY,
float
width,
float
height)
62
{
63
return
(
VuoRectangle
){ { leftX + width / 2.f, topY + height / 2.f }, { width, height } };
64
}
65
66
bool
VuoRectangle_isPointInside
(
VuoRectangle
r, VuoPoint2d p);
67
68
VuoRectangle
VuoRectangle_intersection
(
VuoRectangle
rectangleA,
VuoRectangle
rectangleB);
69
VuoRectangle
VuoRectangle_union
(
VuoRectangle
rectangleA,
VuoRectangle
rectangleB);
70
Generated on Mon Feb 7 2022 18:55:37 for Vuo by
1.9.3