pub struct Pull(/* private fields */);Expand description
An exact pull-up or pull-down factor for a frame rate or a sample rate.
Pulling a rate multiplies it by the factor. 0.1% pulls move between film and NTSC speeds and 4% pulls between 24 and 25 frames per second. A pulled rate is usually not a whole number: 48 kHz pulled down 0.1% is 48 000 000/1001 ≈ 47 952.05 Hz, which equipment labels 47.952 kHz.
use smpte_timecode::{FrameRate, Pull, Ratio};
let pulled = Pull::DOWN_0_1_PERCENT.apply(Ratio::from_integer(48_000)).unwrap();
assert_eq!((pulled.numer(), pulled.denom()), (48_000_000, 1001));
let film_to_pal = Pull::UP_4_PERCENT.apply(FrameRate::FPS_24.frames_per_second()).unwrap();
assert_eq!(film_to_pal, FrameRate::FPS_25.frames_per_second());Implementations§
Source§impl Pull
impl Pull
Sourcepub const UP_0_1_PERCENT: Self
pub const UP_0_1_PERCENT: Self
1001/1000, from NTSC speed up to film speed.
Sourcepub const DOWN_0_1_PERCENT: Self
pub const DOWN_0_1_PERCENT: Self
1000/1001, from film speed down to NTSC speed.
Sourcepub const UP_4_PERCENT: Self
pub const UP_4_PERCENT: Self
25/24, from 24 up to 25 frames per second. The exact change is +4.1667%.
Sourcepub const DOWN_4_PERCENT: Self
pub const DOWN_4_PERCENT: Self
24/25, from 25 down to 24 frames per second.
Trait Implementations§
impl Copy for Pull
impl Eq for Pull
impl StructuralPartialEq for Pull
Auto Trait Implementations§
impl Freeze for Pull
impl RefUnwindSafe for Pull
impl Send for Pull
impl Sync for Pull
impl Unpin for Pull
impl UnsafeUnpin for Pull
impl UnwindSafe for Pull
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