Struct swf_headers::SwfHeaders
[−]
[src]
pub struct SwfHeaders { /* fields omitted */ }
The primary struct, managing all the parsing and storage of SWF header information.
Methods
impl SwfHeaders
[src]
pub fn open<T: AsRef<Path>>(path: T) -> Result<(Self, DecodedSwf), Error>
[src]
Wraps over read_from(), taking a path and opening it for you.
Examples
use swf_headers::SwfHeaders; if let Ok((headers, decoded)) = SwfHeaders::open("example.swf") { // ... }
pub fn read_from(file: File) -> Result<(Self, DecodedSwf), Error>
[src]
Takes a SWF file and parses its headers, returning the header struct along with a readable DecodedSwf if you wish to continue parsing the file.
The vast bulk of SWF parsing happens in here. The code is documented, so you can read through the source if you want to understand how it all works.
Examples
use std::fs::File; use swf_headers::SwfHeaders; if let Ok(file) = File::open("example.swf") { let (headers, decoded) = SwfHeaders::read_from(file).unwrap(); // ... }
pub fn signature(&self) -> Signature
[src]
Returns the signature as an enum representing all valid values.
pub fn version(&self) -> u8
[src]
Returns the version number.
pub fn file_length(&self) -> u32
[src]
Returns the uncompressed total file length in bytes.
pub fn dimensions_twips(&self) -> (u32, u32)
[src]
Returns the dimensions in twips (the measurement unit flash uses, 1/20th of a pixel).
pub fn dimensions(&self) -> (u32, u32)
[src]
Returns the dimensions in pixels (converted from twips, sometimes losing accuracy).
pub fn frame_rate(&self) -> u16
[src]
Returns the frame rate (note: does not yet handle fractional framerates).
pub fn frame_count(&self) -> u16
[src]
Returns the frame count.
Trait Implementations
impl Copy for SwfHeaders
[src]
impl Clone for SwfHeaders
[src]
fn clone(&self) -> SwfHeaders
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for SwfHeaders
[src]
fn eq(&self, __arg_0: &SwfHeaders) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SwfHeaders) -> bool
[src]
This method tests for !=
.