Skip to main content

draw_text

Function draw_text 

Source
pub fn draw_text(
    image: &mut Tensor,
    text: &str,
    x: usize,
    y: usize,
    color: [f32; 3],
) -> Result<(), ImgProcError>
Expand description

Draw text on a u8 image. Draw text on a [H, W, 3] image tensor using an embedded 8×8 bitmap font.

(x, y) is the top-left pixel of the first character. Characters outside the image bounds are silently clipped. Only ASCII 32–126 is rendered; other bytes are replaced with ?.