mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-12-15 15:59:39 -05:00
Prepare for display orientation part 1 (#2661)
This commit is contained in:
parent
6f6d863a14
commit
a1d7cf2b86
85 changed files with 405 additions and 334 deletions
|
|
@ -34,7 +34,7 @@ namespace lcd {
|
|||
|
||||
class ILI9341 {
|
||||
public:
|
||||
constexpr ILI9341()
|
||||
ILI9341()
|
||||
: scroll_state{0, 0, height(), 0} {
|
||||
}
|
||||
|
||||
|
|
@ -72,12 +72,23 @@ class ILI9341 {
|
|||
draw_pixels(r, colors.data(), colors.size());
|
||||
}
|
||||
|
||||
void draw_pixels(
|
||||
const ui::Rect r,
|
||||
const std::vector<ui::Color>& colors) {
|
||||
draw_pixels(r, colors.data(), colors.size());
|
||||
}
|
||||
|
||||
template <size_t N>
|
||||
void read_pixels(
|
||||
const ui::Rect r,
|
||||
std::array<ui::ColorRGB888, N>& colors) {
|
||||
read_pixels(r, colors.data(), colors.size());
|
||||
}
|
||||
void read_pixels(
|
||||
const ui::Rect r,
|
||||
std::vector<ui::ColorRGB888>& colors) {
|
||||
read_pixels(r, colors.data(), colors.size());
|
||||
}
|
||||
|
||||
void draw_bitmap(
|
||||
const ui::Point p,
|
||||
|
|
@ -138,9 +149,9 @@ class ILI9341 {
|
|||
*/
|
||||
ui::Coord scroll_area_y(const ui::Coord y) const;
|
||||
|
||||
constexpr ui::Dim width() const { return ui::screen_width; }
|
||||
constexpr ui::Dim height() const { return ui::screen_height; }
|
||||
constexpr ui::Rect screen_rect() const { return {0, 0, width(), height()}; }
|
||||
ui::Dim width() { return ui::screen_width; }
|
||||
ui::Dim height() { return ui::screen_height; }
|
||||
ui::Rect screen_rect() { return {0, 0, width(), height()}; }
|
||||
|
||||
void draw_pixels(const ui::Rect r, const ui::Color* const colors, const size_t count);
|
||||
void read_pixels(const ui::Rect r, ui::ColorRGB888* const colors, const size_t count);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue