FastLED 3.10.6
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 440 of file power_mgt.cpp.hpp.

440 {
442 static_cast<fl::size>(controller.size()));
443#if FL_COLOR_PIPELINE_SHARED
444 // Through the pipeline hook, which exists whenever a pipeline does; naming
445 // the estimator directly would link the colour pipeline into sketches that
446 // limit power but never bind a profile. `pipeline` is this estimate's own
447 // reference, so reconfiguring the controller mid-pass cannot free the
448 // pipeline it is walking (#4440).
449 const fl::shared_ptr<fl::StreamingPipelineQ16> pipeline = controller.colorPipeline();
451 if (pipeline && hooks.unscaledPowerMilliwatts != nullptr) {
452 // The callback charges already-solved physical emitter bytes. In
453 // particular, the RGBW legacy estimator must not convert them again.
454 const fl::u8 emitters = controller.getRgbww().active()
455 ? 5 : (controller.getRgbw().active() ? 4 : 3);
456 return hooks.unscaledPowerMilliwatts(
457 *pipeline, leds, emitters, &calculate_unscaled_emitter_power_mW);
458 }
459#endif
460 // Below the large-memory tier only this is compiled: a managed channel
461 // there is charged for its source (FL_COLOR_PIPELINE_SHARED).
463}
CRGB leds[1]
CLEDController * controller
fl::u32 calculate_unscaled_power_mW(fl::span< const CRGB > leds)
Determines how many milliwatts the current LED data would draw at max brightness (255)
fl::u32 calculate_unscaled_emitter_power_mW(fl::span< const fl::u8 > codes, fl::u8 emitter_count)
Charge already-solved physical output bytes in source emitter order: RGB, RGBW, or RGB + warm white +...
unsigned char u8
Definition stdint.h:131
ColorPipelineHooks & colorPipelineHooks() FL_NO_EXCEPT
The installed hooks.

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

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: