29 #ifndef _NANO_ENGINE_TILER_H_
30 #define _NANO_ENGINE_TILER_H_
43 #define BUFFER_128x64_MONO NanoCanvas1, 128, 64, 7
44 #define TILE_8x8_RGB16 NanoCanvas16, 8, 8, 3
45 #define TILE_8x8_RGB8 NanoCanvas8, 8, 8, 3
46 #define TILE_8x8_MONO NanoCanvas1, 8, 8, 3
47 #define TILE_8x8_MONO_8 NanoCanvas1_8,8, 8, 3
49 #define ADATILE_8x8_MONO AdafruitCanvas1, 8, 8, 3
50 #define ADATILE_8x8_RGB8 AdafruitCanvas8, 8, 8, 3
51 #define ADATILE_8x8_RGB16 AdafruitCanvas16, 8, 8, 3
65 template<
class C, u
int8_t W, u
int8_t H, u
int8_t B>
111 if ((point.
y<0) || ((point.
y>>B)>=NE_MAX_TILES_NUM))
return;
119 static void refresh(lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
125 y2 =
min((y2>>B), NE_MAX_TILES_NUM - 1);
126 for (uint8_t y=y1; y<=y2; y++)
128 for(uint8_t x=x1>>B; x<=(x2>>B); x++)
180 static uint8_t m_buffer[W * H * C::BITS_PER_PIXEL / 8];
183 template<
class C, u
int8_t W, u
int8_t H, u
int8_t B>
186 template<
class C, u
int8_t W, u
int8_t H, u
int8_t B>
189 template<
class C, u
int8_t W, u
int8_t H, u
int8_t B>
192 template<
class C, u
int8_t W, u
int8_t H, u
int8_t B>
195 template<
class C, u
int8_t W, u
int8_t H, u
int8_t B>
205 uint16_t flag = m_refreshFlags[y >> NE_TILE_SIZE_BITS];
206 m_refreshFlags[y >> NE_TILE_SIZE_BITS] = 0;
211 canvas.setOffset(x, y);
212 if (m_onDraw()) canvas.blt();
219 template<
class C, u
int8_t W, u
int8_t H, u
int8_t B>
228 uint16_t flag = m_refreshFlags[y >> NE_TILE_SIZE_BITS];
229 m_refreshFlags[y >> NE_TILE_SIZE_BITS] = 0;
234 canvas.setOffset(x, y);
235 if (m_onDraw) m_onDraw();
237 canvas.fillRect(rect);
239 canvas.drawRect(rect);
240 canvas.printFixed( textPos.
x, textPos.
y, msg);
static const uint8_t NE_TILE_SIZE_BITS
static void refresh(const NanoPoint &point)
#define RGB_COLOR8(r, g, b)
SFixedFontInfo s_fixedFont
static bool collision(NanoPoint &p, NanoRect &rect)
Returns true if point is inside the rectangle area. Returns true if point is inside the rectangle are...
ssd1306_lcd_t ssd1306_lcd
static void refresh(const NanoRect &rect)
static void drawCallback(TNanoEngineOnDraw callback)
uint8_t width
width in pixels
static const uint8_t NE_TILE_HEIGHT
static void displayBuffer()
refreshes content on oled display. Refreshes content on oled display. Call it, if you want to update ...
bool collision(const NanoPoint &p) const
static void displayPopup(const char *msg)
prints popup message over display content prints popup message over display content ...
static TNanoEngineOnDraw m_onDraw
static void refresh(lcdint_t x1, lcdint_t y1, lcdint_t x2, lcdint_t y2)
bool(* TNanoEngineOnDraw)(void)
static const uint8_t NE_MAX_TILES_NUM
static uint16_t m_refreshFlags[NE_MAX_TILES_NUM]
static const uint8_t NE_TILE_WIDTH