pub(super) struct TextureThumbnailer(pub(super) Texture);Expand description
A thumbnailer for a GdkTexture.
Tuple Fields§
§0: TextureImplementations§
Source§impl TextureThumbnailer
impl TextureThumbnailer
Sourcefn downscale_texture_if_needed(
self,
max_dimensions: FrameDimensions,
renderer: &Renderer,
) -> Option<Texture>
fn downscale_texture_if_needed( self, max_dimensions: FrameDimensions, renderer: &Renderer, ) -> Option<Texture>
Downscale the texture if needed to fit into the given maximum thumbnail dimensions.
Returns None if the dimensions of the texture are unknown.
Sourcefn texture_format_to_thumbnail_format(
format: MemoryFormat,
) -> Option<(MemoryFormat, PixelLayout)>
fn texture_format_to_thumbnail_format( format: MemoryFormat, ) -> Option<(MemoryFormat, PixelLayout)>
Convert the given texture memory format to the format needed to make a thumbnail.
The WebP encoder only supports RGB and RGBA.
Returns None if the format is unknown.
Sourcepub(super) fn generate_thumbnail_and_blurhash(
self,
scale_factor: i32,
renderer: &Renderer,
) -> Option<(Thumbnail, Blurhash)>
pub(super) fn generate_thumbnail_and_blurhash( self, scale_factor: i32, renderer: &Renderer, ) -> Option<(Thumbnail, Blurhash)>
Generate the thumbnail for the given scale factor, with the given
GskRenderer, and a Blurhash.
We use the thumbnail to compute the blurhash, which should be less expensive than using the original texture.
Trait Implementations§
Source§impl Clone for TextureThumbnailer
impl Clone for TextureThumbnailer
Source§fn clone(&self) -> TextureThumbnailer
fn clone(&self) -> TextureThumbnailer
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 TextureThumbnailer
impl RefUnwindSafe for TextureThumbnailer
impl Send for TextureThumbnailer
impl Sync for TextureThumbnailer
impl Unpin for TextureThumbnailer
impl UnsafeUnpin for TextureThumbnailer
impl UnwindSafe for TextureThumbnailer
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more