VuoRange C type definition.
Definition in file VuoRange.h.
Go to the source code of this file.
Classes | |
struct | VuoRange |
Defines a range with an optionally bound/unbound min/max. More... | |
Macros | |
#define | VuoRange_NoMinimum -INFINITY |
VuoRange.minimum's value when the range has no minimum. More... | |
#define | VuoRange_NoMaximum INFINITY |
VuoRange.maximum's value when the range has no maximum. More... | |
#define | VuoRange_SUPPORTS_COMPARISON |
This type has _areEqual() and _isLessThan() functions. More... | |
Functions | |
VuoRange | VuoRange_makeFromJson (struct json_object *js) |
struct json_object * | VuoRange_getJson (const VuoRange value) |
char * | VuoRange_getSummary (const VuoRange value) |
bool | VuoRange_areEqual (const VuoRange a, const VuoRange b) |
Returns true if the two ranges are equal (within a small tolerance). More... | |
bool | VuoRange_isLessThan (const VuoRange a, const VuoRange b) |
Returns true if a < b. More... | |
static VuoRange | VuoRange_make (VuoReal _minimum, VuoReal _maximum) __attribute__((const)) |
Creates a range. More... | |
static bool | VuoRange_isInverted (VuoRange range) __attribute__((const)) |
Returns true if the range is inverted (min greater than max). More... | |
static VuoRange | VuoRange_getOrderedRange (VuoRange range) __attribute__((const)) |
Returns a range where the min is never greater than the max. More... | |
static VuoRange | VuoRange_makeNonzero (VuoRange a) __attribute__((const)) |
If the range is empty (minimum == maximum), increases the maximum. More... | |
static VuoReal | VuoRange_clamp (VuoRange range, VuoReal value) __attribute__((const)) |
Returns a value clamped to range. More... | |
static VuoReal | VuoRange_scale (VuoRange from, VuoRange to, VuoReal value) __attribute__((const)) |
Returns a value scaled to range. More... | |
VuoRange | VuoRange_makeFromString (const char *str) |
Automatically generated function. More... | |
char * | VuoRange_getString (const VuoRange value) |
Automatically generated function. More... | |
void | VuoRange_retain (VuoRange value) |
Automatically generated function. More... | |
void | VuoRange_release (VuoRange value) |
Automatically generated function. More... | |
#define VuoRange_NoMaximum INFINITY |
VuoRange.maximum's value when the range has no maximum.
Definition at line 19 of file VuoRange.h.
#define VuoRange_NoMinimum -INFINITY |
VuoRange.minimum's value when the range has no minimum.
Definition at line 16 of file VuoRange.h.
#define VuoRange_SUPPORTS_COMPARISON |
This type has _areEqual() and _isLessThan() functions.
Definition at line 40 of file VuoRange.h.
Returns true if the two ranges are equal (within a small tolerance).
Definition at line 92 of file VuoRange.c.
Returns a value clamped to range.
Definition at line 102 of file VuoRange.h.
struct json_object* VuoRange_getJson | ( | const VuoRange | value | ) |
Encodes value
as a JSON object.
Definition at line 51 of file VuoRange.c.
Returns a range where the min is never greater than the max.
Definition at line 77 of file VuoRange.h.
char* VuoRange_getString | ( | const VuoRange | value | ) |
Automatically generated function.
char* VuoRange_getSummary | ( | const VuoRange | value | ) |
Returns a compact string representation of value
.
Definition at line 75 of file VuoRange.c.
|
inlinestatic |
Returns true if the range is inverted (min greater than max).
Definition at line 68 of file VuoRange.h.
Creates a range.
Definition at line 58 of file VuoRange.h.
VuoRange VuoRange_makeFromJson | ( | json_object * | js | ) |
Decodes the JSON object js
to create a new value.
Definition at line 38 of file VuoRange.c.
VuoRange VuoRange_makeFromString | ( | const char * | str | ) |
Automatically generated function.
If the range is empty (minimum == maximum), increases the maximum.
Definition at line 89 of file VuoRange.h.
void VuoRange_release | ( | VuoRange | value | ) |
Automatically generated function.
void VuoRange_retain | ( | VuoRange | value | ) |
Automatically generated function.
Returns a value scaled to range.
If value is outside of from
bounds it will be clamped. If either range contains an infinite bound value is returned unmodified.
Definition at line 117 of file VuoRange.h.