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

◆ set_power_scaling_exponent()

void set_power_scaling_exponent ( float exponent)

Set a non-linear brightness-to-power response exponent.

Parameters
exponent1.0 = linear (default), values below 1.0 model higher-than-linear power draw at mid brightness, values above 1.0 model lower-than-linear draw
Note
Convenience wrapper: equivalent to setting model.exponent and calling set_power_model. Prefer set_power_model(PowerModelRGB{..., e}) to configure channel weights and response in one step.
This only affects power estimation and limiting, not rendered LED brightness.
exponent <= 0 or values within 1e-4 of 1.0 fall back to linear (identity tables) rather than rebuilding with a degenerate curve.
Only enabled on platforms where SKETCH_HAS_LARGE_MEMORY==1. Smaller-memory targets keep the legacy linear behavior and ignore this setting.

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

286 {
287 PowerModelRGB model = gPowerModel();
288 model.exponent = exponent;
289 set_power_model(model);
290}
void set_power_model(const PowerModelRGB &model)
Set custom RGB LED power consumption model.
static PowerModelRGB & gPowerModel()
Global RGB power model (initialized to WS2812 @ 5V defaults, linear response)
float exponent
Brightness-to-power response exponent (1.0 = linear)
Definition power_mgt.h:32
RGB LED power consumption model Used for standard 3-channel LEDs (WS2812, WS2812B,...
Definition power_mgt.h:27

References PowerModelRGB::exponent, gPowerModel(), and set_power_model().

Referenced by CFastLED::setPowerScalingExponent().

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