Add third button: "scan to manage" QR overlay on the current photo
Pressing the manage button (GPIO1) overlays a small QR code -- "SCAN TO MANAGE" -- in the top-right corner of whatever photo is currently on screen, linking to the server's config page, then reverts to the plain photo after 30 seconds. The overlay is spliced into the existing streaming fetch as chunks pass through (frame_client.c's http_read_fn), rather than buffering the full 192,000-byte frame in RAM: only the small overlay rectangle itself (~30KB) is ever held in memory, generated via new stride-parameterized drawing helpers (epd_draw_*_ex in epd_draw.c) that let the existing QR/text drawing code target an arbitrarily-sized buffer instead of a full-frame one. epd7in3e.c is untouched -- it has no idea an overlay exists.
This commit is contained in:
@@ -18,6 +18,22 @@ void epd_draw_text(uint8_t *frame, const sFONT *font, const char *text, int orig
|
||||
/** Same as epd_draw_text(), but horizontally centered on center_x. */
|
||||
void epd_draw_text_centered(uint8_t *frame, const sFONT *font, const char *text, int center_x, int y);
|
||||
|
||||
/**
|
||||
* Same as epd_draw_pixel()/epd_draw_text()/epd_draw_text_centered(), but
|
||||
* against an arbitrarily-sized buffer instead of a full EPD_FRAME_BYTES
|
||||
* one -- stride is bytes per row (packed 2px/byte, so width/2), width and
|
||||
* height are that buffer's pixel dimensions, used for bounds-checking
|
||||
* instead of the panel's fixed EPD_WIDTH/EPD_HEIGHT. The non-_ex
|
||||
* functions above are thin wrappers around these, passing
|
||||
* EPD_BYTES_PER_ROW/EPD_WIDTH/EPD_HEIGHT -- existing callers are
|
||||
* unaffected.
|
||||
*/
|
||||
void epd_draw_pixel_ex(uint8_t *buf, int stride, int width, int height, int x, int y, epd_color_t color);
|
||||
void epd_draw_text_ex(uint8_t *buf, int stride, int width, int height, const sFONT *font, const char *text,
|
||||
int origin_x, int origin_y);
|
||||
void epd_draw_text_centered_ex(uint8_t *buf, int stride, int width, int height, const sFONT *font, const char *text,
|
||||
int center_x, int y);
|
||||
|
||||
/** Draws a line of the given thickness (in pixels) between two points. */
|
||||
void epd_draw_line(uint8_t *frame, int x0, int y0, int x1, int y1, int thickness);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user