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

◆ render_value()

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

Definition at line 346 of file animartrix_detail.hpp.

346 {
347
348 // convert polar coordinates back to cartesian ones
349
350 float newx = (animation.offset_x + animation.center_x -
351 (cosf(animation.angle) * animation.dist)) *
352 animation.scale_x;
353 float newy = (animation.offset_y + animation.center_y -
354 (sinf(animation.angle) * animation.dist)) *
355 animation.scale_y;
356 float newz = (animation.offset_z + animation.z) * animation.scale_z;
357
358 // render noisevalue at this new cartesian point
359
360 float raw_noise_field_value = pnoise(newx, newy, newz);
361
362 // A) enhance histogram (improve contrast) by setting the black and
363 // white point (low & high_limit) B) scale the result to a 0-255 range
364 // (assuming you want 8 bit color depth per rgb chanel) Here happens the
365 // contrast boosting & the brightness mapping
366
367 if (raw_noise_field_value < animation.low_limit)
368 raw_noise_field_value = animation.low_limit;
369 if (raw_noise_field_value > animation.high_limit)
370 raw_noise_field_value = animation.high_limit;
371
372 float scaled_noise_value =
373 map_float(raw_noise_field_value, animation.low_limit,
374 animation.high_limit, 0, 255);
375
376 return scaled_noise_value;
377 }
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, 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: