Vuo
2.3.2
|
A 2-dimensional axis-aligned box.
Classes | |
struct | VuoRectangle |
A 2-dimensional axis-aligned box. More... | |
Functions | |
VuoRectangle | VuoRectangle_makeFromJson (json_object *js) |
Decodes the JSON object js to create a new value. More... | |
json_object * | VuoRectangle_getJson (const VuoRectangle r) |
Encodes r as a JSON object. More... | |
char * | VuoRectangle_getSummary (const VuoRectangle r) |
Returns a compact string representation of r (comma-separated coordinates). More... | |
bool | VuoRectangle_areEqual (const VuoRectangle a, const VuoRectangle b) |
Returns true if the two rectangles are equal (within tolerance). More... | |
bool | VuoRectangle_isLessThan (const VuoRectangle a, const VuoRectangle b) |
Compares a to b primarily by center -value and secondarily by size -value, returning true if a is less than b . More... | |
static VuoRectangle | VuoRectangle_make (float centerX, float centerY, float width, float height) __attribute__((const)) |
Returns a rectangle with the specified coordinates. More... | |
static VuoRectangle | VuoRectangle_makeTopLeft (float leftX, float topY, float width, float height) __attribute__((const)) |
Returns a rectangle with the specified coordinates. More... | |
bool | VuoRectangle_isPointInside (VuoRectangle r, VuoPoint2d p) |
Returns true if p is inside r . More... | |
VuoRectangle | VuoRectangle_intersection (VuoRectangle rectangleA, VuoRectangle rectangleB) |
Returns the intersecting area of rectangleA and rectangleB . More... | |
VuoRectangle | VuoRectangle_union (VuoRectangle rectangleA, VuoRectangle rectangleB) |
Returns the union area of rectangleA and rectangleB . More... | |
VuoRectangle | VuoRectangle_makeFromString (const char *str) |
Automatically generated function. More... | |
char * | VuoRectangle_getString (const VuoRectangle r) |
Automatically generated function. More... | |
void | VuoRectangle_retain (VuoRectangle r) |
Automatically generated function. More... | |
void | VuoRectangle_release (VuoRectangle r) |
Automatically generated function. More... | |
bool VuoRectangle_areEqual | ( | const VuoRectangle | a, |
const VuoRectangle | b | ||
) |
Returns true if the two rectangles are equal (within tolerance).
Definition at line 85 of file VuoRectangle.c.
struct json_object * VuoRectangle_getJson | ( | const VuoRectangle | r | ) |
char* VuoRectangle_getString | ( | const VuoRectangle | r | ) |
Automatically generated function.
char * VuoRectangle_getSummary | ( | const VuoRectangle | r | ) |
Returns a compact string representation of r
(comma-separated coordinates).
Definition at line 75 of file VuoRectangle.c.
VuoRectangle VuoRectangle_intersection | ( | VuoRectangle | rectangleA, |
VuoRectangle | rectangleB | ||
) |
Returns the intersecting area of rectangleA
and rectangleB
.
Edges that touch (but don't overlap) are not considered to be overlapping.
If the rectangles do not intersect, returns rectangle {{0
,0},{0,0}}.
Definition at line 126 of file VuoRectangle.c.
bool VuoRectangle_isLessThan | ( | const VuoRectangle | a, |
const VuoRectangle | b | ||
) |
Compares a
to b
primarily by center
-value and secondarily by size
-value, returning true if a
is less than b
.
Definition at line 97 of file VuoRectangle.c.
bool VuoRectangle_isPointInside | ( | VuoRectangle | r, |
VuoPoint2d | p | ||
) |
Returns true if p
is inside r
.
Definition at line 109 of file VuoRectangle.c.
|
inlinestatic |
Returns a rectangle with the specified coordinates.
Definition at line 53 of file VuoRectangle.h.
VuoRectangle VuoRectangle_makeFromJson | ( | json_object * | js | ) |
Decodes the JSON object js
to create a new value.
Definition at line 47 of file VuoRectangle.c.
VuoRectangle VuoRectangle_makeFromString | ( | const char * | str | ) |
Automatically generated function.
|
inlinestatic |
Returns a rectangle with the specified coordinates.
Definition at line 62 of file VuoRectangle.h.
void VuoRectangle_release | ( | VuoRectangle | r | ) |
Automatically generated function.
void VuoRectangle_retain | ( | VuoRectangle | r | ) |
Automatically generated function.
VuoRectangle VuoRectangle_union | ( | VuoRectangle | rectangleA, |
VuoRectangle | rectangleB | ||
) |
Returns the union area of rectangleA
and rectangleB
.
Definition at line 166 of file VuoRectangle.c.