Public Access
Enter on a picture shows it: shrunk to fit the screen, or at its own size with Enter again and the arrows to move. Dithered to the screen's 256 colours; a colour the screen has exactly is left alone, so screenshots are shown as they are. The picture is decoded once, straight into the screen's buffer, and kept there (App::retainsContent): no copy in memory. Decoding runs on the storage task, so the keys keep working and a 12 megapixel photograph appears as it comes instead of tripping the watchdog. PNG, BMP and GIF are read by decoders of our own, host-tested against files made by Pillow; the PNG one needs 32 KB where the display library's needed 44 KB in one block, which the device often doesn't have. JPEG uses the library's TJpgDec. Also corrects two sentences that still gave 16 KB as the editing limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
25 lines
793 B
C++
25 lines
793 B
C++
#pragma once
|
|
|
|
#include "app_manager.h"
|
|
#include "canvas.h"
|
|
#include "widgets.h"
|
|
|
|
namespace roro {
|
|
|
|
// Composes the frame (Status Bar, foreground App, Toast) off-screen and pushes it to the display.
|
|
class Screen {
|
|
public:
|
|
bool begin(); // allocates the frame buffer (~32 KB at 8-bit colour)
|
|
void render(AppManager& apps, const StatusInfo& status, const Toast* toast);
|
|
// Takes over the screen while a Firmware Update is received or about to restart.
|
|
void renderUpdate(const std::string& title, const std::string& detail, int percent);
|
|
Canvas& canvas() { return canvas_; }
|
|
|
|
private:
|
|
Canvas canvas_;
|
|
const App* lastApp_ = nullptr; // for an App that keeps what it drew (App::retainsContent)
|
|
bool lost_ = true, overlayWas_ = false;
|
|
};
|
|
|
|
} // namespace roro
|