![]() |
Doly C++ SDK v1.00
|
Functions | |
| int8_t | init (ColorCode eye_color, ColorCode bg_color) |
| Initialize the eye subsystem (LCD + eye assets). | |
| void | Abort () |
| Abort/terminate the active animation. | |
| bool | isActive () |
| Check whether the subsystem is active (initialized and running). | |
| bool | isAnimating () |
| Check whether an animation is currently running. | |
| int8_t | setEyes (IrisShape shape, ColorCode iris_color, ColorCode bg_color) |
| Set both iris and background to built-in presets. | |
| int8_t | setIris (IrisShape shape, ColorCode color, EyeSide side) |
| Set iris preset for a given side. | |
| int8_t | setIris (VContent *eye_image, EyeSide side) |
| Set iris image content for a given side. | |
| int8_t | setLid (VContent *lid_image, bool isTop, EyeSide side) |
| Set eyelid image content for a given side. | |
| int8_t | setBackground (Color color) |
| Set background color (solid). | |
| int8_t | setBackground (VContent *bg_image, EyeSide side) |
| Set background image content for a given side. | |
| int8_t | setAnimation (uint16_t id, std::string_view name) |
| Start a named eye animation (non-blocking). | |
| int8_t | setPosition (EyeSide side, int16_t centerX, int16_t centerY, float scaleX=1, float scaleY=1, uint8_t lid_top_end=0, uint8_t lid_bot_start=240) |
| Set iris position/scale and eyelid limits for a given side. | |
| int8_t | getIrisPosition (EyeSide side, int16_t &x, int16_t &y) |
| Get the current iris center position for a given side. | |
| float | getVersion () |
| Get current library version. | |
| void EyeControl::Abort | ( | ) |
Abort/terminate the active animation.
This is intended as a stop/emergency action for ongoing animations.
| int8_t EyeControl::getIrisPosition | ( | EyeSide | side, |
| int16_t & | x, | ||
| int16_t & | y ) |
Get the current iris center position for a given side.
| side | Target eye side (LEFT or RIGHT). |
| x | Output X coordinate. |
| y | Output Y coordinate. |
| float EyeControl::getVersion | ( | ) |
Get current library version.
Original note: format 0.XYZ (3 digits after major).
Initialize the eye subsystem (LCD + eye assets).
This must be called once before other control functions.
| eye_color | Default iris color (see Color.h). |
| bg_color | Default background color (see Color.h). |
| bool EyeControl::isActive | ( | ) |
Check whether the subsystem is active (initialized and running).
| bool EyeControl::isAnimating | ( | ) |
Check whether an animation is currently running.
| int8_t EyeControl::setAnimation | ( | uint16_t | id, |
| std::string_view | name ) |
Start a named eye animation (non-blocking).
The animation runs on an internal worker thread. Start/complete/abort are reported via EyeEvent/EyeEventListener.
| id | User-defined id forwarded to event callbacks. |
| name | Animation name (see EyeExpressions). |
| int8_t EyeControl::setBackground | ( | Color | color | ) |
Set background color (solid).
| color | Background color (RGB). |
Set background image content for a given side.
| bg_image | Background image content. |
| side | Target eye side. |
Set both iris and background to built-in presets.
| shape | Built-in iris shape preset. |
| iris_color | Iris color. |
| bg_color | Background color. |
Set iris preset for a given side.
| shape | Iris preset to apply. |
| color | Iris color. |
| side | Target eye side. |
Set iris image content for a given side.
| eye_image | Iris image content. |
| side | Target eye side. |
Set eyelid image content for a given side.
| lid_image | Lid image content. |
| isTop | True for top lid, false for bottom lid. |
| side | Target eye side. |
| int8_t EyeControl::setPosition | ( | EyeSide | side, |
| int16_t | centerX, | ||
| int16_t | centerY, | ||
| float | scaleX = 1, | ||
| float | scaleY = 1, | ||
| uint8_t | lid_top_end = 0, | ||
| uint8_t | lid_bot_start = 240 ) |
Set iris position/scale and eyelid limits for a given side.
| side | Eye side. |
| centerX | Iris center X location (-250..0..250). |
| centerY | Iris center Y location (-250..0..250). |
| scaleX | Scale factor for iris image (default 1). |
| scaleY | Scale factor for iris image (default 1). |
| lid_top_end | Top eyelid Y end position. |
| lid_bot_start | Bottom eyelid Y start position. |