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

Function fill_raw_noise16into8

src/noise.cpp.hpp:688–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

686}
687
688void fill_raw_noise16into8(fl::u8 *pData, fl::u8 num_points, fl::u8 octaves, fl::u32 x, int scale, fl::u32 time) {
689 fl::u32 _xx = x;
690 fl::u32 scx = scale;
691 for(int o = 0; o < octaves; ++o) {
692 for(int i = 0,xx=_xx; i < num_points; ++i, xx+=scx) {
693 fl::u32 accum = (inoise16(xx,time))>>o;
694 accum += (pData[i]<<8);
695 if(accum > 65535) { accum = 65535; }
696 pData[i] = accum>>8;
697 }
698
699 _xx <<= 1;
700 scx <<= 1;
701 }
702}
703
704/// Fill a 2D 8-bit buffer with noise, using inoise8()
705/// @param pData the array of data to fill with noise values

Callers 1

fill_noise16Function · 0.85

Calls 1

inoise16Function · 0.85

Tested by

no test coverage detected