FastLED 3.10.8
Loading...
Searching...
No Matches

◆ fill_raw_noise16into8()

void fill_raw_noise16into8 ( fl::u8 * pData,
fl::u8 num_points,
fl::u8 octaves,
fl::u32 x,
int scalex,
fl::u32 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 726 of file noise.cpp.hpp.

726 {
727 fl::u32 _xx = x;
728 fl::u32 scx = scale;
729 for(int o = 0; o < octaves; ++o) {
730 for(int i = 0,xx=_xx; i < num_points; ++i, xx+=scx) {
731 fl::u32 accum = (inoise16(xx,time))>>o;
732 accum += (pData[i]<<8);
733 if(accum > 65535) { accum = 65535; }
734 pData[i] = accum>>8;
735 }
736
737 _xx <<= 1;
738 scx <<= 1;
739 }
740}
int x
Definition simple.h:92
fl::UISlider scale("Scale", 4,.1, 4,.1)
uint8_t octaves
fl::u16 inoise16(fl::u32 x, fl::u32 y, fl::u32 z, fl::u32 t) FL_NO_EXCEPT
16-bit, fixed point implementation of Perlin's noise.

References FL_NO_EXCEPT, 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: