FastLED 3.10.8
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 999 of file power_mgt.cpp.hpp.

999 {
1000 PowerModelRGB model = gPowerModel();
1001 model.exponent = exponent;
1002 // Not `set_power_model`: the exponent is a property of the response
1003 // curve, and changing it is not a statement about how many emitters the
1004 // strip has.
1005 apply_rgb_power_model(model);
1006}
static PowerModelRGB & gPowerModel() FL_NO_EXCEPT
Global RGB power model (initialized to WS2812 @ 5V defaults, linear response)
static void apply_rgb_power_model(const PowerModelRGB &model) FL_NO_EXCEPT
float exponent
Brightness-to-power response exponent (1.0 = linear)
Definition power_mgt.h:35
RGB LED power consumption model Used for standard 3-channel LEDs (WS2812, WS2812B,...
Definition power_mgt.h:30

References apply_rgb_power_model(), PowerModelRGB::exponent, FL_NO_EXCEPT, and gPowerModel().

Referenced by CFastLED::setPowerScalingExponent().

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