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

◆ fill_raw_noise8()

void fill_raw_noise8 ( uint8_t * pData,
uint8_t num_points,
uint8_t octaves,
uint16_t x,
int scalex,
uint16_t time )

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

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

689 {
690 uint32_t _xx = x;
691 uint32_t scx = scale;
692 for(int o = 0; o < octaves; ++o) {
693 for(int i = 0,xx=_xx; i < num_points; ++i, xx+=scx) {
694 pData[i] = qadd8(pData[i],inoise8(xx,time)>>o);
695 }
696
697 _xx <<= 1;
698 scx <<= 1;
699 }
700}
int x
Definition Audio.ino:71
UISlider scale("Scale", 1.0f, 0.0f, 1.0f, 0.01f)
uint8_t octaves
LIB8STATIC_ALWAYS_INLINE uint8_t qadd8(uint8_t i, uint8_t j)
Add one byte to another, saturating at 0xFF.
Definition math8.h:31
uint8_t inoise8(uint16_t x, uint16_t y, uint16_t z)
8-Bit, fixed point implementation of Perlin's noise.
Definition noise.cpp:590

References inoise8(), octaves, qadd8(), scale, and x.

Referenced by fill_noise16(), and fill_noise8().

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