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

◆ fill_noise8()

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.

Parameters
ledspointer to LED array
num_ledsthe number of LEDs to fill
octavesthe number of octaves to use for value (brightness) noise
xx-axis coordinate on noise map for value (brightness) noise
scalethe scale (distance) between x points when filling in value (brightness) noise
hue_octavesthe number of octaves to use for color hue noise
hue_xx-axis coordinate on noise map for color hue noise
hue_scalethe scale (distance) between x points when filling in color hue noise
timethe time position for the noise field

Definition at line 845 of file noise.cpp.

848 {
849
850 if (num_leds <= 0) return;
851
852 for (int j = 0; j < num_leds; j += 255) {
853 const int LedsRemaining = num_leds - j;
854 const int LedsPer = LedsRemaining > 255 ? 255 : LedsRemaining; // limit to 255 max
855
856 if (LedsPer <= 0) continue;
857 FASTLED_STACK_ARRAY(uint8_t, V, LedsPer);
858 FASTLED_STACK_ARRAY(uint8_t, H, LedsPer);
859
860 memset(V, 0, LedsPer);
861 memset(H, 0, LedsPer);
862
863 fill_raw_noise8(V, LedsPer, octaves, x, scale, time);
864 fill_raw_noise8(H, LedsPer, hue_octaves, hue_x, hue_scale, time);
865
866 for (int i = 0; i < LedsPer; ++i) {
867 leds[i + j] = CHSV(H[i], 255, V[i]);
868 }
869 }
870}
CRGB leds[NUM_LEDS]
Definition Apa102.ino:11
int x
Definition Audio.ino:71
UISlider scale("Scale", 1.0f, 0.0f, 1.0f, 0.01f)
uint8_t hue_octaves
uint8_t octaves
int hue_scale
#define FASTLED_STACK_ARRAY(TYPE, NAME, SIZE)
Definition array.h:169
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()
Definition noise.cpp:689
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition chsv.h:16

References FASTLED_STACK_ARRAY, fill_raw_noise8(), hue_octaves, hue_scale, leds, octaves, scale, and x.

+ Here is the call graph for this function: