Tc Unicode Helper
Toggle main menu visibility
Loading...
Searching...
No Matches
src
tcUnicodeU8G2.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 https://www.thecoderscorner.com (Dave Cherry).
3
* This product is licensed under an Apache license, see the LICENSE file in the top-level directory.
4
*/
5
11
12
#ifndef TCMENU_UNICODE_U8G2_H
13
#define TCMENU_UNICODE_U8G2_H
14
15
#include "
tcUnicodeHelper.h
"
16
#include <U8g2lib.h>
17
18
namespace
tcgfx {
19
20
#define UNICODE_U8G2_AVAILABLE
21
22
class
U8g2TextPlotPipeline :
public
TextPlotPipeline
{
23
private
:
24
U8G2 *u8g2;
25
Coord
cursor;
26
public
:
27
explicit
U8g2TextPlotPipeline(U8G2 *gfx) : u8g2(gfx) {}
28
29
~U8g2TextPlotPipeline() =
default
;
30
31
void
drawPixel
(uint16_t x, uint16_t y, uint32_t color)
override
{
32
u8g2->setColorIndex(color);
33
u8g2->drawPixel(x, y);
34
}
35
36
Coord
getDimensions
()
override
{
return
Coord
(u8g2->getWidth(), u8g2->getHeight()); }
37
38
void
setCursor
(
const
Coord
&where)
override
{ cursor = where; }
39
40
Coord
getCursor
()
override
{
return
cursor; }
41
};
42
49
inline
U8g2TextPlotPipeline
*
newU8G2TextPipeline
(U8G2 *graphics) {
50
return
new
U8g2TextPlotPipeline
(graphics);
51
}
52
}
53
#endif
//TCMENU_UNICODE_U8G2_H
TextPlotPipeline
Definition
tcUnicodeHelper.h:74
tcgfx::U8g2TextPlotPipeline
Definition
tcUnicodeU8G2.h:22
tcgfx::U8g2TextPlotPipeline::getCursor
Coord getCursor() override
Definition
tcUnicodeU8G2.h:40
tcgfx::U8g2TextPlotPipeline::getDimensions
Coord getDimensions() override
Definition
tcUnicodeU8G2.h:36
tcgfx::U8g2TextPlotPipeline::setCursor
void setCursor(const Coord &where) override
Definition
tcUnicodeU8G2.h:38
tcgfx::U8g2TextPlotPipeline::drawPixel
void drawPixel(uint16_t x, uint16_t y, uint32_t color) override
Definition
tcUnicodeU8G2.h:31
tcgfx::Coord
Definition
tcUnicodeHelper.h:40
tcUnicodeHelper.h
contains a Unicode handler that can process UTF-8 data and print it onto most display types.
tcgfx::newU8G2TextPipeline
U8g2TextPlotPipeline * newU8G2TextPipeline(U8G2 *graphics)
Definition
tcUnicodeU8G2.h:49