pub struct Compare<'a> { /* private fields */ }
Expand description
Compare images
§Example
let image_1 = "images/baseline.jpeg".to_string();
let image_2 = "images/modfied.jpeg".to_string();
let images_match = imeq::Compare::new(image_1, image_2)
.enable_check_images_have_same_path()
.enable_check_image_hashes_match()
.enable_check_images_dimensions_match()
.enable_check_images_pixels_match()
.are_match();
if images_match {
println!("Images are a match");
} else {
println!("Images are not a match");
}
Implementations§
Source§impl Compare<'_>
impl Compare<'_>
Compare images
Sourcepub fn enable_check(&mut self, check: &'static str) -> &mut Self
pub fn enable_check(&mut self, check: &'static str) -> &mut Self
Enable or disable a check
Sourcepub fn enable_check_images_have_same_path(&mut self) -> &mut Self
pub fn enable_check_images_have_same_path(&mut self) -> &mut Self
Enable check for images having the same path
Sourcepub fn enable_check_image_hashes_match(&mut self) -> &mut Self
pub fn enable_check_image_hashes_match(&mut self) -> &mut Self
Enable check for image hashes matching
Sourcepub fn enable_check_images_dimensions_match(&mut self) -> &mut Self
pub fn enable_check_images_dimensions_match(&mut self) -> &mut Self
Enable check for image dimensions matching
Sourcepub fn enable_check_images_pixels_match(&mut self) -> &mut Self
pub fn enable_check_images_pixels_match(&mut self) -> &mut Self
Enable check for image pixels matching
Sourcepub fn arent_match(&self) -> bool
pub fn arent_match(&self) -> bool
Compare images and return if they are not a match
Auto Trait Implementations§
impl<'a> Freeze for Compare<'a>
impl<'a> RefUnwindSafe for Compare<'a>
impl<'a> Send for Compare<'a>
impl<'a> Sync for Compare<'a>
impl<'a> Unpin for Compare<'a>
impl<'a> UnwindSafe for Compare<'a>
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