pub struct ImageComparison { /* private fields */ }Expand description
The decoded two sides of an image change, plus a metadata summary line.
Implementations§
Source§impl ImageComparison
impl ImageComparison
Sourcepub fn from_blobs(blobs: &BlobPair) -> Option<Self>
pub fn from_blobs(blobs: &BlobPair) -> Option<Self>
Decode both sides of blobs. Returns None when neither side decodes to
an image (so the caller falls back to the text diff).
Sourcepub fn render(
&mut self,
mode: CompareMode,
slider: f32,
box_w: u32,
box_h: u32,
) -> &Canvas
pub fn render( &mut self, mode: CompareMode, slider: f32, box_w: u32, box_h: u32, ) -> &Canvas
The opaque canvas for mode at slider position slider (0..1), fitting
within box_w × box_h. Returns a cached canvas when nothing that
affects the pixels has changed since the last call, so repaints driven by
unrelated UI activity don’t recompose the image (see [RenderCache]).
Auto Trait Implementations§
impl Freeze for ImageComparison
impl RefUnwindSafe for ImageComparison
impl Send for ImageComparison
impl Sync for ImageComparison
impl Unpin for ImageComparison
impl UnsafeUnpin for ImageComparison
impl UnwindSafe for ImageComparison
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.