pub struct Effect<P: Pod> { /* private fields */ }Expand description
A built-in effect: a WgpuFrameFilter whose parameter type is fixed
at build time, so Self::params_handle needs no type argument and
cannot be mismatched against a same-sized foreign struct.
Implements FrameFilter by delegation — box it straight into a
pipeline: pipeline.filter("adjust", Box::new(effect)).
Implementations§
Source§impl<P: Pod> Effect<P>
impl<P: Pod> Effect<P>
Sourcepub fn params_handle(&self) -> WgpuParamsHandle<P>
pub fn params_handle(&self) -> WgpuParamsHandle<P>
Typed handle for live parameter updates from any thread.
Sourcepub fn stats_handle(&self) -> Arc<Mutex<WgpuFilterStats>>
pub fn stats_handle(&self) -> Arc<Mutex<WgpuFilterStats>>
Shared handle to cumulative per-stage timing statistics.
Sourcepub fn into_inner(self) -> WgpuFrameFilter
pub fn into_inner(self) -> WgpuFrameFilter
Unwraps the underlying WgpuFrameFilter, giving up the typed
params binding.
Trait Implementations§
Source§impl<P: Pod + Send> FrameFilter for Effect<P>
impl<P: Pod + Send> FrameFilter for Effect<P>
Source§fn media_type(&self) -> AVMediaType
fn media_type(&self) -> AVMediaType
Returns the media type this filter operates on. Read more
Source§fn init(
&mut self,
ctx: &mut FrameFilterContext<'_>,
) -> Result<(), FrameFilterError>
fn init( &mut self, ctx: &mut FrameFilterContext<'_>, ) -> Result<(), FrameFilterError>
Initializes the filter. Read more
Source§fn filter_frame(
&mut self,
frame: Frame,
ctx: &mut FrameFilterContext<'_>,
) -> Result<Option<Frame>, FrameFilterError>
fn filter_frame( &mut self, frame: Frame, ctx: &mut FrameFilterContext<'_>, ) -> Result<Option<Frame>, FrameFilterError>
Processes a single frame through the filter. Read more
Source§fn request_frame(
&mut self,
ctx: &mut FrameFilterContext<'_>,
) -> Result<Option<Frame>, FrameFilterError>
fn request_frame( &mut self, ctx: &mut FrameFilterContext<'_>, ) -> Result<Option<Frame>, FrameFilterError>
Requests a frame from the filter. Read more
Source§fn request_frame_mode(&self) -> RequestFrameMode
fn request_frame_mode(&self) -> RequestFrameMode
Declares whether
request_frame can produce
frames autonomously. Returning RequestFrameMode::Never lets the
pipeline stop polling this filter (PERF-8). The default preserves the
historical always-polled behavior for third-party generator filters.Source§fn uninit(&mut self, ctx: &mut FrameFilterContext<'_>)
fn uninit(&mut self, ctx: &mut FrameFilterContext<'_>)
Cleans up the filter. Read more
Auto Trait Implementations§
impl<P> !Freeze for Effect<P>
impl<P> !RefUnwindSafe for Effect<P>
impl<P> !Sync for Effect<P>
impl<P> !UnwindSafe for Effect<P>
impl<P> Send for Effect<P>where
P: Send,
impl<P> Unpin for Effect<P>where
P: Unpin,
impl<P> UnsafeUnpin for Effect<P>
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