pub struct VobSubParser { /* private fields */ }Expand description
VobSub subtitle parser and renderer.
Implementations§
Source§impl VobSubParser
impl VobSubParser
Sourcepub fn load_from_data(&mut self, idx_content: &str, sub_data: Vec<u8>)
pub fn load_from_data(&mut self, idx_content: &str, sub_data: Vec<u8>)
Load VobSub from IDX content and SUB data.
Sourcepub fn load_from_mks(&mut self, mks_data: &[u8]) -> Result<(), String>
pub fn load_from_mks(&mut self, mks_data: &[u8]) -> Result<(), String>
Load VobSub from a Matroska subtitle container with embedded S_VOBSUB tracks.
Sourcepub fn load_from_sub_only(&mut self, sub_data: Vec<u8>)
pub fn load_from_sub_only(&mut self, sub_data: Vec<u8>)
Load VobSub from SUB file only (scans for timestamps).
Sourcepub fn last_render_issue(&self) -> String
pub fn last_render_issue(&self) -> String
Get the last non-fatal render issue for diagnostics.
Sourcepub fn screen_width(&self) -> u16
pub fn screen_width(&self) -> u16
Get the presentation width for this subtitle track.
Sourcepub fn screen_height(&self) -> u16
pub fn screen_height(&self) -> u16
Get the presentation height for this subtitle track.
Sourcepub fn has_idx_metadata(&self) -> bool
pub fn has_idx_metadata(&self) -> bool
Check whether IDX metadata was used to load the parser.
Sourcepub fn get_timestamps(&self) -> Vec<f64>
pub fn get_timestamps(&self) -> Vec<f64>
Get all timestamps in milliseconds.
Sourcepub fn find_index_at_timestamp(&mut self, time_ms: f64) -> i32
pub fn find_index_at_timestamp(&mut self, time_ms: f64) -> i32
Find the subtitle index for a given timestamp in milliseconds. Returns -1 if no subtitle should be displayed at this time.
Sourcepub fn get_cue_start_time(&self, index: usize) -> f64
pub fn get_cue_start_time(&self, index: usize) -> f64
Get the cue start time in milliseconds.
Sourcepub fn get_cue_end_time(&mut self, index: usize) -> f64
pub fn get_cue_end_time(&mut self, index: usize) -> f64
Get the cue end time in milliseconds.
Sourcepub fn get_cue_duration(&mut self, index: usize) -> f64
pub fn get_cue_duration(&mut self, index: usize) -> f64
Get the cue duration in milliseconds.
Sourcepub fn get_cue_file_position(&self, index: usize) -> f64
pub fn get_cue_file_position(&self, index: usize) -> f64
Get the cue file position in the SUB file.
Sourcepub fn render_at_index(&mut self, index: usize) -> Option<VobSubFrame>
pub fn render_at_index(&mut self, index: usize) -> Option<VobSubFrame>
Render subtitle at the given index and return RGBA data.
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear the internal cache.
Sourcepub fn set_deband_enabled(&mut self, enabled: bool)
pub fn set_deband_enabled(&mut self, enabled: bool)
Enable or disable debanding.
Sourcepub fn set_deband_threshold(&mut self, threshold: f32)
pub fn set_deband_threshold(&mut self, threshold: f32)
Set the deband threshold (0.0-255.0, default: 64.0).
Sourcepub fn set_deband_range(&mut self, range: u32)
pub fn set_deband_range(&mut self, range: u32)
Set the deband sample range in pixels (default: 15).
Sourcepub fn deband_enabled(&self) -> bool
pub fn deband_enabled(&self) -> bool
Check if debanding is enabled.