pub struct MediaExtensions;Expand description
Provides extension methods for media types.
Implementations§
Source§impl MediaExtensions
impl MediaExtensions
Sourcepub fn calculate_scaling(
stretch: Stretch,
destination_size: Size,
source_size: Size,
stretch_direction: StretchDirection,
) -> Vector
pub fn calculate_scaling( stretch: Stretch, destination_size: Size, source_size: Size, stretch_direction: StretchDirection, ) -> Vector
Calculates scaling based on a Stretch value.
stretch- The stretch mode.destination_size- The size of the destination viewport.source_size- The size of the source.stretch_direction- The stretch direction (upstream default:StretchDirection::Both).
Returns a vector with the X and Y scaling factors.
Sourcepub fn calculate_size(
stretch: Stretch,
destination_size: Size,
source_size: Size,
stretch_direction: StretchDirection,
) -> Size
pub fn calculate_size( stretch: Stretch, destination_size: Size, source_size: Size, stretch_direction: StretchDirection, ) -> Size
Calculates a scaled size based on a Stretch value.
stretch- The stretch mode.destination_size- The size of the destination viewport.source_size- The size of the source.stretch_direction- The stretch direction (upstream default:StretchDirection::Both).
Returns the size of the stretched source.
Auto Trait Implementations§
impl Freeze for MediaExtensions
impl RefUnwindSafe for MediaExtensions
impl Send for MediaExtensions
impl Sync for MediaExtensions
impl Unpin for MediaExtensions
impl UnsafeUnpin for MediaExtensions
impl UnwindSafe for MediaExtensions
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more