pub struct ImageDiffResult {
pub matches: bool,
pub diff_pixel_count: usize,
pub total_pixels: usize,
pub diff_percentage: f64,
pub max_color_diff: u32,
pub avg_color_diff: f64,
pub diff_image: Option<Vec<u8>>,
}Expand description
Result of comparing two images
Fields§
§matches: boolWhether images match within threshold
diff_pixel_count: usizeNumber of pixels that differ
total_pixels: usizeTotal number of pixels compared
diff_percentage: f64Percentage of pixels that differ (0.0-100.0)
max_color_diff: u32Maximum color difference found
avg_color_diff: f64Average color difference for differing pixels
diff_image: Option<Vec<u8>>Diff image data (PNG encoded, highlights differences in red)
Implementations§
Source§impl ImageDiffResult
impl ImageDiffResult
Sourcepub const fn is_identical(&self) -> bool
pub const fn is_identical(&self) -> bool
Check if images are identical (no differences)
Sourcepub fn within_threshold(&self, threshold: f64) -> bool
pub fn within_threshold(&self, threshold: f64) -> bool
Check if difference is within threshold
Trait Implementations§
Source§impl Clone for ImageDiffResult
impl Clone for ImageDiffResult
Source§fn clone(&self) -> ImageDiffResult
fn clone(&self) -> ImageDiffResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ImageDiffResult
impl RefUnwindSafe for ImageDiffResult
impl Send for ImageDiffResult
impl Sync for ImageDiffResult
impl Unpin for ImageDiffResult
impl UnsafeUnpin for ImageDiffResult
impl UnwindSafe for ImageDiffResult
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more