FastLED 3.10.10
Loading...
Searching...
No Matches

◆ controller_unscaled_power_mW()

fl::u32 controller_unscaled_power_mW ( const fl::CLEDController & controller)

One controller's demand at full brightness, in mW, including idle draw – the quantity the limiter sums and scales.

A controller whose output runs through a colour pipeline is charged for the drives the pipeline solves, not for its source pixels: the two differ in either direction, by up to 4.45x on dim emitters (#4344, #4156 R3). Any other controller is charged through its RGBW conversion, as before.

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

522 {
524 static_cast<fl::size>(controller.size()));
525#if FL_COLOR_PIPELINE_SHARED
526 // Through the pipeline hook, which exists whenever a pipeline does; naming
527 // the estimator directly would link the colour pipeline into sketches that
528 // limit power but never bind a profile. `pipeline` is this estimate's own
529 // reference, so reconfiguring the controller mid-pass cannot free the
530 // pipeline it is walking (#4440).
531 const fl::shared_ptr<fl::StreamingPipelineQ16> pipeline = fl::channelColorPipeline(controller);
533 if (pipeline && hooks.unscaledPowerMilliwatts != nullptr) {
534 // The callback charges already-solved physical emitter bytes. In
535 // particular, the RGBW legacy estimator must not convert them again.
536 const fl::u8 emitters = controller.getRgbww().active()
537 ? 5 : (controller.getRgbw().active() ? 4 : 3);
538 return hooks.unscaledPowerMilliwatts(
539 *pipeline, leds, emitters, &calculate_unscaled_emitter_power_mW);
540 }
541#endif
542 // Below the large-memory tier only this is compiled: a managed channel
543 // there is charged for its source (FL_COLOR_PIPELINE_SHARED).
544 // No stored Rgbw reads as RgbwInvalid, which the overload answers with the
545 // RGB estimate; asking for it directly skips copying the Rgbw value.
546 const fl::Rgbw* rgbw = controller.rgbwConfig();
549}
CRGB leds[1]
CLEDController * controller
Rgbw rgbw
fl::u32 calculate_unscaled_power_mW(fl::span< const CRGB > leds) FL_NO_EXCEPT
fl::u32 calculate_unscaled_emitter_power_mW(fl::span< const fl::u8 > codes, fl::u8 emitter_count) FL_NO_EXCEPT
Charge already-solved physical output bytes in source emitter order: RGB, RGBW, or RGB + warm white +...
unsigned char u8
Definition stdint.h:132
ColorPipelineHooks & colorPipelineHooks() FL_NO_EXCEPT
The installed hooks.
static rgbw_power_fn gRgbwPowerEstimate

References calculate_unscaled_emitter_power_mW(), calculate_unscaled_power_mW(), fl::colorPipelineHooks(), controller, FL_NO_EXCEPT, gRgbwPowerEstimate, leds, and rgbw.

Referenced by 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: