Tc Unicode Helper
tcUnicodeAdaGFX.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 
12 #ifndef TCMENU_UNICODE_ADAGFX_H
13 #define TCMENU_UNICODE_ADAGFX_H
14 
15 #include "tcUnicodeHelper.h"
16 #include <Adafruit_GFX.h>
17 
18 namespace tcgfx {
20  private:
21  Adafruit_GFX *gfx;
22  public:
23  explicit AdafruitTextPlotPipeline(Adafruit_GFX *gfx) : gfx(gfx) {
24  }
25 
26  ~AdafruitTextPlotPipeline() = default;
27 
28  void drawPixel(uint16_t x, uint16_t y, uint32_t dc) override { return gfx->drawPixel(x, y, dc); }
29 
30  void setCursor(const Coord &where) override { gfx->setCursor(where.x, where.y); }
31 
32  Coord getCursor() override { return Coord(gfx->getCursorX(), gfx->getCursorY()); }
33 
34  Coord getDimensions() override { return Coord(gfx->width(), gfx->height()); }
35  };
36 
44  return new AdafruitTextPlotPipeline(gfx);
45  }
46 }
47 
48 #endif //TCMENU_UNICODE_ADAGFX_H
Definition: tcUnicodeHelper.h:74
Definition: tcUnicodeAdaGFX.h:19
void setCursor(const Coord &where) override
Definition: tcUnicodeAdaGFX.h:30
Coord getCursor() override
Definition: tcUnicodeAdaGFX.h:32
void drawPixel(uint16_t x, uint16_t y, uint32_t dc) override
Definition: tcUnicodeAdaGFX.h:28
Coord getDimensions() override
Definition: tcUnicodeAdaGFX.h:34
Definition: tcUnicodeHelper.h:40
AdafruitTextPlotPipeline * newAdafruitTextPipeline(Adafruit_GFX *gfx)
Definition: tcUnicodeAdaGFX.h:43
contains a Unicode handler that can process UTF-8 data and print it onto most display types.