pub struct Environment { /* private fields */ }
Expand description
A wrapper for the VSScript environment.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn new() -> Result<Self, Error>
pub fn new() -> Result<Self, Error>
Creates an empty script environment.
Useful if it is necessary to set some variable in the script environment before evaluating any scripts.
Sourcepub fn from_script(script: &str) -> Result<Self, Error>
pub fn from_script(script: &str) -> Result<Self, Error>
Creates a script environment and evaluates a script contained in a string.
Sourcepub fn from_file<P: AsRef<Path>>(
path: P,
flags: EvalFlags,
) -> Result<Self, Error>
pub fn from_file<P: AsRef<Path>>( path: P, flags: EvalFlags, ) -> Result<Self, Error>
Creates a script environment and evaluates a script contained in a file.
Sourcepub fn eval_script(&mut self, script: &str) -> Result<(), Error>
pub fn eval_script(&mut self, script: &str) -> Result<(), Error>
Evaluates a script contained in a string.
Sourcepub fn eval_file<P: AsRef<Path>>(
&mut self,
path: P,
flags: EvalFlags,
) -> Result<(), Error>
pub fn eval_file<P: AsRef<Path>>( &mut self, path: P, flags: EvalFlags, ) -> Result<(), Error>
Evaluates a script contained in a file.
Sourcepub fn get_output(
&self,
index: i32,
) -> Result<(Node<'_>, Option<Node<'_>>), Error>
pub fn get_output( &self, index: i32, ) -> Result<(Node<'_>, Option<Node<'_>>), Error>
Retrieves a node from the script environment. A node in the script must have been marked for output with the requested index. The second node, if any, contains the alpha clip.
Sourcepub fn clear_output(&self, index: i32) -> Result<(), Error>
pub fn clear_output(&self, index: i32) -> Result<(), Error>
Cancels a node set for output. The node will no longer be available to get_output()
.
Sourcepub fn get_core(&self) -> Result<CoreRef<'_>, Error>
pub fn get_core(&self) -> Result<CoreRef<'_>, Error>
Retrieves the VapourSynth core that was created in the script environment. If a VapourSynth core has not been created yet, it will be created now, with the default options.
Sourcepub fn get_variable(&self, name: &str, map: &mut Map<'_>) -> Result<(), Error>
pub fn get_variable(&self, name: &str, map: &mut Map<'_>) -> Result<(), Error>
Retrieves a variable from the script environment.