Lamp-Da 0.1
A compact lantern project
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
lampda::modes::draw::overlay::Manager< UIElementSize, freezeSize, nbBlackLines > Class Template Reference

Public Member Functions

void display_update (auto &ctx)
 Display and update the overlay.
 
void clear ()
 Clear all UI elements.
 
uint8_t get_element_count (const ElementType type) const
 Return the count of elements of a target type.
 
bool add_ui_element (const auto &ctx, const ElementType type, const colors::PaletteTy &palette, const uint16_t coordinateX=0, const uint16_t coordinateY=0, const uint8_t progress=0, const uint32_t activityDelay_ms=50)
 Add a new UI element to the overlay.
 
template<bool shouldUpdateTimeout = true>
bool update_type_progress (const auto &ctx, const ElementType type, uint16_t desiredIndex, const uint8_t progress)
 Update the target UI element progress.
 
template<bool shouldUpdateTimeout = true>
bool update_type_color (const auto &ctx, const ElementType type, uint16_t desiredIndex, const colors::PaletteTy &palette)
 Update the target UI element color palette.
 
bool update_type_timeout (const auto &ctx, const ElementType type, uint16_t desiredIndex, const uint32_t timeout_ms)
 
template<bool shouldUpdateTimeout = true>
bool update_type (const auto &ctx, const ElementType type, uint16_t desiredIndex, const uint8_t progress, const colors::PaletteTy &palette)
 Update the target UI element.
 

Protected Member Functions

bool get_N_of_type (const ElementType type, uint16_t desiredIndex, size_t &elementId) const
 Find and return the Nth element of a given type.
 
void drawElement (const __private::UIElement &e, auto &ctx) const
 
void display_ramp (auto &ctx, const uint8_t progress, const colors::PaletteTy &palette, const uint16_t startCoordinateY) const
 Display a colored ramp.
 
void display_dot (auto &ctx, const uint8_t progress, const colors::PaletteTy &palette, const uint16_t coordinateX, const uint16_t coordinateY) const
 Display a single colored pixel.
 

Member Function Documentation

◆ add_ui_element()

template<int UIElementSize = 16, uint8_t freezeSize = 5, uint8_t nbBlackLines = 2>
bool lampda::modes::draw::overlay::Manager< UIElementSize, freezeSize, nbBlackLines >::add_ui_element ( const auto &  ctx,
const ElementType  type,
const colors::PaletteTy palette,
const uint16_t  coordinateX = 0,
const uint16_t  coordinateY = 0,
const uint8_t  progress = 0,
const uint32_t  activityDelay_ms = 50 
)
inline

Add a new UI element to the overlay.

Parameters
[in]typeType of the element. Depending on the type, some parameters may be ignored
[in]paletteColor palette to apply, controled by the progress parameter
[in]coordinateXStart x coordinate
[in]coordinateYStart y coordinate
[in]progressProgress of the element, controls the color and other aspects
[in]activityDelay_msLongevity delay affected to this element, after which it destroys itselfs
Returns
True if the element was successfully added

◆ update_type()

template<int UIElementSize = 16, uint8_t freezeSize = 5, uint8_t nbBlackLines = 2>
template<bool shouldUpdateTimeout = true>
bool lampda::modes::draw::overlay::Manager< UIElementSize, freezeSize, nbBlackLines >::update_type ( const auto &  ctx,
const ElementType  type,
uint16_t  desiredIndex,
const uint8_t  progress,
const colors::PaletteTy palette 
)
inline

Update the target UI element.

Parameters
[in]typeType of the element to update
[in]desiredIndexNth element of the target type to select
[in]progressProgress value to update
[in]paletteColors to update
Returns
True if the element was found and updated

◆ update_type_color()

template<int UIElementSize = 16, uint8_t freezeSize = 5, uint8_t nbBlackLines = 2>
template<bool shouldUpdateTimeout = true>
bool lampda::modes::draw::overlay::Manager< UIElementSize, freezeSize, nbBlackLines >::update_type_color ( const auto &  ctx,
const ElementType  type,
uint16_t  desiredIndex,
const colors::PaletteTy palette 
)
inline

Update the target UI element color palette.

Parameters
[in]typeType of the element to update
[in]desiredIndexNth element of the target type to select
[in]paletteColor value to update
Returns
True if the element was found and updated

◆ update_type_progress()

template<int UIElementSize = 16, uint8_t freezeSize = 5, uint8_t nbBlackLines = 2>
template<bool shouldUpdateTimeout = true>
bool lampda::modes::draw::overlay::Manager< UIElementSize, freezeSize, nbBlackLines >::update_type_progress ( const auto &  ctx,
const ElementType  type,
uint16_t  desiredIndex,
const uint8_t  progress 
)
inline

Update the target UI element progress.

Parameters
[in]typeType of the element to update
[in]desiredIndexNth element of the target type to select
[in]progressProgress value to update
Returns
True if the element was found and updated

The documentation for this class was generated from the following file: