FastLED 3.9.15
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages

◆ SelectInterpPoints()

template<typename KeyT, typename ValT>
void SelectInterpPoints ( const KeyT & k,
const InterpData< KeyT, ValT > * array,
const int n,
int * dest_lower_bound,
int * dest_upper_bound )
inline

Definition at line 25 of file ApproximatingFunction.h.

29 {
30 if (n < 1) {
31 *dest_lower_bound = *dest_upper_bound = -1;
32 return;
33 }
34 if (k < array[0].key) {
35 *dest_lower_bound = *dest_upper_bound = 0;
36 return;
37 }
38
39 for (int i = 0; i < n - 1; ++i) {
40 const InterpData<KeyT, ValT>& curr = array[i];
41 const InterpData<KeyT, ValT>& next = array[i+1];
42
43 if (curr.key <= k && k <= next.key) {
44 *dest_lower_bound = i;
45 *dest_upper_bound = i+1;
46 return;
47 }
48 }
49 *dest_lower_bound = n - 1;
50 *dest_upper_bound = n - 1;
51}

References InterpData< KeyT, ValT >::key.

Referenced by Interp().

+ Here is the caller graph for this function: