pub struct Viewer<'src> { /* private fields */ }Expand description
Windowed / headless media inspection session. Donor: oa::Viewer.
Implementations§
Source§impl<'src> Viewer<'src>
impl<'src> Viewer<'src>
pub fn new(config: ViewerConfig) -> Self
pub fn new_with_path(path: impl Into<String>) -> Self
pub fn set_live_source(&mut self, source: &'src mut dyn ViewerLiveSource)
Sourcepub fn set_workspace(&mut self, workspace: &'src mut Workspace)
pub fn set_workspace(&mut self, workspace: &'src mut Workspace)
Attach a Workspace dock host; equivalent to set_live_source but
selects ViewerMode::Workspace for the dock-window presentation.
Sourcepub fn preview(path: &str) -> Result<()>
pub fn preview(path: &str) -> Result<()>
Open path in a new window, creating a presentation-capable engine.
pub fn preview_with_config(path: &str, config: ViewerConfig) -> Result<()>
Sourcepub fn preview_with_engine(engine: &Engine, path: &str) -> Result<()>
pub fn preview_with_engine(engine: &Engine, path: &str) -> Result<()>
Open path borrowing engine.
pub fn preview_with_engine_and_config( engine: &Engine, path: &str, config: ViewerConfig, ) -> Result<()>
Sourcepub fn show(engine: &Engine, texture: &Texture) -> Result<()>
pub fn show(engine: &Engine, texture: &Texture) -> Result<()>
Display texture in a blocking window using engine.
pub fn show_with_config( engine: &Engine, texture: &Texture, config: ViewerConfig, ) -> Result<()>
Sourcepub fn show_render_frame(
engine: &Engine,
renderer: &Renderer<'_>,
frame: RenderFrame,
config: ViewerConfig,
) -> Result<()>
pub fn show_render_frame( engine: &Engine, renderer: &Renderer<'_>, frame: RenderFrame, config: ViewerConfig, ) -> Result<()>
Display a headless RenderFrame in a blocking window.
Waits for the frame’s producer event before presenting, then returns
once the window is closed. A second begin_frame / cancel_frame
cycle is recordable immediately after this call returns, proving that
the ring slot was released.
Donor: oa::Viewer::show(*engine, *renderer, *frame, cfg).
Sourcepub fn run_standalone(self) -> Result<()>
pub fn run_standalone(self) -> Result<()>
Create a presentation-capable engine and run.
Use this when Viewer::new(config).run_standalone() — the viewer
owns its own engine lifecycle. Equivalent to the C++ viewer.run()
one-liner when no engine is passed.