FastLED 3.10.8
Loading...
Searching...
No Matches

◆ grad()

fl::i32 fl::perlin_s16x16::grad ( int hash,
fl::i32 x,
fl::i32 y )
static

Definition at line 84 of file perlin_s16x16.cpp.hpp.

84 {
85 struct GradCoeff { fl::i8 cx; fl::i8 cy; };
86 constexpr GradCoeff lut[16] = {
87 { 1, 1}, {-1, 1}, { 1, -1}, {-1, -1},
88 { 1, 0}, {-1, 0}, { 1, 0}, {-1, 0},
89 { 0, 1}, { 0, -1}, { 0, 1}, { 0, -1},
90 { 1, 1}, { 0, -1}, {-1, 1}, { 0, -1},
91 };
92 const GradCoeff &g = lut[hash & 15];
93 return g.cx * x + g.cy * y;
94}
InputGamut g
Definition rgbw.h:125
signed char i8
Definition stdint.h:130

References fl::FL_NO_EXCEPT, fl::g, fl::x, and fl::y.

Referenced by fl::perlin_s16x16_simd::pnoise2d_raw_simd4_vec().

+ Here is the caller graph for this function: