Skip to main content

Viewer

Struct Viewer 

Source
pub struct Viewer<'src> { /* private fields */ }
Expand description

Windowed / headless media inspection session. Donor: oa::Viewer.

Implementations§

Source§

impl<'src> Viewer<'src>

Source

pub fn new(config: ViewerConfig) -> Self

Source

pub fn new_with_path(path: impl Into<String>) -> Self

Source

pub fn set_live_source(&mut self, source: &'src mut dyn ViewerLiveSource)

Source

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.

Source

pub fn preview(path: &str) -> Result<()>

Open path in a new window, creating a presentation-capable runtime.

Source

pub fn preview_with_config(path: &str, config: ViewerConfig) -> Result<()>

Source

pub fn preview_with_runtime(runtime: &Runtime, path: &str) -> Result<()>

Open path borrowing runtime.

Source

pub fn preview_with_runtime_and_config( runtime: &Runtime, path: &str, config: ViewerConfig, ) -> Result<()>

Source

pub fn show(runtime: &Runtime, texture: &Texture) -> Result<()>

Display texture in a blocking window using runtime.

Source

pub fn show_with_config( runtime: &Runtime, texture: &Texture, config: ViewerConfig, ) -> Result<()>

Source

pub fn show_render_frame( runtime: &Runtime, 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(*runtime, *renderer, *frame, cfg).

Source

pub fn run(self, runtime: &Runtime) -> Result<()>

Run the viewer session borrowing runtime.

Source

pub fn run_standalone(self) -> Result<()>

Create a presentation-capable runtime and run.

Use this when Viewer::new(config).run_standalone() — the viewer owns its own runtime lifecycle. Equivalent to the C++ viewer.run() one-liner when no runtime is passed.

Auto Trait Implementations§

§

impl<'src> !RefUnwindSafe for Viewer<'src>

§

impl<'src> !Send for Viewer<'src>

§

impl<'src> !Sync for Viewer<'src>

§

impl<'src> !UnwindSafe for Viewer<'src>

§

impl<'src> Forget for Viewer<'src>

§

impl<'src> Freeze for Viewer<'src>

§

impl<'src> Move for Viewer<'src>

§

impl<'src> Unpin for Viewer<'src>

§

impl<'src> UnsafeUnpin for Viewer<'src>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.