Node

Struct Node 

Source
pub struct Node<'core> { /* private fields */ }
Expand description

A reference to a node in the constructed filter graph.

Implementations§

Source§

impl<'core> Node<'core>

Source

pub fn info(&self) -> VideoInfo<'core>

Returns the video info associated with this Node.

Source

pub fn get_frame<'error>( &self, n: usize, ) -> Result<FrameRef<'core>, GetFrameError<'error>>

Generates a frame directly.

The 'error lifetime is unbounded because this function always returns owned data.

§Panics

Panics is n is greater than i32::MAX.

Source

pub fn get_frame_async<F>(&self, n: usize, callback: F)
where F: FnOnce(Result<FrameRef<'core>, GetFrameError<'_>>, usize, Node<'core>) + Send + 'core,

Requests the generation of a frame. When the frame is ready, a user-provided function is called.

If multiple frames were requested, they can be returned in any order.

The callback arguments are:

  • the generated frame or an error message if the generation failed,
  • the frame number (equal to n),
  • the node that generated the frame (the same as self).

If the callback panics, the process is aborted.

§Panics

Panics is n is greater than i32::MAX.

Source

pub fn request_frame_filter(&self, context: FrameContext<'_>, n: usize)

Requests a frame from a node and returns immediately.

This is only used in filters’ “get frame” functions.

A filter usually calls this function from get_frame_initial(). The requested frame can then be retrieved using get_frame_filter() from within filter’s get_frame() function.

It is safe to request a frame more than once. An unimportant consequence of requesting a frame more than once is that the filter’s get_frame() function may be called more than once for the same frame.

It is best to request frames in ascending order, i.e. n, n+1, n+2, etc.

§Panics

Panics is n is greater than i32::MAX.

Source

pub fn get_frame_filter( &self, context: FrameContext<'_>, n: usize, ) -> Option<FrameRef<'core>>

Retrieves a frame that was previously requested with request_frame_filter().

A filter usually calls this function from get_frame(). It is safe to retrieve a frame more than once.

§Panics

Panics is n is greater than i32::MAX.

Trait Implementations§

Source§

impl<'core> Clone for Node<'core>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'core> Debug for Node<'core>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'core> Drop for Node<'core>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'map, 'elem: 'map> FilterArgument<'map, 'elem> for Node<'elem>

Source§

fn type_name() -> &'static str

Returns the VapourSynth type name for this argument type.
Source§

impl<'map, 'elem: 'map> Value<'map, 'elem> for Node<'elem>

Source§

fn get_from_map(map: &Map<'elem>, key: &str) -> Result<Self>

Retrieves the value from the map.
Source§

fn get_iter_from_map( map: &'map Map<'elem>, key: &str, ) -> Result<ValueIter<'map, 'elem, Self>>

Retrieves an iterator over the values from the map.
Source§

fn store_in_map(map: &mut Map<'elem>, key: &str, x: &Self) -> Result<()>

Sets the property value in the map.
Source§

fn append_to_map(map: &mut Map<'elem>, key: &str, x: &Self) -> Result<()>

Appends the value to the map.
Source§

impl<'core> Send for Node<'core>

Source§

impl<'core> Sync for Node<'core>

Auto Trait Implementations§

§

impl<'core> Freeze for Node<'core>

§

impl<'core> RefUnwindSafe for Node<'core>

§

impl<'core> Unpin for Node<'core>

§

impl<'core> UnwindSafe for Node<'core>

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<'map, 'elem, T> FilterParameter<'map, 'elem> for T
where 'elem: 'map, T: FilterArgument<'map, 'elem>,

Source§

type Argument = T

The underlying argument type for this parameter type.
Source§

fn is_array() -> bool

Returns whether this parameter is an array.
Source§

fn is_optional() -> bool

Returns whether this parameter is optional.
Source§

fn get_from_map(map: &'map Map<'elem>, key: &str) -> T

Retrieves this parameter from the given map.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.