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

◆ grad16() [3/3]

static int16_t grad16 ( uint8_t hash,
int16_t x,
int16_t y,
int16_t z )
inlinestatic

Definition at line 133 of file noise.cpp.

133 {
134#if 0
135 switch(hash & 0xF) {
136 case 0: return (( x) + ( y))>>1;
137 case 1: return ((-x) + ( y))>>1;
138 case 2: return (( x) + (-y))>>1;
139 case 3: return ((-x) + (-y))>>1;
140 case 4: return (( x) + ( z))>>1;
141 case 5: return ((-x) + ( z))>>1;
142 case 6: return (( x) + (-z))>>1;
143 case 7: return ((-x) + (-z))>>1;
144 case 8: return (( y) + ( z))>>1;
145 case 9: return ((-y) + ( z))>>1;
146 case 10: return (( y) + (-z))>>1;
147 case 11: return ((-y) + (-z))>>1;
148 case 12: return (( y) + ( x))>>1;
149 case 13: return ((-y) + ( z))>>1;
150 case 14: return (( y) + (-x))>>1;
151 case 15: return ((-y) + (-z))>>1;
152 }
153#else
154 hash = hash&15;
155 int16_t u = hash<8?x:y;
156 int16_t v = hash<4?y:hash==12||hash==14?x:z;
157 if(hash&1) { u = -u; }
158 if(hash&2) { v = -v; }
159
160 return AVG15(u,v);
161#endif
162}
uint32_t z[NUM_LAYERS]
Definition Fire2023.ino:82
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
uint32_t y[NUM_LAYERS]
Definition Fire2023.ino:81

References x, y, and z.

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

+ Here is the caller graph for this function: