pub struct VisualOptions {
pub snapshot_dir: PathBuf,
pub channel_tolerance: u8,
pub threshold_percent: f64,
pub generate_diff_image: bool,
pub update_baselines: bool,
pub mask_regions: Vec<MaskRegion>,
pub platform_baselines: bool,
}Expand description
Options for visual regression comparison.
Fields§
§snapshot_dir: PathBufDirectory where baseline snapshots are stored.
channel_tolerance: u8Per-channel tolerance (0-255). Pixels differing by less than this in all channels are considered matching.
threshold_percent: f64Maximum allowed diff percentage before comparison fails.
generate_diff_image: boolWhether to generate a diff image on mismatch.
update_baselines: boolWhether to update baselines instead of comparing.
mask_regions: Vec<MaskRegion>Rectangular regions to exclude from comparison.
platform_baselines: boolStore baselines in a platform-specific subdirectory
(e.g., tests/snapshots/windows/). Enabled by default.
Implementations§
Source§impl VisualOptions
impl VisualOptions
Sourcepub fn with_preset(self, preset: ThresholdPreset) -> Self
pub fn with_preset(self, preset: ThresholdPreset) -> Self
Apply a threshold preset, overriding channel_tolerance and
threshold_percent.
Sourcepub fn with_mask(self, region: MaskRegion) -> Self
pub fn with_mask(self, region: MaskRegion) -> Self
Add a mask region to exclude from comparison.
Trait Implementations§
Source§impl Clone for VisualOptions
impl Clone for VisualOptions
Source§fn clone(&self) -> VisualOptions
fn clone(&self) -> VisualOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VisualOptions
impl Debug for VisualOptions
Auto Trait Implementations§
impl Freeze for VisualOptions
impl RefUnwindSafe for VisualOptions
impl Send for VisualOptions
impl Sync for VisualOptions
impl Unpin for VisualOptions
impl UnsafeUnpin for VisualOptions
impl UnwindSafe for VisualOptions
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