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).
thicknessin 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.