FastLED 3.9.15
Loading...
Searching...
No Matches
noise.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/stl/stdint.h"
4
5#include "crgb.h"
6#include "chsv.h"
7#include "fl/gfx/hsv16.h"
8#include "fl/math/math.h"
9#include "fl/math/qfx.h"
10#include "fl/math/intmap.h"
11
14
20
21
25
28
29
32extern fl::u16 inoise16(fl::u32 x, fl::u32 y, fl::u32 z, fl::u32 t);
33
36extern fl::u16 inoise16(fl::u32 x, fl::u32 y, fl::u32 z);
37
40extern fl::u16 inoise16(fl::u32 x, fl::u32 y);
41
46extern fl::u16 inoise16(fl::u32 x);
47
49
50
53
56extern fl::i16 inoise16_raw(fl::u32 x, fl::u32 y, fl::u32 z);
57
58extern fl::i16 inoise16_raw(fl::u32 x, fl::u32 y, fl::u32 z, fl::u32 w);
59
62extern fl::i16 inoise16_raw(fl::u32 x, fl::u32 y);
63
69extern fl::i16 inoise16_raw(fl::u32 x);
70
72
73
76
79extern fl::u8 inoise8(fl::u16 x, fl::u16 y, fl::u16 z);
80
83extern fl::u8 inoise8(fl::u16 x, fl::u16 y);
84
89extern fl::u8 inoise8(fl::u16 x);
90
91
93
95
96
99
102extern fl::i8 inoise8_raw(fl::u16 x, fl::u16 y, fl::u16 z);
103
106extern fl::i8 inoise8_raw(fl::u16 x, fl::u16 y);
107
113extern fl::i8 inoise8_raw(fl::u16 x);
114
116
117
120
124fl::u16 snoise16(fl::u32 x);
125fl::u16 snoise16(fl::u32 x, fl::u32 y);
126fl::u16 snoise16(fl::u32 x, fl::u32 y, fl::u32 z);
127fl::u16 snoise16(fl::u32 x, fl::u32 y, fl::u32 z, fl::u32 w);
128
130
131
133
134#include "fl/gfx/noise/noise.h"
135
136
137
141
145
153void fill_raw_noise8(fl::u8 *pData, fl::u8 num_points, fl::u8 octaves, fl::u16 x, int scalex, fl::u16 time);
154
157void fill_raw_noise16into8(fl::u8 *pData, fl::u8 num_points, fl::u8 octaves, fl::u32 x, int scalex, fl::u32 time);
158
172void fill_raw_2dnoise8(fl::u8 *pData, int width, int height, fl::u8 octaves, fl::q44 freq44, fract8 amplitude, int skip, fl::u16 x, fl::i16 scalex, fl::u16 y, fl::i16 scaley, fl::u16 time);
173void fill_raw_2dnoise8(fl::u8 *pData, int width, int height, fl::u8 octaves, fl::u16 x, int scalex, fl::u16 y, int scaley, fl::u16 time);
174
175
186void fill_raw_2dnoise8(fl::u8 *pData, int width, int height, fl::u8 octaves, fl::u16 x, fl::i16 scalex, fl::u16 y, fl::i16 scaley, fl::u16 time);
187
190void fill_raw_2dnoise16into8(fl::u8 *pData, int width, int height, fl::u8 octaves, fl::u32 x, fl::i32 scalex, fl::u32 y, fl::i32 scaley, fl::u32 time);
191
197void fill_raw_2dnoise16(fl::u16 *pData, int width, int height, fl::u8 octaves, fl::q88 freq88, fract16 amplitude, int skip, fl::u32 x, fl::i32 scalex, fl::u32 y, fl::i32 scaley, fl::u32 time);
198
204void fill_raw_2dnoise16into8(fl::u8 *pData, int width, int height, fl::u8 octaves, fl::q44 freq44, fract8 amplitude, int skip, fl::u32 x, fl::i32 scalex, fl::u32 y, fl::i32 scaley, fl::u32 time);
205
207
208
214
225void fill_noise8(CRGB *leds, int num_leds,
226 fl::u8 octaves, fl::u16 x, int scale,
227 fl::u8 hue_octaves, fl::u16 hue_x, int hue_scale,
228 fl::u16 time);
229
233void fill_noise16(CRGB *leds, int num_leds,
234 fl::u8 octaves, fl::u16 x, int scale,
235 fl::u8 hue_octaves, fl::u16 hue_x, int hue_scale,
236 fl::u16 time, fl::u8 hue_shift=0);
237
259void fill_2dnoise8(CRGB *leds, int width, int height, bool serpentine,
260 fl::u8 octaves, fl::u16 x, int xscale, fl::u16 y, int yscale, fl::u16 time,
261 fl::u8 hue_octaves, fl::u16 hue_x, int hue_xscale, fl::u16 hue_y, fl::u16 hue_yscale,fl::u16 hue_time,bool blend);
262
266void fill_2dnoise16(CRGB *leds, int width, int height, bool serpentine,
267 fl::u8 octaves, fl::u32 x, int xscale, fl::u32 y, int yscale, fl::u32 time,
268 fl::u8 hue_octaves, fl::u16 hue_x, int hue_xscale, fl::u16 hue_y, fl::u16 hue_yscale,fl::u16 hue_time, bool blend, fl::u16 hue_shift=0);
269
271
fl::CRGB leds[NUM_LEDS]
int y
Definition simple.h:93
int x
Definition simple.h:92
uint32_t z[NUM_LAYERS]
Definition Fire2023.h:93
fl::UISlider scale("Scale", 4,.1, 4,.1)
uint8_t hue_octaves
int yscale
uint8_t octaves
int xscale
int hue_scale
uint32_t hue_time
Defines the hue, saturation, and value (HSV) pixel struct.
CRGB blend(const CRGB &p1, const CRGB &p2, fract8 amountOfP2)
Legacy header.
static uint32_t t
Definition Luminova.h:55
Functions to generate noise patterns on rings and spheres.
Integer mapping functions between different integer sizes.
qfx< u16, 8, 8 > q88
A 8.8 integer (8 bits integer, 8 bits fraction)
Definition qfx.h:49
qfx< u8, 4, 4 > q44
A 4.4 integer (4 bits integer, 4 bits fraction)
Definition qfx.h:45
fl::CRGB CRGB
Definition crgb.h:25
void fill_raw_2dnoise16into8(fl::u8 *pData, int width, int height, fl::u8 octaves, fl::u32 x, fl::i32 scalex, fl::u32 y, fl::i32 scaley, fl::u32 time)
Fill a 2D 8-bit buffer with noise, using inoise16()
void fill_2dnoise8(CRGB *leds, int width, int height, bool serpentine, fl::u8 octaves, fl::u16 x, int xscale, fl::u16 y, int yscale, fl::u16 time, fl::u8 hue_octaves, fl::u16 hue_x, int hue_xscale, fl::u16 hue_y, fl::u16 hue_yscale, fl::u16 hue_time, bool blend)
Fill an LED matrix with random colors, using 8-bit noise.
void fill_noise8(CRGB *leds, int num_leds, fl::u8 octaves, fl::u16 x, int scale, fl::u8 hue_octaves, fl::u16 hue_x, int hue_scale, fl::u16 time)
Fill an LED array with random colors, using 8-bit noise.
void fill_raw_2dnoise16(fl::u16 *pData, int width, int height, fl::u8 octaves, fl::q88 freq88, fract16 amplitude, int skip, fl::u32 x, fl::i32 scalex, fl::u32 y, fl::i32 scaley, fl::u32 time)
Fill a 2D 16-bit buffer with noise, using inoise16()
void fill_raw_noise8(fl::u8 *pData, fl::u8 num_points, fl::u8 octaves, fl::u16 x, int scalex, fl::u16 time)
Fill a 1D 8-bit buffer with noise, using inoise8()
void fill_noise16(CRGB *leds, int num_leds, fl::u8 octaves, fl::u16 x, int scale, fl::u8 hue_octaves, fl::u16 hue_x, int hue_scale, fl::u16 time, fl::u8 hue_shift=0)
Fill an LED array with random colors, using 16-bit noise.
void fill_raw_2dnoise8(fl::u8 *pData, int width, int height, fl::u8 octaves, fl::q44 freq44, fract8 amplitude, int skip, fl::u16 x, fl::i16 scalex, fl::u16 y, fl::i16 scaley, fl::u16 time)
Fill a 2D 8-bit buffer with noise, using inoise8()
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()
void fill_2dnoise16(CRGB *leds, int width, int height, bool serpentine, fl::u8 octaves, fl::u32 x, int xscale, fl::u32 y, int yscale, fl::u32 time, fl::u8 hue_octaves, fl::u16 hue_x, int hue_xscale, fl::u16 hue_y, fl::u16 hue_yscale, fl::u16 hue_time, bool blend, fl::u16 hue_shift=0)
Fill an LED matrix with random colors, using 16-bit noise.
fl::u16 snoise16(fl::u32 x)
32 bit, fixed point implementation of simplex noise functions.
fl::i8 inoise8_raw(fl::u16 x, fl::u16 y, fl::u16 z)
fl::u16 inoise16(fl::u32 x, fl::u32 y, fl::u32 z, fl::u32 t)
fl::i16 inoise16_raw(fl::u32 x, fl::u32 y, fl::u32 z)
fl::u8 inoise8(fl::u16 x, fl::u16 y, fl::u16 z)
u16 fract16
ANSI: unsigned _Fract.
Definition s16x16x4.h:171
u8 fract8
Fixed-Point Fractional Types.
Definition s16x16x4.h:161
unsigned char u8
Definition stdint.h:131
signed char i8
Definition stdint.h:130