pub struct FpsConfig {
pub multiplier: u32,
pub mode: VideoExportMode,
}Expand description
Parsed FPS configuration.
This struct handles parsing of FPS strings (like “1x”, “2x”, “120”) and calculates the appropriate capture rate and output framerate based on the video export mode.
Fields§
§multiplier: u32Multiplier for frame capture (1 = normal, 2 = capture twice per frame, etc.)
mode: VideoExportModeThe export mode (accurate or smooth)
Implementations§
Source§impl FpsConfig
impl FpsConfig
Sourcepub fn parse(s: &str, mode: VideoExportMode) -> Result<Self, String>
pub fn parse(s: &str, mode: VideoExportMode) -> Result<Self, String>
Parse an FPS string (e.g., “1x”, “2x”, “60”, “120.0”).
- Multipliers like “1x”, “2x”, “3x” specify how often to sample the framebuffer
- Fixed values like “60” or “120.0” are converted to the nearest multiplier
Sourcepub fn output_fps(&self) -> f64
pub fn output_fps(&self) -> f64
Get the output framerate as a floating-point value.
Sourcepub fn output_fps_rational(&self) -> String
pub fn output_fps_rational(&self) -> String
Get the output framerate as a rational string for FFmpeg.
For accurate mode, this returns the exact NES framerate fraction multiplied. For smooth mode, this returns clean integer multiples of 60.
Sourcepub fn captures_per_frame(&self) -> u32
pub fn captures_per_frame(&self) -> u32
Get the number of frames to capture per PPU frame.
For 1x, this is 1 (capture once per complete frame). For 2x, this is 2 (capture at mid-frame and end of frame). For 3x, this is 3 (capture at 1/3, 2/3, and end of frame).
Sourcepub fn needs_mid_frame_capture(&self) -> bool
pub fn needs_mid_frame_capture(&self) -> bool
Check if this configuration requires mid-frame captures.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FpsConfig
impl RefUnwindSafe for FpsConfig
impl Send for FpsConfig
impl Sync for FpsConfig
impl Unpin for FpsConfig
impl UnsafeUnpin for FpsConfig
impl UnwindSafe for FpsConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().