Skip to main content

Smk

Struct Smk 

Source
pub struct Smk { /* private fields */ }

Implementations§

Source§

impl Smk

Source

pub fn open_file(path: impl AsRef<Path>, memory_mode: bool) -> Result<Smk>

Open an SMK file from disk.

If memory_mode is true, all frame data is loaded into memory and the file handle is closed. Otherwise the file is kept open for streaming.

Source

pub fn open_memory(data: &[u8]) -> Result<Smk>

Open an SMK from an in-memory buffer.

Source

pub fn info(&self) -> SmkInfo

Source

pub fn info_video(&self) -> VideoInfo

Source

pub fn info_audio(&self) -> AudioInfo

Source

pub fn enable_all(&mut self, mask: u8)

Source

pub fn enable_video(&mut self, enable: bool)

Source

pub fn enable_audio(&mut self, track: u8, enable: bool)

Source

pub fn palette(&self) -> &[[u8; 3]; 256]

Source

pub fn video_data(&self) -> &[u8]

Source

pub fn audio_data(&self, track: u8) -> Option<&[u8]>

Source

pub fn first_frame(&mut self) -> Result<FrameStatus>

Rewind to the first frame and decode it.

Source

pub fn next_frame(&mut self) -> Result<FrameStatus>

Advance to the next frame and decode it.

Source

pub fn seek_keyframe(&mut self, frame: u32) -> Result<()>

Seek to the keyframe at or before the given frame index, then decode it.

Auto Trait Implementations§

§

impl Freeze for Smk

§

impl RefUnwindSafe for Smk

§

impl Send for Smk

§

impl Sync for Smk

§

impl Unpin for Smk

§

impl UnsafeUnpin for Smk

§

impl UnwindSafe for Smk

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.