FastLED 3.10.6
Loading...
Searching...
No Matches
flux_scalar.h
Go to the documentation of this file.
1#pragma once
2
3// Brightness x power as one linear amplitude stage (P6 C4, #4040).
4//
5// The pipeline has exactly one place where amplitude changes. Brightness and
6// the power limiter both land here and compose multiplicatively; nothing
7// downstream rescales channels.
8
9#include "fl/stl/int.h"
10#include "fl/stl/noexcept.h"
11#include "fl/stl/span.h"
12
13namespace fl {
14
22 public:
25
29
31 static FluxScalar fromRawQ16(i32 raw) FL_NO_EXCEPT;
32
41
42 i32 rawQ16() const FL_NO_EXCEPT;
43
44 private:
45 explicit FluxScalar(i32 raw) FL_NO_EXCEPT;
47};
48
51
52} // namespace fl
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
static FluxScalar fromRawQ16(i32 raw) FL_NO_EXCEPT
A limiter fraction already in s16.16, clamped to [0, 1].
FluxScalar composedWith(FluxScalar other) const FL_NO_EXCEPT
Multiplicative composition, commutative: combining brightness and the limiter in either order gives t...
FluxScalar(i32 raw) FL_NO_EXCEPT
i32 rawQ16() const FL_NO_EXCEPT
static FluxScalar fromBrightness(u8 brightness) FL_NO_EXCEPT
setBrightness(b) as the linear flux scalar b/255.
static FluxScalar unity() FL_NO_EXCEPT
Identity. Drives pass through unchanged.
A linear flux scalar in s16.16.
Definition flux_scalar.h:21
unsigned char u8
Definition stdint.h:131
void applyFluxScalar(FluxScalar scalar, span< i32 > drives) FL_NO_EXCEPT
Scale every drive by one scalar, in place.
InputGamut g FL_NO_EXCEPT
Definition rgbw.h:121
Base definition for an LED controller.
Definition crgb.hpp:179