|
FastLED 3.9.15
|
Unsigned 8-bit alpha / brightness — UNORM8.
Represents values in [0.0, 1.0] inclusive.
Interpretation: raw / 255 raw 0 = 0.0 raw 128 = 128/255 ~ 0.502 raw 255 = 255/255 = 1.0
FastLED's scale8() uses the (scale+1)>>8 approximation for efficient UNORM scaling: scale8(x, 255) == x (exact identity).
Implicit conversion to/from unsigned char preserves full backward compatibility with code that treats this as a plain u8.
#include <alpha.h>
Public Member Functions | |
| constexpr | alpha8 () FL_NOEXCEPT |
| constexpr | alpha8 (double f) FL_NOEXCEPT |
| constexpr | alpha8 (float f) FL_NOEXCEPT |
| template<typename IntT, alpha_detail::enable_if_integer_t< IntT > = 0> | |
| constexpr | alpha8 (IntT v) FL_NOEXCEPT |
| constexpr | operator unsigned char () const FL_NOEXCEPT |
| alpha8 & | operator*= (unsigned char rhs) FL_NOEXCEPT |
| alpha8 & | operator++ () FL_NOEXCEPT |
| alpha8 | operator++ (int) FL_NOEXCEPT |
| alpha8 & | operator+= (unsigned char rhs) FL_NOEXCEPT |
| alpha8 & | operator-- () FL_NOEXCEPT |
| alpha8 | operator-- (int) FL_NOEXCEPT |
| alpha8 & | operator-= (unsigned char rhs) FL_NOEXCEPT |
| alpha8 & | operator/= (unsigned char rhs) FL_NOEXCEPT |
| alpha8 & | operator<<= (int rhs) FL_NOEXCEPT |
| alpha8 & | operator>>= (int rhs) FL_NOEXCEPT |
| constexpr unsigned char | raw () const FL_NOEXCEPT |
| constexpr float | to_float () const FL_NOEXCEPT |
Static Public Member Functions | |
| static constexpr alpha8 | from_float (float f) FL_NOEXCEPT |
Public Attributes | |
| unsigned char | value |
Static Private Member Functions | |
| static constexpr unsigned char | _clamp (float f) FL_NOEXCEPT |