|
Lamp-Da 0.1
A compact lantern project
|
Utility function and classes. More...
Namespaces | |
| namespace | ColorSpace |
| Define commonly used color spaces. | |
| namespace | curves |
| Curves classes to sample values from predefined custom parameters. | |
| namespace | ELK |
| decode ELK control messages | |
Classes | |
| struct | RotationMatrix |
| Represent an XYZ rotation matrix. More... | |
| class | StateMachine |
| Define a state machine. More... | |
| struct | TransformationMatrix |
| Transform a vector from a space to another. More... | |
| struct | vec2d |
| 2d vector in any space More... | |
| struct | vec3d |
| 3d vector in any space More... | |
| struct | vec4d |
| 4d vector in any space More... | |
Functions | |
| static uint32_t | Color (uint8_t r, uint8_t g, uint8_t b) |
| Convert separate red, green and blue values into a single "packed" 32-bit RGB color. | |
| static uint32_t | Color (uint8_t r, uint8_t g, uint8_t b, uint8_t w) |
| Convert separate red, green, blue and white values into a single "packed" 32-bit WRGB color. | |
| uint32_t | get_random_complementary_color (const uint32_t color, const float tolerance) |
| Compute the complementary color of the given color, with a random variation. | |
| uint32_t | get_gradient (const uint32_t colorStart, const uint32_t colorEnd, const float level) |
| Return the color gradient between colorStart to colorEnd. | |
| COLOR | color_fade (COLOR c1, uint8_t amount, bool video) |
| COLOR | color_add (COLOR c1, COLOR c2, bool fast) |
| uint32_t | hue_to_rgb_sinus (const uint16_t angle) |
| template<typename T > | |
| static constexpr uint32_t | hash (const T s, const uint16_t maxSize=14, const uint16_t off=0) |
| Hash input string into a 32-bit unsigned integer. | |
| constexpr double | analogReadToVoltage (const uint16_t analogVal) |
| constexpr uint16_t | voltageToAnalogRead (const float voltage) |
Utility function and classes.
|
static |
Convert separate red, green and blue values into a single "packed" 32-bit RGB color.
| r | Red brightness, 0 to 255. |
| g | Green brightness, 0 to 255. |
| b | Blue brightness, 0 to 255. |
|
static |
Convert separate red, green, blue and white values into a single "packed" 32-bit WRGB color.
| r | Red brightness, 0 to 255. |
| g | Green brightness, 0 to 255. |
| b | Blue brightness, 0 to 255. |
| w | White brightness, 0 to 255. |
| uint32_t lampda::utils::get_gradient | ( | const uint32_t | colorStart, |
| const uint32_t | colorEnd, | ||
| const float | level | ||
| ) |
Return the color gradient between colorStart to colorEnd.
| [in] | colorStart | Start color of the gradient |
| [in] | colorEnd | End color of the gradient |
| [in] | level | between 0 and 1, the gradient between the two colors |
| uint32_t lampda::utils::get_random_complementary_color | ( | const uint32_t | color, |
| const float | tolerance | ||
| ) |
Compute the complementary color of the given color, with a random variation.
| [in] | color | The color to find a complement for |
| [in] | tolerance | between 0 and 1, the variation tolerance. 1 will give a totally random color, 0 will return the base complementary color |
|
staticconstexpr |
Hash input string into a 32-bit unsigned integer.
This is the xor-variant of the "djb2 hash" in its iterative form, starting from the beginning of the string for simplicity.
| [in] | s | Zero-terminated input string |
| [in] | maxSize | (optional) Maximal byte count to process, defaults to 14 |
| [in] | off | (optional) Skip the first off bytes, defaults to 0 |