pub struct Script { /* private fields */ }Implementations§
Source§impl Script
impl Script
Sourcepub fn new(core: Option<Core>, vssapi: VssApi) -> Self
pub fn new(core: Option<Core>, vssapi: VssApi) -> Self
Creates a new script instance.
A supplied core is transferred to VSScript. Pass None to use a default core.
§Panics
Panics if the VapourSynth API version is unavailable or script creation fails.
pub fn get_api(&self) -> Api
Sourcepub fn core(&self) -> Result<CoreRef<'_>, ScriptError>
pub fn core(&self) -> Result<CoreRef<'_>, ScriptError>
Returns a reference to the core associated with this script.
§Errors
Returns an error message if the core could not be retrieved.
Sourcepub fn evaluate(
&self,
buffer: &CStr,
filename: &CStr,
) -> Result<(), ScriptError>
pub fn evaluate( &self, buffer: &CStr, filename: &CStr, ) -> Result<(), ScriptError>
Evaluates a script buffer with the given filename.
§Errors
Returns an error message if the script evaluation fails.
Sourcepub fn evaluate_file(&self, filename: &CStr) -> Result<(), ScriptError>
pub fn evaluate_file(&self, filename: &CStr) -> Result<(), ScriptError>
Sourcepub fn get_output(&self, index: c_int) -> Result<OutputNode, ScriptError>
pub fn get_output(&self, index: c_int) -> Result<OutputNode, ScriptError>
Gets the output node at the specified index.
§Errors
Returns a ScriptError if the output node could not be retrieved.
Sourcepub fn get_output_ex(
&self,
index: c_int,
flags: c_int,
) -> Result<OutputNode, ScriptError>
pub fn get_output_ex( &self, index: c_int, flags: c_int, ) -> Result<OutputNode, ScriptError>
Gets an output node, using a bitmask of ffi::VSScriptGetFlags.
Pass 0 to download GPU output or AllowGPUResident to preserve residency.
Release the returned node before this script.
§Errors
Returns a ScriptError if the output is unset or could not be retrieved.
Sourcepub fn get_output_alpha_ex(
&self,
index: c_int,
flags: c_int,
) -> Result<VideoNode, ScriptError>
pub fn get_output_alpha_ex( &self, index: c_int, flags: c_int, ) -> Result<VideoNode, ScriptError>
Gets an alpha output using a bitmask of ffi::VSScriptGetFlags.
Pass 0 to download GPU output or AllowGPUResident to preserve residency.
Release the returned node before this script.
§Errors
Returns a ScriptError if the alpha output is unset or unavailable.
Sourcepub fn get_available_outputs_ex(
&self,
flags: c_int,
) -> Result<Vec<c_int>, ScriptError>
pub fn get_available_outputs_ex( &self, flags: c_int, ) -> Result<Vec<c_int>, ScriptError>
Lists output indices using a bitmask of ffi::VSScriptGetFlags.
§Errors
Returns a ScriptError if output enumeration fails.
Sourcepub fn get_variable_ex(
&self,
name: &CStr,
dst: &mut Map,
flags: c_int,
) -> Result<(), ScriptError>
pub fn get_variable_ex( &self, name: &CStr, dst: &mut Map, flags: c_int, ) -> Result<(), ScriptError>
Copies a script variable into dst under its name.
flags is a bitmask of ffi::VSScriptGetFlags. With no flags GPU nodes
are downloaded and GPU frame variables are rejected. AllowGPUResident
preserves the residency of nodes and frames.
§Errors
Returns a ScriptError if the variable is missing or cannot be stored.