pub fn encode_rle(
mask: &[u8],
width: u32,
height: u32,
) -> Result<CocoRle, Error>Expand description
Encode a binary mask (row-major, 0/1 values) as COCO RLE.
COCO RLE uses column-major (Fortran) order, starting with a background count. This function transposes the input from row-major to column-major before run-length encoding.
§Arguments
mask- Binary mask in row-major order (0 = background, nonzero = foreground)width- Image width in pixelsheight- Image height in pixels
§Returns
A CocoRle with counts and size fields.