Doly C++ SDK v1.00
Loading...
Searching...
No Matches
EyeControl.h File Reference

Public API for Doly eye display control and animations. More...

#include <cstdint>
#include <string>
#include <string_view>
#include <Color.h>
#include <EyeEvent.h>
#include <VContent.h>

Go to the source code of this file.

Namespaces

namespace  EyeControl
namespace  EyeExpressions
 Named eye expression/animation identifiers.

Enumerations

enum class  EyeSide : uint8_t { BOTH , LEFT , RIGHT }
 Which eye(s) a command targets. More...
enum class  IrisShape : uint8_t {
  CLASSIC , MODERN , SPACE , ORBIT ,
  GLOW , DIGI
}
 Built-in iris style presets. More...

Functions

int8_t EyeControl::init (ColorCode eye_color, ColorCode bg_color)
 Initialize the eye subsystem (LCD + eye assets).
void EyeControl::Abort ()
 Abort/terminate the active animation.
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::setEyes (IrisShape shape, ColorCode iris_color, ColorCode bg_color)
 Set both iris and background to built-in presets.
int8_t EyeControl::setIris (IrisShape shape, ColorCode color, EyeSide side)
 Set iris preset for a given side.
int8_t EyeControl::setIris (VContent *eye_image, EyeSide side)
 Set iris image content for a given side.
int8_t EyeControl::setLid (VContent *lid_image, bool isTop, EyeSide side)
 Set eyelid image content for a given side.
int8_t EyeControl::setBackground (Color color)
 Set background color (solid).
int8_t EyeControl::setBackground (VContent *bg_image, EyeSide side)
 Set background image content for a given side.
int8_t EyeControl::setAnimation (uint16_t id, std::string_view name)
 Start a named eye animation (non-blocking).
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.
int8_t EyeControl::getIrisPosition (EyeSide side, int16_t &x, int16_t &y)
 Get the current iris center position for a given side.
float EyeControl::getVersion ()
 Get current library version.

Variables

constexpr std::string_view EyeExpressions::ADMIRING = "ADMIRING"
constexpr std::string_view EyeExpressions::AGGRAVATED = "AGGRAVATED"
constexpr std::string_view EyeExpressions::ANNOYED = "ANNOYED"
constexpr std::string_view EyeExpressions::ANXIOUS = "ANXIOUS"
constexpr std::string_view EyeExpressions::ATTENTION = "ATTENTION"
constexpr std::string_view EyeExpressions::ATTENTION_LEFT = "ATTENTION LEFT"
constexpr std::string_view EyeExpressions::ATTENTION_RIGHT = "ATTENTION RIGHT"
constexpr std::string_view EyeExpressions::AWAKE_L = "AWAKE L"
constexpr std::string_view EyeExpressions::AWAKE_R = "AWAKE R"
constexpr std::string_view EyeExpressions::BATTERY_LOW = "BATTERY LOW"
constexpr std::string_view EyeExpressions::BLINK = "BLINK"
constexpr std::string_view EyeExpressions::BLINK_BIG = "BLINK BIG"
constexpr std::string_view EyeExpressions::BLINK_L = "BLINK L"
constexpr std::string_view EyeExpressions::BLINK_ONLY = "BLINK ONLY"
constexpr std::string_view EyeExpressions::BLINK_R = "BLINK R"
constexpr std::string_view EyeExpressions::BLINK_SLOW = "BLINK SLOW"
constexpr std::string_view EyeExpressions::BLUE = "BLUE"
constexpr std::string_view EyeExpressions::BUGGED = "BUGGED"
constexpr std::string_view EyeExpressions::BUMP = "BUMP"
constexpr std::string_view EyeExpressions::BURNED_UP = "BURNED UP"
constexpr std::string_view EyeExpressions::CAUTIOUS = "CAUTIOUS"
constexpr std::string_view EyeExpressions::CAUTIOUS_DOWN = "CAUTIOUS DOWN"
constexpr std::string_view EyeExpressions::CAUTIOUS_DOWN_LEFT = "CAUTIOUS DOWN LEFT"
constexpr std::string_view EyeExpressions::CAUTIOUS_DOWN_RIGHT = "CAUTIOUS DOWN RIGHT"
constexpr std::string_view EyeExpressions::CAUTIOUS_LEFT = "CAUTIOUS LEFT"
constexpr std::string_view EyeExpressions::CAUTIOUS_RIGHT = "CAUTIOUS RIGHT"
constexpr std::string_view EyeExpressions::CAUTIOUS_UP = "CAUTIOUS UP"
constexpr std::string_view EyeExpressions::CHAOTIC = "CHAOTIC"
constexpr std::string_view EyeExpressions::CHEERFUL = "CHEERFUL"
constexpr std::string_view EyeExpressions::COLOR_CHANGE = "COLOR CHANGE"
constexpr std::string_view EyeExpressions::CONCENTRATE = "CONCENTRATE"
constexpr std::string_view EyeExpressions::CONFUSED = "CONFUSED"
constexpr std::string_view EyeExpressions::CRAZY_ABOUT = "CRAZY ABOUT"
constexpr std::string_view EyeExpressions::CRUSHED = "CRUSHED"
constexpr std::string_view EyeExpressions::CYCLOPS_L = "CYCLOPS L"
constexpr std::string_view EyeExpressions::CYCLOPS_R = "CYCLOPS R"
constexpr std::string_view EyeExpressions::DAMAGED = "DAMAGED"
constexpr std::string_view EyeExpressions::DEJECTED = "DEJECTED"
constexpr std::string_view EyeExpressions::DELIGHTED = "DELIGHTED"
constexpr std::string_view EyeExpressions::DEMORALIZED = "DEMORALIZED"
constexpr std::string_view EyeExpressions::DEPRESSED = "DEPRESSED"
constexpr std::string_view EyeExpressions::DESTROYED = "DESTROYED"
constexpr std::string_view EyeExpressions::DISCOVER = "DISCOVER"
constexpr std::string_view EyeExpressions::DISAPPOINTED = "DISAPPOINTED"
constexpr std::string_view EyeExpressions::DIZZY_L = "DIZZY L"
constexpr std::string_view EyeExpressions::DIZZY_R = "DIZZY R"
constexpr std::string_view EyeExpressions::DOWN = "DOWN"
constexpr std::string_view EyeExpressions::DROP_CENTER = "DROP CENTER"
constexpr std::string_view EyeExpressions::DROWSY = "DROWSY"
constexpr std::string_view EyeExpressions::ELEVATED_I = "ELEVATED I"
constexpr std::string_view EyeExpressions::ELEVATED_O = "ELEVATED O"
constexpr std::string_view EyeExpressions::EMPTY = "EMPTY"
constexpr std::string_view EyeExpressions::EXCITED = "EXCITED"
constexpr std::string_view EyeExpressions::FED_UP = "FED UP"
constexpr std::string_view EyeExpressions::FINE = "FINE"
constexpr std::string_view EyeExpressions::FIREMAN = "FIREMAN"
constexpr std::string_view EyeExpressions::FLAME = "FLAME"
constexpr std::string_view EyeExpressions::FOCUS = "FOCUS"
constexpr std::string_view EyeExpressions::FRIGHTENED = "FRIGHTENED"
constexpr std::string_view EyeExpressions::FRUSTRATED = "FRUSTRATED"
constexpr std::string_view EyeExpressions::FUMING_L = "FUMING L"
constexpr std::string_view EyeExpressions::FUMING_R = "FUMING R"
constexpr std::string_view EyeExpressions::FURIOUS = "FURIOUS"
constexpr std::string_view EyeExpressions::GET_BIGGER = "GET BIGGER"
constexpr std::string_view EyeExpressions::GET_SMALLER = "GET SMALLER"
constexpr std::string_view EyeExpressions::HAPPY = "HAPPY"
constexpr std::string_view EyeExpressions::HEARTS = "HEARTS"
constexpr std::string_view EyeExpressions::HEATED = "HEATED"
constexpr std::string_view EyeExpressions::HOPELESS = "HOPELESS"
constexpr std::string_view EyeExpressions::HOSTILE = "HOSTILE"
constexpr std::string_view EyeExpressions::IMPACT_F = "IMPACT F"
constexpr std::string_view EyeExpressions::IMPACT_L = "IMPACT L"
constexpr std::string_view EyeExpressions::IMPACT_R = "IMPACT R"
constexpr std::string_view EyeExpressions::IMPATIENT = "IMPATIENT"
constexpr std::string_view EyeExpressions::INJURED = "INJURED"
constexpr std::string_view EyeExpressions::IRRITATED = "IRRITATED"
constexpr std::string_view EyeExpressions::JEALOUS_L = "JEALOUS L"
constexpr std::string_view EyeExpressions::JEALOUS_R = "JEALOUS R"
constexpr std::string_view EyeExpressions::LEFT = "LEFT"
constexpr std::string_view EyeExpressions::LIDS_DOWN_5S = "LIDS DOWN 5S"
constexpr std::string_view EyeExpressions::LOOK_AHEAD = "LOOK AHEAD"
constexpr std::string_view EyeExpressions::LOOK_AHEAD_SLOW = "LOOK AHEAD SLOW"
constexpr std::string_view EyeExpressions::LOOK_DOWN = "LOOK DOWN"
constexpr std::string_view EyeExpressions::LOOK_DOWN_L = "LOOK DOWN L"
constexpr std::string_view EyeExpressions::LOOK_DOWN_R = "LOOK DOWN R"
constexpr std::string_view EyeExpressions::LOOK_LEFT = "LOOK LEFT"
constexpr std::string_view EyeExpressions::LOOK_RIGHT = "LOOK RIGHT"
constexpr std::string_view EyeExpressions::LOOK_UP = "LOOK UP"
constexpr std::string_view EyeExpressions::LOOK_UP_L = "LOOK UP L"
constexpr std::string_view EyeExpressions::LOOK_UP_R = "LOOK UP R"
constexpr std::string_view EyeExpressions::LOW = "LOW"
constexpr std::string_view EyeExpressions::LOW_LONG = "LOW LONG"
constexpr std::string_view EyeExpressions::MELANCHOLY = "MELANCHOLY"
constexpr std::string_view EyeExpressions::MID_DOWN = "MID DOWN"
constexpr std::string_view EyeExpressions::MID_UP = "MID UP"
constexpr std::string_view EyeExpressions::MID_UP_L = "MID UP L"
constexpr std::string_view EyeExpressions::MID_UP_R = "MID UP R"
constexpr std::string_view EyeExpressions::MIXED_UP = "MIXED UP"
constexpr std::string_view EyeExpressions::MOODY_LR = "MOODY LR"
constexpr std::string_view EyeExpressions::MOODY_RL = "MOODY RL"
constexpr std::string_view EyeExpressions::NERVOUS = "NERVOUS"
constexpr std::string_view EyeExpressions::OFFENDED = "OFFENDED"
constexpr std::string_view EyeExpressions::OUTRAGED = "OUTRAGED"
constexpr std::string_view EyeExpressions::OVERJOYED = "OVERJOYED"
constexpr std::string_view EyeExpressions::PANICKY = "PANICKY"
constexpr std::string_view EyeExpressions::PASSIONATE = "PASSIONATE"
constexpr std::string_view EyeExpressions::PHOTO = "PHOTO"
constexpr std::string_view EyeExpressions::POLICE = "POLICE"
constexpr std::string_view EyeExpressions::PUZZLED = "PUZZLED"
constexpr std::string_view EyeExpressions::PUMPKIN = "PUMPKIN"
constexpr std::string_view EyeExpressions::RIGHT = "RIGHT"
constexpr std::string_view EyeExpressions::ROLL_UD = "ROLL UD"
constexpr std::string_view EyeExpressions::SCAN = "SCAN"
constexpr std::string_view EyeExpressions::SHAKE_FRONT = "SHAKE FRONT"
constexpr std::string_view EyeExpressions::SHAKE_LR = "SHAKE LR"
constexpr std::string_view EyeExpressions::SHAKE_UD = "SHAKE UD"
constexpr std::string_view EyeExpressions::SHOCKED = "SHOCKED"
constexpr std::string_view EyeExpressions::SHY = "SHY"
constexpr std::string_view EyeExpressions::SLEEP = "SLEEP"
constexpr std::string_view EyeExpressions::SLEEPY = "SLEEPY"
constexpr std::string_view EyeExpressions::SNEEZE = "SNEEZE"
constexpr std::string_view EyeExpressions::SPARKLING = "SPARKLING"
constexpr std::string_view EyeExpressions::SQUINT_RL = "SQUINT RL"
constexpr std::string_view EyeExpressions::STORMING = "STORMING"
constexpr std::string_view EyeExpressions::SUNGLASS = "SUNGLASS"
constexpr std::string_view EyeExpressions::SUNGLASS_LR = "SUNGLASS LR"
constexpr std::string_view EyeExpressions::SUNGLASS_UPR = "SUNGLASS UPR"
constexpr std::string_view EyeExpressions::THINK = "THINK"
constexpr std::string_view EyeExpressions::THREATENED_L = "THREATENED L"
constexpr std::string_view EyeExpressions::THREATENED_R = "THREATENED R"
constexpr std::string_view EyeExpressions::THRILLED = "THRILLED"
constexpr std::string_view EyeExpressions::THROWN = "THROWN"
constexpr std::string_view EyeExpressions::TIRED = "TIRED"
constexpr std::string_view EyeExpressions::TROUBLED = "TROUBLED"
constexpr std::string_view EyeExpressions::TURNED_ON = "TURNED ON"
constexpr std::string_view EyeExpressions::UNCOMFORTABLE = "UNCOMFORTABLE"
constexpr std::string_view EyeExpressions::UNHAPPY = "UNHAPPY"
constexpr std::string_view EyeExpressions::UPSET = "UPSET"
constexpr std::string_view EyeExpressions::VR = "VR"
constexpr std::string_view EyeExpressions::WAKE_WORD = "WAKE WORD"
constexpr std::string_view EyeExpressions::WORKOUT = "WORKOUT"
constexpr std::string_view EyeExpressions::ZOOM_IN = "ZOOM IN"

Detailed Description

Public API for Doly eye display control and animations.

Design notes:

  • Singleton-style control (namespace API; no instances)
  • Functions require init() before use
  • Animation lifecycle is reported asynchronously through EyeEvent/EyeEventListener

Threading notes:

  • setAnimation() is non-blocking; animations run on an internal worker thread
  • Event callbacks are typically invoked from an internal worker/event thread

Enumeration Type Documentation

◆ EyeSide

enum class EyeSide : uint8_t
strong

Which eye(s) a command targets.

Enumerator
BOTH 

Apply to both eyes.

LEFT 

Apply to left eye.

RIGHT 

Apply to right eye.

◆ IrisShape

enum class IrisShape : uint8_t
strong

Built-in iris style presets.

Enumerator
CLASSIC 

Classic iris style.

MODERN 

Modern iris style.

SPACE 

Space-themed iris style.

ORBIT 

Orbit-themed iris style.

GLOW 

Glow iris style.

DIGI 

Digital iris style.