helping mac

This commit is contained in:
rusefillc 2021-12-20 01:23:10 -05:00
parent 8f2ae9efc2
commit 44389c5eca
1 changed files with 14 additions and 14 deletions

View File

@ -20,7 +20,6 @@
#define INTERPOLATION_A(x1, y1, x2, y2) ((y1 - y2) / (x1 - x2))
int findIndex(const float array[], int size, float value);
#define findIndexMsg(msg, array, size, value) findIndexMsgExt<float>(msg, array, size, value)
int findIndex2(const float array[], unsigned size, float value);
float interpolateClamped(float x1, float y1, float x2, float y2, float x);
float interpolateMsg(const char *msg, float x1, float y1, float x2, float y2, float x);
@ -143,19 +142,6 @@ float interpolate3d(const VType (&table)[RNum][CNum],
return priv::linterp(left, right, col.Frac);
}
/**
* Sets specified value for specified key in a correction curve
* see also setLinearCurve()
*/
template<typename VType, typename kType>
void setCurveValue(const kType bins[], VType values[], int size, float key, float value) {
int index = findIndexMsg("tbVl", bins, size, key);
if (index == -1)
index = 0;
values[index] = value;
}
/** @brief Binary search
* @returns the highest index within sorted array such that array[i] is greater than or equal to the parameter
* @note If the parameter is smaller than the first element of the array, -1 is returned.
@ -216,6 +202,20 @@ int findIndexMsgExt(const char *msg, const kType array[], int size, kType value)
return middle;
}
#define findIndexMsg(msg, array, size, value) findIndexMsgExt<float>(msg, array, size, value)
/**
* Sets specified value for specified key in a correction curve
* see also setLinearCurve()
*/
template<typename VType, typename kType>
void setCurveValue(const kType bins[], VType values[], int size, float key, float value) {
int index = findIndexMsg("tbVl", bins, size, key);
if (index == -1)
index = 0;
values[index] = value;
}
void initInterpolation();
class FastInterpolation {