feat: xorg text overlays, font atlas generator, v4l2_view_cli
- tools/gen_font_atlas: Python/Pillow build tool — skyline packs DejaVu Sans glyphs 32-255 into a grayscale atlas, emits build/gen/font_atlas.h with pixel data and Font_Glyph[256] metrics table - xorg: bitmap font atlas text overlay rendering (GL_R8 atlas texture, alpha-blended glyph quads, dark background rect per overlay) - xorg: add xorg_viewer_set_overlay_text / clear_overlays API - xorg: add xorg_viewer_handle_events for streaming use (events only, no redundant render) - xorg_cli: show today's date as white text overlay - v4l2_view_cli: new tool — V4L2 capture with format auto-selection (highest FPS then largest resolution), MJPEG/YUYV, measured FPS overlay - docs: update README, planning, architecture to reflect current status Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "test_image.h"
|
||||
#include "xorg.h"
|
||||
@@ -100,14 +101,24 @@ int main(int argc, char **argv)
|
||||
width, height, fmt_name, pat_name, scale_name, anchor_name, win_x, win_y);
|
||||
|
||||
Xorg_Viewer *v = xorg_viewer_open(win_x, win_y, width, height, "xorg_cli");
|
||||
xorg_viewer_set_scale(v, scale);
|
||||
xorg_viewer_set_anchor(v, anchor);
|
||||
if (!v) {
|
||||
fprintf(stderr, "xorg_cli: failed to open viewer window\n");
|
||||
test_image_free(f);
|
||||
return 1;
|
||||
}
|
||||
|
||||
xorg_viewer_set_scale(v, scale);
|
||||
xorg_viewer_set_anchor(v, anchor);
|
||||
|
||||
/* Overlay: today's date, white text, top-left corner. */
|
||||
{
|
||||
char date_buf[32];
|
||||
time_t now = time(NULL);
|
||||
struct tm *tm = localtime(&now);
|
||||
strftime(date_buf, sizeof(date_buf), "%Y-%m-%d", tm);
|
||||
xorg_viewer_set_overlay_text(v, 0, 10, 10, date_buf, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
|
||||
if (fmt == TEST_FMT_YUV420) {
|
||||
xorg_viewer_push_yuv420(v,
|
||||
f->plane[0], f->plane[1], f->plane[2],
|
||||
|
||||
Reference in New Issue
Block a user