Skip to main content

EffectPlugin

Trait EffectPlugin 

Source
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§

Source

fn name(&self) -> &str

Get plugin name

Source

fn version(&self) -> &str

Get plugin version

Source

fn apply_cpu( &self, pixels: &mut [u8], width: u32, height: u32, params: &EffectParams, ) -> Result<(), RenderError>

Apply effect to pixel data

Provided Methods§

Source

fn shader_code(&self) -> Option<&str>

Get shader code for GPU backends

Source

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".

Implementors§