Vuo 2.4.4
|
A 2-dimensional axis-aligned box.
Classes | |
struct | VuoRectangle |
A 2-dimensional axis-aligned box. More... | |
Macros | |
#define | VuoRectangle_SUPPORTS_COMPARISON |
Instances of this type can be compared and sorted. | |
Functions | |
VuoRectangle | VuoRectangle_makeFromJson (json_object *js) |
Decodes the JSON object js to create a new value. | |
json_object * | VuoRectangle_getJson (const VuoRectangle r) |
Encodes r as a JSON object. | |
char * | VuoRectangle_getSummary (const VuoRectangle r) |
Returns a compact string representation of r (comma-separated coordinates). | |
bool | VuoRectangle_areEqual (const VuoRectangle a, const VuoRectangle b) |
Returns true if the two rectangles are equal (within tolerance). | |
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 . | |
static VuoRectangle | VuoRectangle_make (float centerX, float centerY, float width, float height) __attribute__((const)) |
Returns a rectangle with the specified coordinates. | |
static VuoRectangle | VuoRectangle_makeTopLeft (float leftX, float topY, float width, float height) __attribute__((const)) |
Returns a rectangle with the specified coordinates. | |
bool | VuoRectangle_isPointInside (VuoRectangle r, VuoPoint2d p) |
Returns true if p is inside r . | |
VuoRectangle | VuoRectangle_intersection (VuoRectangle rectangleA, VuoRectangle rectangleB) |
Returns the intersecting area of rectangleA and rectangleB . | |
VuoRectangle | VuoRectangle_union (VuoRectangle rectangleA, VuoRectangle rectangleB) |
Returns the union area of rectangleA and rectangleB . | |
char * | VuoRectangle_getString (const VuoRectangle r) |
Automatically generated function. | |
void | VuoRectangle_retain (VuoRectangle r) |
Automatically generated function. | |
void | VuoRectangle_release (VuoRectangle r) |
Automatically generated function. | |
#define VuoRectangle_SUPPORTS_COMPARISON |
Instances of this type can be compared and sorted.
Definition at line 36 of file VuoRectangle.h.
bool VuoRectangle_areEqual | ( | const VuoRectangle | a, |
const VuoRectangle | b | ||
) |
Returns true if the two rectangles are equal (within tolerance).
Definition at line 86 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 76 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 127 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 98 of file VuoRectangle.c.
bool VuoRectangle_isPointInside | ( | VuoRectangle | r, |
VuoPoint2d | p | ||
) |
Returns true if p
is inside r
.
Definition at line 110 of file VuoRectangle.c.
|
inlinestatic |
Returns a rectangle with the specified coordinates.
Definition at line 58 of file VuoRectangle.h.
VuoRectangle VuoRectangle_makeFromJson | ( | json_object * | js | ) |
Decodes the JSON object js
to create a new value.
Definition at line 48 of file VuoRectangle.c.
|
inlinestatic |
Returns a rectangle with the specified coordinates.
Definition at line 67 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 167 of file VuoRectangle.c.