15#define PI 3.1415926535897932384626433832795
18#define FL_SIN_F(x) fl::sinf(x)
19#define FL_COS_F(x) fl::cosf(x)
35 for (
int xx = 0; xx < num_x; xx++) {
36 for (
int yy = 0; yy < num_y; yy++) {
49 double runtime = current_time * timings.master_speed * speed_factor;
52 move.linear[i] = (runtime + timings.offset[i]) * timings.ratio[i];
61 fl::u32 current_time,
float speed_factor,
74 timings.
ratio[9] = 10;
94 (
x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
106 float newx = (animation.offset_x + animation.center_x -
107 (
FL_COS_F(animation.angle) * animation.dist)) *
109 float newy = (animation.offset_y + animation.center_y -
110 (
FL_SIN_F(animation.angle) * animation.dist)) *
112 float newz = (animation.offset_z + animation.z) * animation.scale_z;
115 float raw_noise_field_value =
pnoise(newx, newy, newz);
118 if (raw_noise_field_value < animation.low_limit)
119 raw_noise_field_value = animation.low_limit;
120 if (raw_noise_field_value > animation.high_limit)
121 raw_noise_field_value = animation.high_limit;
123 float scaled_noise_value =
124 map_float(raw_noise_field_value, animation.low_limit,
125 animation.high_limit, 0, 255);
127 return scaled_noise_value;
141 if (pixel.green > 255)
143 if (pixel.blue > 255)
157 return (1 - (1 - a / 255.f) * (1 - b / 255.f)) * 255.f;
163 return (1 - ((1 - a / 255.f) / (b / 255.f))) * 255.f;
FastLED chrono implementation - duration types for time measurements.
#define FL_OPTIMIZATION_LEVEL_O3_BEGIN
#define FASTLED_FORCE_INLINE
#define FL_FAST_MATH_BEGIN
#define FL_OPTIMIZATION_LEVEL_O3_END
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
float multiply(float &a, float &b) FL_NO_EXCEPT
u8 u8 fract8 blur_amount FL_NO_EXCEPT
float hypotf(float x, float y) FL_NO_EXCEPT
FASTLED_FORCE_INLINE float pnoise(float x, float y, float z) FL_NO_EXCEPT
void logFrame(unsigned long &c) FL_NO_EXCEPT
void get_ready(unsigned long &a, unsigned long &b) FL_NO_EXCEPT
float atan2f(float y, float x) FL_NO_EXCEPT
float colorburn(float &a, float &b) FL_NO_EXCEPT
fl::u32 micros() FL_NO_EXCEPT
Universal microsecond timer - returns microseconds since system startup.
FASTLED_FORCE_INLINE float map_float(float x, float in_min, float in_max, float out_min, float out_max) FL_NO_EXCEPT
void calculate_oscillators(oscillators &timings, modulators &move, fl::u32 current_time, float speed_factor) FL_NO_EXCEPT
FASTLED_FORCE_INLINE rgb rgb_sanity_check(rgb &pixel) FL_NO_EXCEPT
void run_default_oscillators(oscillators &timings, modulators &move, fl::u32 current_time, float speed_factor, float master_speed=0.005) FL_NO_EXCEPT
expected< T, E > result
Alias for expected (Rust-style naming)
void render_polar_lookup_table(float cx, float cy, fl::vector< fl::vector< float > > &polar_theta, fl::vector< fl::vector< float > > &distance, int num_x, int num_y) FL_NO_EXCEPT
float add(float &a, float &b) FL_NO_EXCEPT
float colordodge(float &a, float &b) FL_NO_EXCEPT
float fmodf(float x, float y) FL_NO_EXCEPT
FASTLED_FORCE_INLINE float render_value(render_parameters &animation) FL_NO_EXCEPT
float screen(float &a, float &b) FL_NO_EXCEPT
void logOutput(unsigned long &b) FL_NO_EXCEPT
float subtract(float &a, float &b) FL_NO_EXCEPT
Base definition for an LED controller.
float offset[num_oscillators]
float ratio[num_oscillators]