Skip to main content

compare

Function compare 

Source
pub fn compare(
    baseline: &Baseline,
    frame_w: usize,
    frame_h: usize,
    frame: &[u8],
    at: Point,
) -> Result<RegionDiff, DiffError>
Expand description

Compare a baseline against the same-sized window of frame at at, over the baseline’s mask.

RGB only. Alpha is the mask, so comparing it would test the crop’s transparency against the capture’s opaque 255 and mark every masked-in pixel changed. Note the masked-out pixels still hold real colour — cropping copies RGB and PNG is not premultiplied — so exclusion goes through the mask, never through “the colour looks empty”.