MediaExtensions
struct · ferroui-base · v0.5.0
struct MediaExtensions
Provides extension methods for media types.
Members
calculate_scaling
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.
calculate_size
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.