9#define VARIABLE_LENGTH_ARRAY_NEEDS_EMULATION 1
12#define VARIABLE_LENGTH_ARRAY_NEEDS_EMULATION 0
15#if !VARIABLE_LENGTH_ARRAY_NEEDS_EMULATION
16#define VARIABLE_LENGTH_ARRAY(TYPE, NAME, SIZE) TYPE NAME[SIZE]
19#define VARIABLE_LENGTH_ARRAY(TYPE, NAME, SIZE) \
20 TYPE* NAME = reinterpret_cast<TYPE*>(alloca(sizeof(TYPE) * (SIZE)))
26#define FASTLED_INTERNAL
32#pragma GCC diagnostic push
33#if defined(__GNUC__) && (__GNUC__ >= 6)
34 #pragma GCC diagnostic ignored "-Wstack-usage="
36 #pragma GCC diagnostic ignored "-Wunknown-warning-option"
42#define P(x) FL_PGM_READ_BYTE_NEAR(p + x)
44FASTLED_NAMESPACE_BEGIN
48 151, 160, 137, 91, 90, 15, 131, 13, 201, 95, 96, 53, 194, 233, 7, 225,
49 140, 36, 103, 30, 69, 142, 8, 99, 37, 240, 21, 10, 23, 190, 6, 148,
50 247, 120, 234, 75, 0, 26, 197, 62, 94, 252, 219, 203, 117, 35, 11, 32,
51 57, 177, 33, 88, 237, 149, 56, 87, 174, 20, 125, 136, 171, 168, 68, 175,
52 74, 165, 71, 134, 139, 48, 27, 166, 77, 146, 158, 231, 83, 111, 229, 122,
53 60, 211, 133, 230, 220, 105, 92, 41, 55, 46, 245, 40, 244, 102, 143, 54,
54 65, 25, 63, 161, 1, 216, 80, 73, 209, 76, 132, 187, 208, 89, 18, 169,
55 200, 196, 135, 130, 116, 188, 159, 86, 164, 100, 109, 198, 173, 186, 3, 64,
56 52, 217, 226, 250, 124, 123, 5, 202, 38, 147, 118, 126, 255, 82, 85, 212,
57 207, 206, 59, 227, 47, 16, 58, 17, 182, 189, 28, 42, 223, 183, 170, 213,
58 119, 248, 152, 2, 44, 154, 163, 70, 221, 153, 101, 155, 167, 43, 172, 9,
59 129, 22, 39, 253, 19, 98, 108, 110, 79, 113, 224, 232, 178, 185, 112, 104,
60 218, 246, 97, 228, 251, 34, 242, 193, 238, 210, 144, 12, 191, 179, 162, 241,
61 81, 51, 145, 235, 249, 14, 239, 107, 49, 192, 214, 31, 181, 199, 106, 157,
62 184, 84, 204, 176, 115, 121, 50, 45, 127, 4, 150, 254, 138, 236, 205, 93,
63 222, 114, 67, 29, 24, 72, 243, 141, 128, 195, 78, 66, 215, 61, 156, 180,
70#if FASTLED_NOISE_ALLOW_AVERAGE_TO_OVERFLOW == 1
71#define AVG15(U,V) (((U)+(V)) >> 1)
74#if defined(__AVR__) && (LIB8_ATTINY == 0)
75#define AVG15(U,V) (avg15_inline_avr_mul((U),(V)))
79static int16_t
inline __attribute__((always_inline)) avg15_inline_avr_mul( int16_t i, int16_t j)
89 "adc %A[i], %A[j] \n\t"
90 "adc %B[i], %B[j] \n\t"
96#define AVG15(U,V) (avg15((U),(V)))
102#if FASTLED_NOISE_FIXED == 0
103#define EASE8(x) (FADE(x) )
104#define EASE16(x) (FADE(x) )
106#define EASE8(x) (ease8InOutQuad(x) )
107#define EASE16(x) (ease16InOutQuad(x))
114#define FADE logfade12
115#define LERP(a,b,u) lerp15by12(a,b,u)
117#define FADE(x) scale16(x,x)
118#define LERP(a,b,u) lerp15by16(a,b,u)
124static int16_t
inline __attribute__((always_inline)) grad16(uint8_t hash, int16_t x, int16_t y, int16_t z) {
127 case 0:
return (( x) + ( y))>>1;
128 case 1:
return ((-x) + ( y))>>1;
129 case 2:
return (( x) + (-y))>>1;
130 case 3:
return ((-x) + (-y))>>1;
131 case 4:
return (( x) + ( z))>>1;
132 case 5:
return ((-x) + ( z))>>1;
133 case 6:
return (( x) + (-z))>>1;
134 case 7:
return ((-x) + (-z))>>1;
135 case 8:
return (( y) + ( z))>>1;
136 case 9:
return ((-y) + ( z))>>1;
137 case 10:
return (( y) + (-z))>>1;
138 case 11:
return ((-y) + (-z))>>1;
139 case 12:
return (( y) + ( x))>>1;
140 case 13:
return ((-y) + ( z))>>1;
141 case 14:
return (( y) + (-x))>>1;
142 case 15:
return ((-y) + (-z))>>1;
146 int16_t u = hash<8?x:y;
147 int16_t v = hash<4?y:hash==12||hash==14?x:z;
148 if(hash&1) { u = -u; }
149 if(hash&2) { v = -v; }
155static int16_t
inline __attribute__((always_inline)) grad16(uint8_t hash, int16_t x, int16_t y) {
158 if(hash < 4) { u = x; v = y; }
else { u = y; v = x; }
159 if(hash&1) { u = -u; }
160 if(hash&2) { v = -v; }
165static int16_t
inline __attribute__((always_inline)) grad16(uint8_t hash, int16_t x) {
168 if(hash > 8) { u=x;v=x; }
169 else if(hash < 4) { u=x;v=1; }
171 if(hash&1) { u = -u; }
172 if(hash&2) { v = -v; }
181static int8_t
inline __attribute__((always_inline)) selectBasedOnHashBit(uint8_t hash, uint8_t bitnumber, int8_t a, int8_t b) {
184 result = (hash & (1<<bitnumber)) ? a : b;
187 "mov %[result],%[a] \n\t"
188 "sbrs %[hash],%[bitnumber] \n\t"
189 "mov %[result],%[b] \n\t"
190 : [result]
"=r" (result)
192 [bitnumber]
"M" (bitnumber),
200static int8_t
inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t x, int8_t y, int8_t z) {
203 case 0:
return (( x) + ( y))>>1;
204 case 1:
return ((-x) + ( y))>>1;
205 case 2:
return (( x) + (-y))>>1;
206 case 3:
return ((-x) + (-y))>>1;
207 case 4:
return (( x) + ( z))>>1;
208 case 5:
return ((-x) + ( z))>>1;
209 case 6:
return (( x) + (-z))>>1;
210 case 7:
return ((-x) + (-z))>>1;
211 case 8:
return (( y) + ( z))>>1;
212 case 9:
return ((-y) + ( z))>>1;
213 case 10:
return (( y) + (-z))>>1;
214 case 11:
return ((-y) + (-z))>>1;
215 case 12:
return (( y) + ( x))>>1;
216 case 13:
return ((-y) + ( z))>>1;
217 case 14:
return (( y) + (-x))>>1;
218 case 15:
return ((-y) + (-z))>>1;
226 u = selectBasedOnHashBit( hash, 3, y, x);
229 v = hash<4?y:hash==12||hash==14?x:z;
235 if( hash==12 || hash==14) {
243 if(hash&1) { u = -u; }
244 if(hash&2) { v = -v; }
250static int8_t
inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t x, int8_t y)
263 if(hash&1) { u = -u; }
264 if(hash&2) { v = -v; }
269static int8_t
inline __attribute__((always_inline)) grad8(uint8_t hash, int8_t x)
286 if(hash&1) { u = -u; }
287 if(hash&2) { v = -v; }
294uint16_t logfade12(uint16_t val) {
298static int16_t
inline __attribute__((always_inline)) lerp15by12( int16_t a, int16_t b,
fract16 frac)
303 uint16_t delta = b - a;
304 uint16_t scaled =
scale16(delta,frac<<4);
307 uint16_t delta = a - b;
308 uint16_t scaled =
scale16(delta,frac<<4);
315static int8_t
inline __attribute__((always_inline)) lerp7by8( int8_t a, int8_t b,
fract8 frac)
324 uint8_t delta = b - a;
325 uint8_t scaled =
scale8( delta, frac);
328 uint8_t delta = a - b;
329 uint8_t scaled =
scale8( delta, frac);
338 uint8_t X = (x>>16)&0xFF;
339 uint8_t Y = (y>>16)&0xFF;
340 uint8_t Z = (z>>16)&0xFF;
345 uint8_t AB =
P(A+1)+Z;
346 uint8_t B =
P(X+1)+Y;
347 uint8_t BA =
P(B) + Z;
348 uint8_t BB =
P(B+1)+Z;
351 uint16_t u = x & 0xFFFF;
352 uint16_t v = y & 0xFFFF;
353 uint16_t w = z & 0xFFFF;
356 int16_t xx = (u >> 1) & 0x7FFF;
357 int16_t yy = (v >> 1) & 0x7FFF;
358 int16_t zz = (w >> 1) & 0x7FFF;
359 uint16_t N = 0x8000L;
361 u = EASE16(u); v = EASE16(v); w = EASE16(w);
365 int16_t X1 = LERP(grad16(
P(AA), xx, yy, zz), grad16(
P(BA), xx - N, yy, zz), u);
366 int16_t X2 = LERP(grad16(
P(AB), xx, yy-N, zz), grad16(
P(BB), xx - N, yy - N, zz), u);
367 int16_t X3 = LERP(grad16(
P(AA+1), xx, yy, zz-N), grad16(
P(BA+1), xx - N, yy, zz-N), u);
368 int16_t X4 = LERP(grad16(
P(AB+1), xx, yy-N, zz-N), grad16(
P(BB+1), xx - N, yy - N, zz - N), u);
370 int16_t Y1 = LERP(X1,X2,v);
371 int16_t Y2 = LERP(X3,X4,v);
373 int16_t ans = LERP(Y1,Y2,w);
378uint16_t
inoise16(uint32_t x, uint32_t y, uint32_t z) {
404 uint8_t B =
P(X+1)+Y;
409 uint16_t u = x & 0xFFFF;
410 uint16_t v = y & 0xFFFF;
413 int16_t xx = (u >> 1) & 0x7FFF;
414 int16_t yy = (v >> 1) & 0x7FFF;
415 uint16_t N = 0x8000L;
417 u = EASE16(u); v = EASE16(v);
419 int16_t X1 = LERP(grad16(
P(AA), xx, yy), grad16(
P(BA), xx - N, yy), u);
420 int16_t X2 = LERP(grad16(
P(AB), xx, yy-N), grad16(
P(BB), xx - N, yy - N), u);
422 int16_t ans = LERP(X1,X2,v);
454 uint16_t u = x & 0xFFFF;
457 int16_t xx = (u >> 1) & 0x7FFF;
458 uint16_t N = 0x8000L;
462 int16_t ans = LERP(grad16(
P(AA), xx), grad16(
P(BA), xx - N), u);
468 return ((uint32_t)((int32_t)
inoise16_raw(x) + 17308L)) << 1;
481 uint8_t AB =
P(A+1)+Z;
482 uint8_t B =
P(X+1)+Y;
483 uint8_t BA =
P(B) + Z;
484 uint8_t BB =
P(B+1)+Z;
492 int8_t xx = ((uint8_t)(x)>>1) & 0x7F;
493 int8_t yy = ((uint8_t)(y)>>1) & 0x7F;
494 int8_t zz = ((uint8_t)(z)>>1) & 0x7F;
497 u = EASE8(u); v = EASE8(v); w = EASE8(w);
499 int8_t X1 = lerp7by8(grad8(
P(AA), xx, yy, zz), grad8(
P(BA), xx - N, yy, zz), u);
500 int8_t X2 = lerp7by8(grad8(
P(AB), xx, yy-N, zz), grad8(
P(BB), xx - N, yy - N, zz), u);
501 int8_t X3 = lerp7by8(grad8(
P(AA+1), xx, yy, zz-N), grad8(
P(BA+1), xx - N, yy, zz-N), u);
502 int8_t X4 = lerp7by8(grad8(
P(AB+1), xx, yy-N, zz-N), grad8(
P(BB+1), xx - N, yy - N, zz - N), u);
504 int8_t Y1 = lerp7by8(X1,X2,v);
505 int8_t Y2 = lerp7by8(X3,X4,v);
507 int8_t ans = lerp7by8(Y1,Y2,w);
512uint8_t
inoise8(uint16_t x, uint16_t y, uint16_t z) {
516 uint8_t ans =
qadd8( n, n);
530 uint8_t B =
P(X+1)+Y;
539 int8_t xx = ((uint8_t)(x)>>1) & 0x7F;
540 int8_t yy = ((uint8_t)(y)>>1) & 0x7F;
543 u = EASE8(u); v = EASE8(v);
545 int8_t X1 = lerp7by8(grad8(
P(AA), xx, yy), grad8(
P(BA), xx - N, yy), u);
546 int8_t X2 = lerp7by8(grad8(
P(AB), xx, yy-N), grad8(
P(BB), xx - N, yy - N), u);
548 int8_t ans = lerp7by8(X1,X2,v);
560 uint8_t ans =
qadd8( n, n);
580 int8_t xx = ((uint8_t)(x)>>1) & 0x7F;
585 int8_t ans = lerp7by8(grad8(
P(AA), xx), grad8(
P(BA), xx - N), u);
593 uint8_t ans =
qadd8(n,n);
611void fill_raw_noise8(uint8_t *pData, uint8_t num_points, uint8_t octaves, uint16_t x,
int scale, uint16_t time) {
613 uint32_t scx = scale;
614 for(
int o = 0; o < octaves; ++o) {
615 for(
int i = 0,xx=_xx; i < num_points; ++i, xx+=scx) {
624void fill_raw_noise16into8(uint8_t *pData, uint8_t num_points, uint8_t octaves, uint32_t x,
int scale, uint32_t time) {
626 uint32_t scx = scale;
627 for(
int o = 0; o < octaves; ++o) {
628 for(
int i = 0,xx=_xx; i < num_points; ++i, xx+=scx) {
629 uint32_t accum = (
inoise16(xx,time))>>o;
630 accum += (pData[i]<<8);
631 if(accum > 65535) { accum = 65535; }
654void fill_raw_2dnoise8(uint8_t *pData,
int width,
int height, uint8_t octaves,
q44 freq44,
fract8 amplitude,
int skip, uint16_t x, int16_t scalex, uint16_t y, int16_t scaley, uint16_t time) {
656 fill_raw_2dnoise8(pData, width, height, octaves-1, freq44, amplitude, skip+1, x*freq44, freq44 * scalex, y*freq44, freq44 * scaley, time);
665 fract8 invamp = 255-amplitude;
667 for(
int i = 0; i < height; ++i, y+=scaley) {
668 uint8_t *pRow = pData + (i*width);
670 for(
int j = 0; j < width; ++j, xx+=scalex) {
671 uint8_t noise_base =
inoise8(xx,y,time);
672 noise_base = (0x80 & noise_base) ? (noise_base - 127) : (127 - noise_base);
673 noise_base =
scale8(noise_base<<1,amplitude);
675 pRow[j] =
scale8(pRow[j],invamp) + noise_base;
677 for(
int ii = i; ii<(i+skip) && ii<height; ++ii) {
678 uint8_t *pRow = pData + (ii*width);
679 for(
int jj=j; jj<(j+skip) && jj<width; ++jj) {
680 pRow[jj] =
scale8(pRow[jj],invamp) + noise_base;
688void fill_raw_2dnoise8(uint8_t *pData,
int width,
int height, uint8_t octaves, uint16_t x,
int scalex, uint16_t y,
int scaley, uint16_t time) {
689 fill_raw_2dnoise8(pData, width, height, octaves,
q44(2,0), 128, 1, x, scalex, y, scaley, time);
692void fill_raw_2dnoise16(uint16_t *pData,
int width,
int height, uint8_t octaves,
q88 freq88,
fract16 amplitude,
int skip, uint32_t x, int32_t scalex, uint32_t y, int32_t scaley, uint32_t time) {
694 fill_raw_2dnoise16(pData, width, height, octaves-1, freq88, amplitude, skip, x *freq88 , scalex *freq88, y * freq88, scaley * freq88, time);
702 fract16 invamp = 65535-amplitude;
703 for(
int i = 0; i < height; i+=skip, y+=scaley) {
704 uint16_t *pRow = pData + (i*width);
705 for(
int j = 0,xx=x; j < width; j+=skip, xx+=scalex) {
706 uint16_t noise_base =
inoise16(xx,y,time);
707 noise_base = (0x8000 & noise_base) ? noise_base - (32767) : 32767 - noise_base;
708 noise_base =
scale16(noise_base<<1, amplitude);
710 pRow[j] =
scale16(pRow[j],invamp) + noise_base;
712 for(
int ii = i; ii<(i+skip) && ii<height; ++ii) {
713 uint16_t *pRow = pData + (ii*width);
714 for(
int jj=j; jj<(j+skip) && jj<width; ++jj) {
715 pRow[jj] =
scale16(pRow[jj],invamp) + noise_base;
730void fill_raw_2dnoise16into8(uint8_t *pData,
int width,
int height, uint8_t octaves,
q44 freq44,
fract8 amplitude,
int skip, uint32_t x, int32_t scalex, uint32_t y, int32_t scaley, uint32_t time) {
732 fill_raw_2dnoise16into8(pData, width, height, octaves-1, freq44, amplitude, skip+1, x*freq44, scalex *freq44, y*freq44, scaley * freq44, time);
741 fract8 invamp = 255-amplitude;
742 for(
int i = 0; i < height; i+=skip, y+=scaley) {
743 uint8_t *pRow = pData + (i*width);
745 for(
int j = 0; j < width; j+=skip, xx+=scalex) {
746 uint16_t noise_base =
inoise16(xx,y,time);
747 noise_base = (0x8000 & noise_base) ? noise_base - (32767) : 32767 - noise_base;
748 noise_base =
scale8(noise_base>>7,amplitude);
750 pRow[j] =
qadd8(
scale8(pRow[j],invamp),noise_base);
752 for(
int ii = i; ii<(i+skip) && ii<height; ++ii) {
753 uint8_t *pRow = pData + (ii*width);
754 for(
int jj=j; jj<(j+skip) && jj<width; ++jj) {
755 pRow[jj] =
scale8(pRow[jj],invamp) + noise_base;
763void fill_raw_2dnoise16into8(uint8_t *pData,
int width,
int height, uint8_t octaves, uint32_t x,
int scalex, uint32_t y,
int scaley, uint32_t time) {
764 fill_raw_2dnoise16into8(pData, width, height, octaves,
q44(2,0), 171, 1, x, scalex, y, scaley, time);
768 uint8_t octaves, uint16_t x,
int scale,
769 uint8_t hue_octaves, uint16_t hue_x,
int hue_scale,
772 if (num_leds <= 0)
return;
774 for (
int j = 0; j < num_leds; j += 255) {
775 const int LedsRemaining = num_leds - j;
776 const int LedsPer = LedsRemaining > 255 ? 255 : LedsRemaining;
778 if (LedsPer <= 0)
continue;
779 VARIABLE_LENGTH_ARRAY(uint8_t, V, LedsPer);
780 VARIABLE_LENGTH_ARRAY(uint8_t, H, LedsPer);
782 memset(V, 0, LedsPer);
783 memset(H, 0, LedsPer);
788 for (
int i = 0; i < LedsPer; ++i) {
789 leds[i + j] =
CHSV(H[i], 255, V[i]);
795 uint8_t octaves, uint16_t x,
int scale,
796 uint8_t hue_octaves, uint16_t hue_x,
int hue_scale,
797 uint16_t time, uint8_t hue_shift) {
799 if (num_leds <= 0)
return;
801 for (
int j = 0; j < num_leds; j += 255) {
802 const int LedsRemaining = num_leds - j;
803 const int LedsPer = LedsRemaining > 255 ? 255 : LedsRemaining;
804 if (LedsPer <= 0)
continue;
805 VARIABLE_LENGTH_ARRAY(uint8_t, V, LedsPer);
806 VARIABLE_LENGTH_ARRAY(uint8_t, H, LedsPer);
808 memset(V, 0, LedsPer);
809 memset(H, 0, LedsPer);
814 for (
int i = 0; i < LedsPer; ++i) {
815 leds[i + j] =
CHSV(H[i] + hue_shift, 255, V[i]);
821 uint8_t octaves, uint16_t x,
int xscale, uint16_t y,
int yscale, uint16_t time,
822 uint8_t hue_octaves, uint16_t hue_x,
int hue_xscale, uint16_t hue_y, uint16_t hue_yscale,uint16_t hue_time,
bool blend) {
823 const size_t array_size = (size_t)height * width;
824 if (array_size <= 0)
return;
825 VARIABLE_LENGTH_ARRAY(uint8_t, V, array_size);
826 VARIABLE_LENGTH_ARRAY(uint8_t, H, array_size);
828 memset(V,0,height*width);
829 memset(H,0,height*width);
832 fill_raw_2dnoise8((uint8_t*)H,width,height,hue_octaves,hue_x,hue_xscale,hue_y,hue_yscale,hue_time);
836 for(
int i = 0; i < height; ++i) {
838 for(
int j = 0; j < width; ++j) {
839 CRGB led(
CHSV(H[(h1-i)*width + (w1-j)], 255, V[i*width + j]));
842 if(serpentine && (i & 0x1)) {
848 CRGB temp = leds[wb+pos];
851 leds[wb+pos] = temp + led;
861 uint8_t octaves, uint32_t x,
int xscale, uint32_t y,
int yscale, uint32_t time,
862 uint8_t hue_octaves, uint16_t hue_x,
int hue_xscale, uint16_t hue_y, uint16_t hue_yscale,uint16_t hue_time,
bool blend, uint16_t hue_shift) {
864 VARIABLE_LENGTH_ARRAY(uint8_t, V, height*width);
865 VARIABLE_LENGTH_ARRAY(uint8_t, H, height*width);
867 memset(V,0,height*width);
868 memset(H,0,height*width);
870 fill_raw_2dnoise16into8((uint8_t*)V,width,height,octaves,
q44(2,0),171,1,x,xscale,y,yscale,time);
873 fill_raw_2dnoise8((uint8_t*)H,width,height,hue_octaves,hue_x,hue_xscale,hue_y,hue_yscale,hue_time);
880 for(
int i = 0; i < height; ++i) {
882 for(
int j = 0; j < width; ++j) {
883 CRGB led(
CHSV(hue_shift + (H[(h1-i)*width + (w1-j)]), 196, V[i*width + j]));
886 if(serpentine && (i & 0x1)) {
891 leds[wb+pos] >>= 1; leds[wb+pos] += (led>>=1);
901#pragma GCC diagnostic pop
central include file for FastLED, defines the CFastLED class/object
Template class for representing fractional ints.
#define FL_PROGMEM
PROGMEM keyword for storage.
CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
Computes a new color blended some fraction of the way between two other colors.
qfx< uint8_t, 4, 4 > q44
A 4.4 integer (4 bits integer, 4 bits fraction)
uint8_t fract8
ANSI: unsigned short _Fract.
uint16_t fract16
ANSI: unsigned _Fract.
LIB8STATIC_ALWAYS_INLINE uint8_t qadd8(uint8_t i, uint8_t j)
Add one byte to another, saturating at 0xFF.
LIB8STATIC_ALWAYS_INLINE int8_t avg7(int8_t i, int8_t j)
Calculate an integer average of two signed 7-bit integers (int8_t).
void fill_raw_noise8(uint8_t *pData, uint8_t num_points, uint8_t octaves, uint16_t x, int scale, uint16_t time)
Fill a 1D 8-bit buffer with noise, using inoise8()
void fill_raw_2dnoise16into8(uint8_t *pData, int width, int height, uint8_t octaves, q44 freq44, fract8 amplitude, int skip, uint32_t x, int32_t scalex, uint32_t y, int32_t scaley, uint32_t time)
Fill a 2D 8-bit buffer with noise, using inoise16()
void fill_2dnoise8(CRGB *leds, int width, int height, bool serpentine, uint8_t octaves, uint16_t x, int xscale, uint16_t y, int yscale, uint16_t time, uint8_t hue_octaves, uint16_t hue_x, int hue_xscale, uint16_t hue_y, uint16_t hue_yscale, uint16_t hue_time, bool blend)
Fill an LED matrix with random colors, using 8-bit noise.
void fill_2dnoise16(CRGB *leds, int width, int height, bool serpentine, uint8_t octaves, uint32_t x, int xscale, uint32_t y, int yscale, uint32_t time, uint8_t hue_octaves, uint16_t hue_x, int hue_xscale, uint16_t hue_y, uint16_t hue_yscale, uint16_t hue_time, bool blend, uint16_t hue_shift)
Fill an LED matrix with random colors, using 16-bit noise.
void fill_noise8(CRGB *leds, int num_leds, uint8_t octaves, uint16_t x, int scale, uint8_t hue_octaves, uint16_t hue_x, int hue_scale, uint16_t time)
Fill an LED array with random colors, using 8-bit noise.
void fill_noise16(CRGB *leds, int num_leds, uint8_t octaves, uint16_t x, int scale, uint8_t hue_octaves, uint16_t hue_x, int hue_scale, uint16_t time, uint8_t hue_shift)
Fill an LED array with random colors, using 16-bit noise.
void fill_raw_2dnoise16(uint16_t *pData, int width, int height, uint8_t octaves, q88 freq88, fract16 amplitude, int skip, uint32_t x, int32_t scalex, uint32_t y, int32_t scaley, uint32_t time)
Fill a 2D 16-bit buffer with noise, using inoise16()
void fill_raw_noise16into8(uint8_t *pData, uint8_t num_points, uint8_t octaves, uint32_t x, int scale, uint32_t time)
Fill a 1D 8-bit buffer with noise, using inoise16()
int8_t inoise8_raw(uint16_t x, uint16_t y, uint16_t z)
8-bit, fixed point implementation of Perlin's noise without scaling.
int16_t inoise16_raw(uint32_t x, uint32_t y, uint32_t z)
16-bit, fixed point implementation of Perlin's noise without scaling.
uint16_t inoise16(uint32_t x, uint32_t y, uint32_t z)
16-bit, fixed point implementation of Perlin's noise.
uint8_t inoise8(uint16_t x, uint16_t y, uint16_t z)
8-Bit, fixed point implementation of Perlin's noise.
FASTLED_FORCE_INLINE CRGB & nscale8(uint8_t scaledown)
Scale down a RGB to N/256ths of its current brightness, using "plain math" dimming rules.
LIB8STATIC uint16_t scale16(uint16_t i, fract16 scale)
Scale a 16-bit unsigned value by an 16-bit value, which is treated as the numerator of a fraction who...
LIB8STATIC_ALWAYS_INLINE uint8_t scale8(uint8_t i, fract8 scale)
Scale one byte by a second one, which is treated as the numerator of a fraction whose denominator is ...
#define P(x)
Reads a single byte from the p array.
void fill_raw_2dnoise8(uint8_t *pData, int width, int height, uint8_t octaves, q44 freq44, fract8 amplitude, int skip, uint16_t x, int16_t scalex, uint16_t y, int16_t scaley, uint16_t time)
Fill a 2D 8-bit buffer with noise, using inoise8()
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Representation of an RGB pixel (Red, Green, Blue)