pub struct WatermarkConfig {
pub content: WatermarkContent,
pub position: OverlayPosition,
pub opacity: f32,
pub scale: f32,
pub margin: u32,
pub start_time: Option<f64>,
pub end_time: Option<f64>,
}Expand description
Configuration for a single watermark overlay.
Fields§
§content: WatermarkContentContent to overlay.
position: OverlayPositionPosition anchor.
opacity: f32Opacity from 0.0 (invisible) to 1.0 (fully opaque).
scale: f32Scale factor for the overlay (1.0 = original size).
margin: u32Optional margin from the anchor edge in pixels.
start_time: Option<f64>Optional start time in seconds (overlay appears at this time).
end_time: Option<f64>Optional end time in seconds (overlay disappears at this time).
Implementations§
Source§impl WatermarkConfig
impl WatermarkConfig
Sourcepub fn with_position(self, pos: OverlayPosition) -> Self
pub fn with_position(self, pos: OverlayPosition) -> Self
Set position.
Sourcepub fn with_opacity(self, opacity: f32) -> Self
pub fn with_opacity(self, opacity: f32) -> Self
Set opacity (clamped to 0.0 - 1.0).
Sourcepub fn with_scale(self, scale: f32) -> Self
pub fn with_scale(self, scale: f32) -> Self
Set scale factor.
Sourcepub fn with_margin(self, margin: u32) -> Self
pub fn with_margin(self, margin: u32) -> Self
Set margin.
Sourcepub fn with_time_range(self, start: f64, end: f64) -> Self
pub fn with_time_range(self, start: f64, end: f64) -> Self
Set time range visibility.
Sourcepub fn is_visible_at(&self, time_seconds: f64) -> bool
pub fn is_visible_at(&self, time_seconds: f64) -> bool
Check whether the watermark is visible at a given timestamp.
Sourcepub fn effective_opacity(&self, time_seconds: f64) -> f32
pub fn effective_opacity(&self, time_seconds: f64) -> f32
Compute effective opacity at the given timestamp.
Trait Implementations§
Source§impl Clone for WatermarkConfig
impl Clone for WatermarkConfig
Source§fn clone(&self) -> WatermarkConfig
fn clone(&self) -> WatermarkConfig
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 WatermarkConfig
impl RefUnwindSafe for WatermarkConfig
impl Send for WatermarkConfig
impl Sync for WatermarkConfig
impl Unpin for WatermarkConfig
impl UnsafeUnpin for WatermarkConfig
impl UnwindSafe for WatermarkConfig
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