-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTftFrameSink.cpp
More file actions
28 lines (23 loc) · 872 Bytes
/
TftFrameSink.cpp
File metadata and controls
28 lines (23 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "ui/TftFrameSink.h"
#include "Display.h"
namespace ui
{
void TftFrameSink::drawRgb565Row(uint16_t x, uint16_t y, uint16_t width, const uint16_t *pixels)
{
const bool previousSwap = display::tft.getSwapBytes();
display::tft.setSwapBytes(true);
display::tft.pushImage(x, y, width, 1, const_cast<uint16_t *>(pixels));
display::tft.setSwapBytes(previousSwap);
}
void TftFrameSink::drawRgb565Block(uint16_t x,
uint16_t y,
uint16_t width,
uint16_t height,
const uint16_t *pixels)
{
const bool previousSwap = display::tft.getSwapBytes();
display::tft.setSwapBytes(true);
display::tft.pushImage(x, y, width, height, const_cast<uint16_t *>(pixels));
display::tft.setSwapBytes(previousSwap);
}
} // namespace ui