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 826 of file noise.cpp.

829 {
830
831 if (num_leds <= 0) return;
832
833 for (int j = 0; j < num_leds; j += 255) {
834 const int LedsRemaining = num_leds - j;
835 const int LedsPer = LedsRemaining > 255 ? 255 : LedsRemaining; // limit to 255 max
836
837 if (LedsPer <= 0) continue;
838 FASTLED_STACK_ARRAY(uint8_t, V, LedsPer);
839 FASTLED_STACK_ARRAY(uint8_t, H, LedsPer);
840
841 fl::memfill(V, 0, LedsPer);
842 fl::memfill(H, 0, LedsPer);
843
844 fill_raw_noise8(V, LedsPer, octaves, x, scale, time);
845 fill_raw_noise8(H, LedsPer, hue_octaves, hue_x, hue_scale, time);
846
847 for (int i = 0; i < LedsPer; ++i) {
848 leds[i + j] = CHSV(H[i], 255, V[i]);
849 }
850 }
851}
CRGB leds[NUM_LEDS]
int x
Definition simple.h:92
uint16_t scale
Definition Noise.ino:74
uint8_t hue_octaves
uint8_t octaves
int hue_scale
#define FASTLED_STACK_ARRAY(TYPE, NAME, SIZE)
Definition array.h:185
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:670
void * memfill(void *ptr, int value, fl::size num)
Definition memfill.h:11
Representation of an HSV pixel (hue, saturation, value (aka brightness)).
Definition hsv.h:15

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

+ Here is the call graph for this function: