Prepare for display orientation part 1 (#2661)

This commit is contained in:
Totoo 2025-05-22 17:24:53 +02:00 committed by GitHub
parent 6f6d863a14
commit a1d7cf2b86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
85 changed files with 405 additions and 334 deletions

View file

@ -182,7 +182,7 @@ static void cmd_screenshot(BaseSequentialStream* chp, int argc, char* argv[]) {
return;
for (int i = 0; i < ui::screen_height; i++) {
std::array<ui::ColorRGB888, ui::screen_width> row;
std::vector<ui::ColorRGB888> row(ui::screen_width);
portapack::display.read_pixels({0, i, ui::screen_width, 1}, row);
png.write_scanline(row);
}
@ -199,7 +199,7 @@ static void cmd_screenframe(BaseSequentialStream* chp, int argc, char* argv[]) {
evtd->enter_shell_working_mode();
for (int i = 0; i < ui::screen_height; i++) {
std::array<ui::ColorRGB888, ui::screen_width> row;
std::vector<ui::ColorRGB888> row(ui::screen_width);
portapack::display.read_pixels({0, i, ui::screen_width, 1}, row);
for (int px = 0; px < ui::screen_width; px += 5) {
char buffer[5 * 3 * 2 + 1];
@ -242,9 +242,9 @@ static void cmd_screenframeshort(BaseSequentialStream* chp, int argc, char* argv
char buffer[USBSERIAL_BUFFERS_SIZE];
size_t wp = 0;
for (int y = 0; y < ui::screen_height; y++) {
std::array<ui::ColorRGB888, ui::screen_width> row;
std::vector<ui::ColorRGB888> row(ui::screen_width);
portapack::display.read_pixels({0, y, ui::screen_width, 1}, row);
for (int i = 0; i < 240; ++i) {
for (int i = 0; i < ui::screen_width; ++i) {
screenbuffer_helper_add(chp, buffer, wp, getChrFromRgb(row[i].r, row[i].g, row[i].b));
}
screenbuffer_helper_add(chp, buffer, wp, '\r');