MCPcopy Create free account
hub / github.com/FastLED/FastLED / fill_noise16

Function fill_noise16

src/noise.cpp.hpp:858–882  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

856}
857
858void fill_noise16(CRGB *leds, int num_leds,
859 fl::u8 octaves, fl::u16 x, int scale,
860 fl::u8 hue_octaves, fl::u16 hue_x, int hue_scale,
861 fl::u16 time, fl::u8 hue_shift) {
862
863 if (num_leds <= 0) return;
864
865 for (int j = 0; j < num_leds; j += 255) {
866 const int LedsRemaining = num_leds - j;
867 const int LedsPer = LedsRemaining > 255 ? 255 : LedsRemaining; // limit to 255 max
868 if (LedsPer <= 0) continue;
869 FASTLED_STACK_ARRAY(fl::u8, V, LedsPer);
870 FASTLED_STACK_ARRAY(fl::u8, H, LedsPer);
871
872 fl::memset(V, 0, LedsPer);
873 fl::memset(H, 0, LedsPer);
874
875 fill_raw_noise16into8(V, LedsPer, octaves, x, scale, time);
876 fill_raw_noise8(H, LedsPer, hue_octaves, hue_x, hue_scale, time);
877
878 for (int i = 0; i < LedsPer; ++i) {
879 leds[i + j] = CHSV(H[i] + hue_shift, 255, V[i]);
880 }
881 }
882}
883
884void fill_2dnoise8(CRGB *leds, int width, int height, bool serpentine,
885 fl::u8 octaves, fl::u16 x, int xscale, fl::u16 y, int yscale, fl::u16 time,

Callers

nothing calls this directly

Calls 3

memsetFunction · 0.85
fill_raw_noise16into8Function · 0.85
fill_raw_noise8Function · 0.85

Tested by

no test coverage detected