FastLED 3.9.15
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages

◆ fill_raw_noise16into8()

void fill_raw_noise16into8 ( uint8_t * pData,
uint8_t num_points,
uint8_t octaves,
uint32_t x,
int scalex,
uint32_t time )

Fill a 1D 8-bit buffer with noise, using inoise16()

Parameters
pDatathe array of data to fill with noise values
num_pointsthe number of points of noise to compute
octavesthe number of octaves to use for noise. More octaves = more noise.
xx-axis coordinate on noise map (1D)
scalexthe scale (distance) between x points when filling in noise
timethe time position for the noise field

Definition at line 702 of file noise.cpp.

702 {
703 uint32_t _xx = x;
704 uint32_t scx = scale;
705 for(int o = 0; o < octaves; ++o) {
706 for(int i = 0,xx=_xx; i < num_points; ++i, xx+=scx) {
707 uint32_t accum = (inoise16(xx,time))>>o;
708 accum += (pData[i]<<8);
709 if(accum > 65535) { accum = 65535; }
710 pData[i] = accum>>8;
711 }
712
713 _xx <<= 1;
714 scx <<= 1;
715 }
716}
int x
Definition Audio.ino:71
UISlider scale("Scale", 1.0f, 0.0f, 1.0f, 0.01f)
uint8_t octaves
uint16_t inoise16(uint32_t x, uint32_t y, uint32_t z, uint32_t t)
16-bit, fixed point implementation of Perlin's noise.
Definition noise.cpp:440

References inoise16(), octaves, scale, and x.

Referenced by fill_noise16().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: