29 u32 elapsed = now - start;
30 u32 total =
end - start;
31 float out =
static_cast<float>(elapsed) /
static_cast<float>(total);
41 return static_cast<u16
>(
update8(now) << 8) + 0xFF;
44 return static_cast<float>(
update16(now)) / 65535.0f;
125 bool not_started = (
mEnd == 0) && (
mStart == 0);
142 bool not_started = (
mEnd == 0) && (
mStart == 0);
152 bool not_started = (
mEnd == 0) && (
mStart == 0);
virtual ~TimeAlpha() FL_NOEXCEPT=default
virtual float updatef(u32 now) FL_NOEXCEPT
virtual u16 update16(u32 now) FL_NOEXCEPT
virtual void trigger(u32 now) FL_NOEXCEPT=0
virtual u8 update8(u32 now) FL_NOEXCEPT=0
virtual bool isActive(u32 now) const FL_NOEXCEPT=0
void set_max_clamp(float max) FL_NOEXCEPT
u8 update8(u32 now) FL_NOEXCEPT override
void trigger(u32 now) FL_NOEXCEPT override
float updatef(u32 now) FL_NOEXCEPT override
TimeClampedTransition(u32 duration) FL_NOEXCEPT
bool isActive(u32 now) const FL_NOEXCEPT override
RampPhase getCurrentPhase(u32 now) const FL_NOEXCEPT
Get the current phase of the ramp.
TimeRamp(u32 risingTime, u32 latchMs, u32 fallingTime) FL_NOEXCEPT
u8 update8(u32 now) FL_NOEXCEPT override
Compute current 0–255 output based on how much time has elapsed since trigger().
bool isActive(u32 now) const FL_NOEXCEPT override
void trigger(u32 now) FL_NOEXCEPT override
Call this when you want to (re)start the ramp cycle.
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NOEXCEPT
float time_alphaf(u32 now, u32 start, u32 end) FL_NOEXCEPT
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
constexpr T * end(T(&array)[N]) FL_NOEXCEPT
u16 time_alpha16(u32 now, u32 start, u32 end) FL_NOEXCEPT
u8 time_alpha8(u32 now, u32 start, u32 end) FL_NOEXCEPT
Base definition for an LED controller.