FastLED 3.9.15
Loading...
Searching...
No Matches

◆ grad16() [3/3]

static fl::i16 grad16 ( fl::u8 hash,
fl::i16 x,
fl::i16 y,
fl::i16 z )
inlinestatic

Definition at line 116 of file noise.cpp.hpp.

116 {
117#if 0
118 switch(hash & 0xF) {
119 case 0: return (( x) + ( y))>>1;
120 case 1: return ((-x) + ( y))>>1;
121 case 2: return (( x) + (-y))>>1;
122 case 3: return ((-x) + (-y))>>1;
123 case 4: return (( x) + ( z))>>1;
124 case 5: return ((-x) + ( z))>>1;
125 case 6: return (( x) + (-z))>>1;
126 case 7: return ((-x) + (-z))>>1;
127 case 8: return (( y) + ( z))>>1;
128 case 9: return ((-y) + ( z))>>1;
129 case 10: return (( y) + (-z))>>1;
130 case 11: return ((-y) + (-z))>>1;
131 case 12: return (( y) + ( x))>>1;
132 case 13: return ((-y) + ( z))>>1;
133 case 14: return (( y) + (-x))>>1;
134 case 15: return ((-y) + (-z))>>1;
135 }
136#else
137 hash = hash&15;
138 fl::i16 u = hash<8?x:y;
139 fl::i16 v = hash<4?y:hash==12||hash==14?x:z;
140 if(hash&1) { u = -u; }
141 if(hash&2) { v = -v; }
142
143 return AVG15(u,v);
144#endif
145}
int y
Definition simple.h:93
int x
Definition simple.h:92
uint32_t z[NUM_LAYERS]
Definition Fire2023.h:93

References x, y, and z.

Referenced by inoise16_raw(), inoise16_raw(), inoise16_raw(), and inoise16_raw().

+ Here is the caller graph for this function: