Struct image::Delay [−][src]
pub struct Delay { /* fields omitted */ }
The delay of a frame relative to the previous one.
Implementations
impl Delay
[src]
impl Delay
[src]pub fn from_numer_denom_ms(numerator: u32, denominator: u32) -> Self
[src]
Create a delay from a ratio of milliseconds.
Examples
use image::Delay; let delay_10ms = Delay::from_numer_denom_ms(10, 1);
pub fn from_saturating_duration(duration: Duration) -> Self
[src]
Convert from a duration, clamped between 0 and an implemented defined maximum.
The maximum is at least i32::MAX
milliseconds. It should be noted that the accuracy of
the result may be relative and very large delays have a coarse resolution.
Examples
use std::time::Duration; use image::Delay; let duration = Duration::from_millis(20); let delay = Delay::from_saturating_duration(duration);
pub fn numer_denom_ms(self) -> (u32, u32)
[src]
The numerator and denominator of the delay in milliseconds.
This is guaranteed to be an exact conversion if the Delay
was previously created with the
from_numer_denom_ms
constructor.
Trait Implementations
impl PartialOrd<Delay> for Delay
[src]
impl PartialOrd<Delay> for Delay
[src]