Struct egui_thumbhash::ThumbhashImage
source · pub struct ThumbhashImage<'a, 'h> { /* private fields */ }
Expand description
A widget that displays a thumbhash while the actual image is loading.
Implementations§
source§impl<'a, 'h> ThumbhashImage<'a, 'h>
impl<'a, 'h> ThumbhashImage<'a, 'h>
sourcepub fn new(image: Image<'a>, thumbhash: &'h [u8]) -> Self
pub fn new(image: Image<'a>, thumbhash: &'h [u8]) -> Self
Create a new ThumbhashImage widget. You should pass a Image with the configuration you want. Since the width of the egui Image is currently a bit finicky, you can use Image::fit_to_exact_size to make sure the image is the size you want.
sourcepub fn id(self, id: Id) -> Self
pub fn id(self, id: Id) -> Self
Set a unique id for this widget, used for the fade animation. By default, the thumbhash data is used as the id.
sourcepub fn fade(self, fade: bool) -> Self
pub fn fade(self, fade: bool) -> Self
Set whether the image should fade in when it’s loaded. Defaults to true.
sourcepub fn fit_to_exact_size(self, size: Vec2) -> Self
pub fn fit_to_exact_size(self, size: Vec2) -> Self
Set the exact size the image should be shown at. This will override the size of the image widget.
sourcepub fn rounding(self, rounding: impl Into<Rounding>) -> Self
pub fn rounding(self, rounding: impl Into<Rounding>) -> Self
Set the rounding of the image. Use this instead of Image::rounding to make sure the rounding is applied to the thumbhash image as well.
Trait Implementations§
Auto Trait Implementations§
impl<'a, 'h> Freeze for ThumbhashImage<'a, 'h>
impl<'a, 'h> RefUnwindSafe for ThumbhashImage<'a, 'h>
impl<'a, 'h> Send for ThumbhashImage<'a, 'h>
impl<'a, 'h> Sync for ThumbhashImage<'a, 'h>
impl<'a, 'h> Unpin for ThumbhashImage<'a, 'h>
impl<'a, 'h> UnwindSafe for ThumbhashImage<'a, 'h>
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