14#define PI 3.1415926535897932384626433832795
17#define FL_SIN_F(x) fl::sinf(x)
18#define FL_COS_F(x) fl::cosf(x)
30 int num_x,
int num_y) {
34 for (
int xx = 0; xx < num_x; xx++) {
35 for (
int yy = 0; yy < num_y; yy++) {
47 fl::u32 current_time,
float speed_factor) {
48 double runtime = current_time * timings.
master_speed * speed_factor;
60 fl::u32 current_time,
float speed_factor,
61 float master_speed = 0.005) {
73 timings.
ratio[9] = 10;
93 (
x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
114 float raw_noise_field_value =
pnoise(newx, newy, newz);
117 if (raw_noise_field_value < animation.
low_limit)
118 raw_noise_field_value = animation.
low_limit;
119 if (raw_noise_field_value > animation.
high_limit)
122 float scaled_noise_value =
126 return scaled_noise_value;
140 if (pixel.
green > 255)
142 if (pixel.
blue > 255)
149inline float subtract(
float &a,
float &b) {
return a - b; }
151inline float multiply(
float &a,
float &b) {
return a * b / 255.f; }
153inline float add(
float &a,
float &b) {
return a + b; }
156 return (1 - (1 - a / 255.f) * (1 - b / 255.f)) * 255.f;
159inline float colordodge(
float &a,
float &b) {
return (a / (255.f - b)) * 255.f; }
162 return (1 - ((1 - a / 255.f) / (b / 255.f))) * 255.f;
166inline void get_ready(
unsigned long &a,
unsigned long &b) {
FastLED chrono implementation - duration types for time measurements.
void get_ready(unsigned long &a, unsigned long &b)
constexpr remove_reference< T >::type && move(T &&t) FL_NOEXCEPT
FASTLED_FORCE_INLINE float render_value(render_parameters &animation)
float colorburn(float &a, float &b)
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)
void logOutput(unsigned long &b)
void calculate_oscillators(oscillators &timings, modulators &move, fl::u32 current_time, float speed_factor)
float screen(float &a, float &b)
FASTLED_FORCE_INLINE float map_float(float x, float in_min, float in_max, float out_min, float out_max)
float fmodf(float x, float y) FL_NOEXCEPT
void run_default_oscillators(oscillators &timings, modulators &move, fl::u32 current_time, float speed_factor, float master_speed=0.005)
expected< T, E > result
Alias for expected (Rust-style naming)
fl::u32 micros()
Universal microsecond timer - returns microseconds since system startup.
FASTLED_FORCE_INLINE rgb rgb_sanity_check(rgb &pixel)
float subtract(float &a, float &b)
void logFrame(unsigned long &c)
float add(float &a, float &b)
float hypotf(float x, float y) FL_NOEXCEPT
FASTLED_FORCE_INLINE float pnoise(float x, float y, float z)
float colordodge(float &a, float &b)
float atan2f(float y, float x) FL_NOEXCEPT
float multiply(float &a, float &b)
Base definition for an LED controller.
float offset[num_oscillators]
float ratio[num_oscillators]
#define FL_OPTIMIZATION_LEVEL_O3_BEGIN
#define FASTLED_FORCE_INLINE
#define FL_FAST_MATH_BEGIN
#define FL_OPTIMIZATION_LEVEL_O3_END