29 #ifndef _NANO_CANVAS_H_ 30 #define _NANO_CANVAS_H_ 38 CANVAS_MODE_TRANSPARENT = 2,
108 static_cast<lcdint_t>(y - p.
y) };
118 static_cast<lcdint_t>(y + p.
y) };
127 return {
static_cast<lcdint_t>(x >> bits),
128 static_cast<lcdint_t>(y >> bits) };
137 return {
static_cast<lcdint_t>(x << bits),
138 static_cast<lcdint_t>(y << bits) };
161 p1.
x += dx; p2.
x += dx;
162 p1.
y += dy; p2.
y += dy;
171 p1.
x += dx; p2.
x += dx;
233 return { {
static_cast<lcdint_t>(p1.
x - p.
x), static_cast<lcdint_t>(p1.
y - p.
y) },
234 {
static_cast<lcdint_t>(p2.
x - p.
x), static_cast<lcdint_t>(p2.
y - p.
y) } };
243 return { {
static_cast<lcdint_t>(p1.
x + p.
x), static_cast<lcdint_t>(p1.
y + p.
y) },
244 {
static_cast<lcdint_t>(p2.
x + p.
x), static_cast<lcdint_t>(p2.
y + p.
y) } };
277 static const uint8_t BITS_PER_PIXEL = 8;
327 while (w >> (m_p+1)) { m_p++; };
387 void drawRect(
const NanoRect &rect);
404 void fillRect(
const NanoRect &rect);
442 void write(uint8_t c);
448 void printChar(uint8_t c);
477 void setMode(uint8_t modeFlags) { m_textMode = modeFlags; };
529 static const uint8_t BITS_PER_PIXEL = 1;
577 while (w >> (m_p+1)) { m_p++; };
637 void drawRect(
const NanoRect &rect);
654 void fillRect(
const NanoRect &rect);
692 void write(uint8_t c);
698 void printChar(uint8_t c);
727 void setMode(uint8_t modeFlags) { m_textMode = modeFlags; };
776 static const uint8_t BITS_PER_PIXEL = 16;
826 while (w >> (m_p+1)) { m_p++; };
887 void drawRect(
const NanoRect &rect);
904 void fillRect(
const NanoRect &rect);
942 void write(uint8_t c);
948 void printChar(uint8_t c);
977 void setMode(uint8_t modeFlags) { m_textMode = modeFlags; };
983 void setColor(uint16_t color) { m_color = color; };
void setOffset(lcdint_t ox, lcdint_t oy)
_NanoPoint operator-(const _NanoPoint &p)
struct _NanoPoint NanoPoint
_NanoRect operator-(const _NanoPoint &p)
_NanoRect operator+(const _NanoPoint &p)
bool collisionY(lcdint_t y) const
void setPoint(lcdint_t px, lcdint_t py)
void begin(lcdint_t w, lcdint_t h, uint8_t *bytes)
NanoCanvas1(lcdint_t w, lcdint_t h, uint8_t *bytes)
NanoCanvas16(lcdint_t w, lcdint_t h, uint8_t *bytes)
void setColor(uint8_t color)
NanoCanvas8(lcdint_t w, lcdint_t h, uint8_t *bytes)
_NanoPoint operator+(const _NanoPoint &p)
void begin(lcdint_t w, lcdint_t h, uint8_t *bytes)
_NanoPoint operator>>(const uint8_t bits)
void setColor(uint16_t color)
_NanoPoint & operator<<=(const uint8_t bits)
void setMode(uint8_t modeFlags)
Sets canvas drawing mode Sets canvas drawing mode. The set flags define transparency of output images...
bool above(const NanoPoint &p) const
_NanoPoint & operator>>=(const uint8_t bits)
bool collision(const NanoPoint &p) const
_NanoPoint & operator+=(const _NanoPoint &p)
void setOffset(lcdint_t ox, lcdint_t oy)
void setMode(uint8_t modeFlags)
Sets canvas drawing mode Sets canvas drawing mode. The set flags define transparency of output images...
struct _NanoRect NanoRect
void setRect(lcdint_t l, lcdint_t t, lcdint_t r, lcdint_t b)
_NanoRect & operator+=(const _NanoPoint &p)
void begin(lcdint_t w, lcdint_t h, uint8_t *bytes)
_NanoPoint & operator-=(const _NanoPoint &p)
bool below(const NanoPoint &p) const
void setOffset(lcdint_t ox, lcdint_t oy)
bool collisionX(lcdint_t x) const
void move(lcdint_t dx, lcdint_t dy)
void setColor(uint8_t color)
void setMode(uint8_t modeFlags)
Sets canvas drawing mode Sets canvas drawing mode. The set flags define transparency of output images...
_NanoPoint operator<<(const uint8_t bits)