pub struct BurnSubsConfig {
pub entries: Vec<SubtitleEntry>,
pub default_font: SubtitleFont,
pub frame_width: u32,
pub frame_height: u32,
pub shadow_enabled: bool,
pub antialias: bool,
}Expand description
Configuration for the subtitle burn-in operation.
Fields§
§entries: Vec<SubtitleEntry>All subtitle entries to burn in.
default_font: SubtitleFontDefault font for all entries without a font override.
frame_width: u32Video frame width in pixels.
frame_height: u32Video frame height in pixels.
shadow_enabled: boolWhether to enable soft-shadow rendering.
antialias: boolWhether to enable anti-aliased text rendering.
Implementations§
Source§impl BurnSubsConfig
impl BurnSubsConfig
Sourcepub fn add_entry(self, entry: SubtitleEntry) -> Self
pub fn add_entry(self, entry: SubtitleEntry) -> Self
Adds a subtitle entry.
Sourcepub fn with_default_font(self, font: SubtitleFont) -> Self
pub fn with_default_font(self, font: SubtitleFont) -> Self
Sets the default font.
Sourcepub fn active_at(&self, timestamp_ms: u64) -> Vec<&SubtitleEntry>
pub fn active_at(&self, timestamp_ms: u64) -> Vec<&SubtitleEntry>
Returns all entries active at the given timestamp.
Sourcepub fn compute_position(
&self,
entry: &SubtitleEntry,
text_width: u32,
text_height: u32,
) -> (u32, u32)
pub fn compute_position( &self, entry: &SubtitleEntry, text_width: u32, text_height: u32, ) -> (u32, u32)
Computes the pixel position for an entry based on its anchor.
Sourcepub fn estimate_text_size(&self, text: &str, font: &SubtitleFont) -> (u32, u32)
pub fn estimate_text_size(&self, text: &str, font: &SubtitleFont) -> (u32, u32)
Mock font rasterization: returns estimated text dimensions.
In a real implementation this would call a font rendering library.
Trait Implementations§
Source§impl Clone for BurnSubsConfig
impl Clone for BurnSubsConfig
Source§fn clone(&self) -> BurnSubsConfig
fn clone(&self) -> BurnSubsConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BurnSubsConfig
impl RefUnwindSafe for BurnSubsConfig
impl Send for BurnSubsConfig
impl Sync for BurnSubsConfig
impl Unpin for BurnSubsConfig
impl UnsafeUnpin for BurnSubsConfig
impl UnwindSafe for BurnSubsConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 more