Skip to main content

black_out

Function black_out 

Source
pub(crate) fn black_out(
    image_bytes: &[u8],
    boxes: &[[f64; 4]],
    css_width: Option<f64>,
) -> Result<Vec<u8>, String>
Expand description

Paint every box black and return the image as PNG. css_width is the page’s viewport width, which scales the boxes to the image; without it the boxes can’t be placed, so it fails rather than guess.