|
template<typename Type > |
Type | jmax (const Type a, const Type b) |
|
template<typename Type > |
Type | jmax (const Type a, const Type b, const Type c) |
|
template<typename Type > |
Type | jmax (const Type a, const Type b, const Type c, const Type d) |
|
template<typename Type > |
Type | jmin (const Type a, const Type b) |
|
template<typename Type > |
Type | jmin (const Type a, const Type b, const Type c) |
|
template<typename Type > |
Type | jmin (const Type a, const Type b, const Type c, const Type d) |
|
template<typename Type > |
const Type | findMinimum (const Type *data, int numValues) |
|
template<typename Type > |
const Type | findMaximum (const Type *values, int numValues) |
|
template<typename Type > |
void | findMinAndMax (const Type *values, int numValues, Type &lowest, Type &highest) |
|
template<typename Type > |
Type | jlimit (const Type lowerLimit, const Type upperLimit, const Type valueToConstrain) noexcept |
|
template<typename Type > |
bool | isPositiveAndBelow (Type valueToTest, Type upperLimit) noexcept |
|
template<> |
bool | isPositiveAndBelow (const int valueToTest, const int upperLimit) noexcept |
|
template<typename Type > |
bool | isPositiveAndNotGreaterThan (Type valueToTest, Type upperLimit) noexcept |
|
template<> |
bool | isPositiveAndNotGreaterThan (const int valueToTest, const int upperLimit) noexcept |
|
template<typename Type > |
void | swapVariables (Type &variable1, Type &variable2) |
|
template<typename Type1 > |
void | ignoreUnused (const Type1 &) noexcept |
|
template<typename Type1 , typename Type2 > |
void | ignoreUnused (const Type1 &, const Type2 &) noexcept |
|
template<typename Type1 , typename Type2 , typename Type3 > |
void | ignoreUnused (const Type1 &, const Type2 &, const Type3 &) noexcept |
|
template<typename Type1 , typename Type2 , typename Type3 , typename Type4 > |
void | ignoreUnused (const Type1 &, const Type2 &, const Type3 &, const Type4 &) noexcept |
|
template<typename Type , int N> |
int | numElementsInArray (Type(&array)[N]) |
|
template<typename Type > |
Type | juce_hypot (Type a, Type b) noexcept |
|
template<> |
float | juce_hypot (float a, float b) noexcept |
|
int64 | abs64 (const int64 n) noexcept |
|
template<typename FloatType > |
FloatType | degreesToRadians (FloatType degrees) noexcept |
|
template<typename FloatType > |
FloatType | radiansToDegrees (FloatType radians) noexcept |
|
template<typename NumericType > |
bool | juce_isfinite (NumericType) noexcept |
|
template<> |
bool | juce_isfinite (float value) noexcept |
|
template<> |
bool | juce_isfinite (double value) noexcept |
|
template<typename FloatType > |
int | roundToInt (const FloatType value) noexcept |
|
int | roundToInt (int value) noexcept |
|
int | roundToIntAccurate (const double value) noexcept |
|
int | roundDoubleToInt (const double value) noexcept |
|
int | roundFloatToInt (const float value) noexcept |
|
template<typename IntegerType > |
bool | isPowerOfTwo (IntegerType value) |
|
int | nextPowerOfTwo (int n) noexcept |
|
int | countNumberOfBits (uint32 n) noexcept |
|
int | countNumberOfBits (uint64 n) noexcept |
|
template<typename IntegerType > |
IntegerType | negativeAwareModulo (IntegerType dividend, const IntegerType divisor) noexcept |
|
template<typename NumericType > |
NumericType | square (NumericType n) noexcept |
|
template<typename Type >
Type jlimit |
( |
const Type |
lowerLimit, |
|
|
const Type |
upperLimit, |
|
|
const Type |
valueToConstrain |
|
) |
| |
|
inlinenoexcept |
Constrains a value to keep it within a given range.
This will check that the specified value lies between the lower and upper bounds specified, and if not, will return the nearest value that would be in-range. Effectively, it's like calling jmax (lowerLimit, jmin (upperLimit, value)).
Note that it expects that lowerLimit <= upperLimit. If this isn't true, the results will be unpredictable.
- Parameters
-
lowerLimit | the minimum value to return |
upperLimit | the maximum value to return |
valueToConstrain | the value to try to return |
- Returns
- the closest value to valueToConstrain which lies between lowerLimit and upperLimit (inclusive)
- See Also
- jlimit0To, jmin, jmax
int roundDoubleToInt |
( |
const double |
value | ) |
|
|
inlinenoexcept |
Fast floating-point-to-integer conversion.
This is faster than using the normal c++ cast to convert a double to an int, and it will round the value to the nearest integer, rather than rounding it down like the normal cast does.
Note that this routine gets its speed at the expense of some accuracy, and when rounding values whose floating point component is exactly 0.5, odd numbers and even numbers will be rounded up or down differently. For a more accurate conversion, see roundDoubleToIntAccurate().
int roundFloatToInt |
( |
const float |
value | ) |
|
|
inlinenoexcept |
Fast floating-point-to-integer conversion.
This is faster than using the normal c++ cast to convert a float to an int, and it will round the value to the nearest integer, rather than rounding it down like the normal cast does.
Note that this routine gets its speed at the expense of some accuracy, and when rounding values whose floating point component is exactly 0.5, odd numbers and even numbers will be rounded up or down differently.
template<typename FloatType >
Fast floating-point-to-integer conversion.
This is faster than using the normal c++ cast to convert a float to an int, and it will round the value to the nearest integer, rather than rounding it down like the normal cast does.
Note that this routine gets its speed at the expense of some accuracy, and when rounding values whose floating point component is exactly 0.5, odd numbers and even numbers will be rounded up or down differently.