Skip to main content

Module overlay

Module overlay 

Source
Expand description

Detection overlay — draw boxes onto caller-owned pixel buffers (desktop/renderer path).

Pure Rust, no GPU required. Coordinates use the same normalized u16 boxes as Detection.

Functions§

box_css_percent
Convert a detection box to CSS percentages (left, top, width, height) in 0…100.
box_pixel_bounds
Pixel bounds (inclusive min, exclusive max) for a detection on an image of size w×h.
compose_rgb_overlay_rgba8
Copy RGB8 source into RGBA8 (alpha=255), then draw boxes.
draw_boxes_rgba8
Draw axis-aligned box outlines onto an RGBA8 buffer (stride = w * 4). thickness in pixels (clamped 1…8). Returns number of boxes drawn.
encode_bmp_rgba8
Encode RGBA8 as a minimal uncompressed 32-bit BMP into out. Returns bytes written. Need ≥ 54 + wh4.