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

◆ render_value()

float animartrix_detail::ANIMartRIX::render_value ( render_parameters & animation)
inline

Definition at line 367 of file animartrix_detail.hpp.

367 {
368
369 // convert polar coordinates back to cartesian ones
370
371 float newx = (animation.offset_x + animation.center_x -
372 (FL_COS_F(animation.angle) * animation.dist)) *
373 animation.scale_x;
374 float newy = (animation.offset_y + animation.center_y -
375 (FL_SIN_F(animation.angle) * animation.dist)) *
376 animation.scale_y;
377 float newz = (animation.offset_z + animation.z) * animation.scale_z;
378
379 // render noisevalue at this new cartesian point
380
381 float raw_noise_field_value = pnoise(newx, newy, newz);
382
383 // A) enhance histogram (improve contrast) by setting the black and
384 // white point (low & high_limit) B) scale the result to a 0-255 range
385 // (assuming you want 8 bit color depth per rgb chanel) Here happens the
386 // contrast boosting & the brightness mapping
387
388 if (raw_noise_field_value < animation.low_limit)
389 raw_noise_field_value = animation.low_limit;
390 if (raw_noise_field_value > animation.high_limit)
391 raw_noise_field_value = animation.high_limit;
392
393 float scaled_noise_value =
394 map_float(raw_noise_field_value, animation.low_limit,
395 animation.high_limit, 0, 255);
396
397 return scaled_noise_value;
398 }
#define FL_SIN_F(x)
#define FL_COS_F(x)
float map_float(float x, float in_min, float in_max, float out_min, float out_max)
float pnoise(float x, float y, float z)

References animation, FL_COS_F, FL_SIN_F, map_float(), and pnoise().

Referenced by Big_Caleido(), Caleido1(), Caleido2(), Caleido3(), Center_Field(), Chasing_Spirals(), Complex_Kaleido(), Complex_Kaleido_2(), Complex_Kaleido_3(), Complex_Kaleido_4(), Complex_Kaleido_5(), Complex_Kaleido_6(), Distance_Experiment(), Hot_Blob(), Lava1(), Module_Experiment1(), Module_Experiment10(), Module_Experiment2(), Module_Experiment3(), Module_Experiment4(), Module_Experiment5(), Module_Experiment6(), Module_Experiment7(), Module_Experiment8(), Module_Experiment9(), Parametric_Water(), Polar_Waves(), RGB_Blobs(), RGB_Blobs2(), RGB_Blobs3(), RGB_Blobs4(), RGB_Blobs5(), Rings(), Rotating_Blob(), Scaledemo1(), Slow_Fade(), SM1(), SM10(), SM2(), SM3(), SM4(), SM5(), SM6(), SM8(), SM9(), Spiralus(), Spiralus2(), Water(), Waves(), Yves(), Zoom(), and Zoom2().

+ Here is the call graph for this function: