FastLED 3.10.8
Loading...
Searching...
No Matches

◆ scale_power_for_brightness()

fl::u32 scale_power_for_brightness ( fl::u32 total_mW,
fl::u8 brightness )

Applies the configured power-scaling response to a total power value.

Pass the scalable share only. calculate_unscaled_power_mW() includes the per-LED dark_mW baseline, which brightness does not reduce; scaling that with the emitters under-reports demand at low brightness (#4156 R4).

Parameters
total_mWunscaled total power at full brightness
brightnessrequested brightness in FastLED's 0-255 brightness space
Returns
estimated power after applying the configured brightness-to-power response

Definition at line 216 of file power_mgt.cpp.hpp.

216 {
217 return fl::scale32by8(total_mW, map_power_value(brightness));
218}
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
static fl::u8 map_power_value(fl::u8 brightness) FL_NO_EXCEPT

References brightness, FL_NO_EXCEPT, and map_power_value().

Referenced by brightness_within_budget(), calculate_max_brightness_for_power_mW(), and CFastLED::getEstimatedPowerInMilliWatts().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: