85 {
86
87
88
89
90
91
92
93
94
95 if (i >=
mState.mapping.size()) {
96
97
98 FASTLED_ASSERT(false, "Out of bounds access in Corkscrew at_splat: "
99 << i <<
" size: " <<
mState.mapping.size());
100 return Tile2x2_u8();
101 }
102
103 float i_floor = floorf(i);
104 float i_ceil = ceilf(i);
106
107 return splat(
mState.mapping[
static_cast<uint16_t
>(i_floor)]);
108 } else {
109
110 vec2f pos1 =
mState.mapping[
static_cast<uint16_t
>(i_floor)];
111 vec2f pos2 =
mState.mapping[
static_cast<uint16_t
>(i_ceil)];
112
113 if (pos2.x < pos1.x) {
114
115
117 }
118
119 vec2f interpolated_pos =
120 pos1 * (1.0f - (i - i_floor)) + pos2 * (i - i_floor);
121 return splat(interpolated_pos);
122 }
123}
#define ALMOST_EQUAL_FLOAT(a, b)
Tile2x2_u8 splat(vec2f xy)
"Splat" as in "splat pixel rendering" takes a pixel value in float x,y coordinates and "splats" it in...