m5stack-avatar
Loading...
Searching...
No Matches
Mouths.hpp
Go to the documentation of this file.
1
11
#ifndef M5AVATAR_MOUTHS_HPP_
12
#define M5AVATAR_MOUTHS_HPP_
13
14
#include <BoundingRect.h>
15
#include <DrawContext.h>
16
#include <Drawable.h>
17
#include <Face.h>
18
19
#include "
DrawingUtils.hpp
"
20
21
namespace
m5avatar {
22
23
class
BaseMouth
:
public
Drawable
{
24
protected
:
25
uint16_t min_width_;
26
uint16_t max_width_;
27
uint16_t min_height_;
28
uint16_t max_height_;
29
30
// caches for drawing
31
ColorPalette
*palette_;
32
int16_t center_x_;
33
int16_t center_y_;
34
uint16_t background_color_;
// mouth background
35
uint16_t skin_color_;
36
float
open_ratio_;
37
float
breath_;
38
Expression expression_;
39
40
public
:
41
BaseMouth
();
42
BaseMouth
(uint16_t min_width, uint16_t max_width, uint16_t min_height,
43
uint16_t max_height);
44
45
void
update(M5Canvas *canvas,
BoundingRect
rect,
DrawContext
*ctx);
46
};
47
48
class
RectMouth
:
public
BaseMouth
{
49
public
:
50
using
BaseMouth::BaseMouth;
51
void
draw(M5Canvas *canvas,
BoundingRect
rect,
DrawContext
*ctx);
52
};
53
54
class
OmegaMouth
:
public
BaseMouth
{
55
public
:
56
using
BaseMouth::BaseMouth;
57
void
draw(M5Canvas *canvas,
BoundingRect
rect,
DrawContext
*ctx);
58
};
59
60
class
ToonMouth1
:
public
BaseMouth
{
61
public
:
62
using
BaseMouth::BaseMouth;
63
void
draw(M5Canvas *canvas,
BoundingRect
rect,
DrawContext
*ctx);
64
};
65
66
class
DoggyMouth
:
public
BaseMouth
{
67
public
:
68
using
BaseMouth::BaseMouth;
69
void
draw(M5Canvas *canvas,
BoundingRect
rect,
DrawContext
*ctx);
70
};
71
72
}
// namespace m5avatar
73
74
#endif
DrawingUtils.hpp
drawing utils including geometry handling
m5avatar::BaseMouth
Definition:
Mouths.hpp:23
m5avatar::BoundingRect
Definition:
BoundingRect.h:10
m5avatar::ColorPalette
Definition:
ColorPalette.h:50
m5avatar::DoggyMouth
Definition:
Mouths.hpp:66
m5avatar::DrawContext
Definition:
DrawContext.h:22
m5avatar::Drawable
Definition:
Drawable.h:13
m5avatar::OmegaMouth
Definition:
Mouths.hpp:54
m5avatar::RectMouth
Definition:
Mouths.hpp:48
m5avatar::ToonMouth1
Definition:
Mouths.hpp:60
src
Mouths.hpp
Generated by
1.9.5