pub trait EffectPlugin: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn version(&self) -> &str;
fn apply_cpu(
&self,
pixels: &mut [u8],
width: u32,
height: u32,
params: &EffectParams,
) -> Result<(), RenderError>;
// Provided methods
fn shader_code(&self) -> Option<&str> { ... }
fn supports_gpu(&self) -> bool { ... }
}Expand description
Effect plugin trait for custom effects
Required Methods§
Sourcefn apply_cpu(
&self,
pixels: &mut [u8],
width: u32,
height: u32,
params: &EffectParams,
) -> Result<(), RenderError>
fn apply_cpu( &self, pixels: &mut [u8], width: u32, height: u32, params: &EffectParams, ) -> Result<(), RenderError>
Apply effect to pixel data
Provided Methods§
Sourcefn shader_code(&self) -> Option<&str>
fn shader_code(&self) -> Option<&str>
Get shader code for GPU backends
Sourcefn supports_gpu(&self) -> bool
fn supports_gpu(&self) -> bool
Check if effect supports GPU acceleration
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".