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

◆ set_power_model() [1/3]

void set_power_model ( const PowerModelRGB & model)

Set custom RGB LED power consumption model.

Parameters
modelRGB power consumption model. The model's exponent field drives the brightness-to-power response curve used by estimation and limiting; pass PowerModelRGB(r, g, b, d, e) to set channel weights + response curve in a single call.
Note
exponent <= 0 or values within 1e-4 of 1.0 fall back to linear (identity tables) rather than rebuilding with a degenerate curve.

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

275 {
276 gPowerModel() = model;
277#if SKETCH_HAS_LARGE_MEMORY
278 rebuild_power_scaling_tables(model.exponent);
279#else
280 // Small-memory targets ignore non-linear exponent and keep linear behavior;
281 // clamp the stored field so get_power_scaling_exponent() reports the truth.
283#endif
284}
static constexpr float kLinearPowerScalingExponent
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

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

Referenced by set_power_model(), set_power_model(), set_power_scaling_exponent(), CFastLED::setPowerModel(), CFastLED::setPowerModel(), and CFastLED::setPowerModel().

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