pub struct Renderer { /* private fields */ }Expand description
Main renderer that coordinates rendering pipeline
Implementations§
Source§impl Renderer
impl Renderer
Sourcepub fn new(
backend_type: BackendType,
context: RenderContext,
) -> Result<Self, RenderError>
pub fn new( backend_type: BackendType, context: RenderContext, ) -> Result<Self, RenderError>
Create a new renderer with the given backend type and context
Sourcepub fn with_backend(
context: RenderContext,
backend: Box<dyn RenderBackend>,
) -> Result<Self, RenderError>
pub fn with_backend( context: RenderContext, backend: Box<dyn RenderBackend>, ) -> Result<Self, RenderError>
Create a new renderer with a specific backend instance
Sourcepub fn with_auto_backend(context: RenderContext) -> Result<Self, RenderError>
pub fn with_auto_backend(context: RenderContext) -> Result<Self, RenderError>
Create renderer with automatic backend detection
Sourcepub fn render_frame(
&mut self,
script: &Script<'_>,
time_cs: u32,
) -> Result<Frame, RenderError>
pub fn render_frame( &mut self, script: &Script<'_>, time_cs: u32, ) -> Result<Frame, RenderError>
Render a frame for the given script at the specified time
Sourcepub fn render_frame_bitmaps(
&mut self,
script: &Script<'_>,
time_cs: u32,
) -> Result<Vec<RenderBitmap>, RenderError>
pub fn render_frame_bitmaps( &mut self, script: &Script<'_>, time_cs: u32, ) -> Result<Vec<RenderBitmap>, RenderError>
Render the active subtitles at time_cs to a positioned bitmap list
(libass ASS_Image style) rather than a composited frame.
The caller (typically a video player or GPU) composites the returned bitmaps. This skips the renderer’s full-frame clear, the final composite blend and the frame-buffer copy — the model real integrations use, and the apples-to-apples shape of libass’s own output. Requires a software backend.
Sourcepub fn render_frame_incremental(
&mut self,
script: &Script<'_>,
time_cs: u32,
previous_frame: &Frame,
) -> Result<Frame, RenderError>
pub fn render_frame_incremental( &mut self, script: &Script<'_>, time_cs: u32, previous_frame: &Frame, ) -> Result<Frame, RenderError>
Render frame incrementally (dirty regions only)
Sourcepub fn backend_type(&self) -> BackendType
pub fn backend_type(&self) -> BackendType
Get current backend type
Sourcepub fn set_context(&mut self, context: RenderContext)
pub fn set_context(&mut self, context: RenderContext)
Update render context
Sourcepub fn context(&self) -> &RenderContext
pub fn context(&self) -> &RenderContext
Get render context
Sourcepub fn context_mut(&mut self) -> &mut RenderContext
pub fn context_mut(&mut self) -> &mut RenderContext
Get mutable render context
Sourcepub fn set_collision_resolver(&mut self, _resolver: Box<dyn CollisionDetector>)
pub fn set_collision_resolver(&mut self, _resolver: Box<dyn CollisionDetector>)
Set collision resolver for subtitle positioning
Sourcepub fn metrics(&self) -> Option<PerformanceMetrics>
pub fn metrics(&self) -> Option<PerformanceMetrics>
Get performance metrics if available
Sourcepub fn cache_stats(&self) -> CacheStatistics
pub fn cache_stats(&self) -> CacheStatistics
Get cache statistics
Auto Trait Implementations§
impl !RefUnwindSafe for Renderer
impl !UnwindSafe for Renderer
impl Freeze for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnsafeUnpin for Renderer
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
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>
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>
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