Skip to main content

FilterEffect

Trait FilterEffect 

Source
pub(crate) trait FilterEffect {
    // Required methods
    fn execute_lowp(
        &self,
        pixmap: &mut Pixmap,
        filter_scratch: &mut ScratchBuffer,
    );
    fn execute_highp(
        &self,
        pixmap: &mut Pixmap,
        filter_scratch: &mut ScratchBuffer,
    );
}
Expand description

Trait for filter effects that can be applied to layers.

Each filter implements this trait with both u8 and f32 variants to support different rendering backends and precision requirements. The low-precision path (execute_lowp) uses 8-bit color channels for better performance, while the high-precision path (execute_highp) uses 32-bit floating-point for higher quality at the cost of speed.

Required Methods§

Source

fn execute_lowp(&self, pixmap: &mut Pixmap, filter_scratch: &mut ScratchBuffer)

Apply the low-precision (u8) version of the filter.

§Arguments
  • pixmap - The target pixmap containing rendering metadata
  • filter_scratch - Reusable scratch storage for intermediate buffers
Source

fn execute_highp(&self, pixmap: &mut Pixmap, filter_scratch: &mut ScratchBuffer)

Apply the high-precision (f32) version of the filter.

§Arguments
  • pixmap - The target pixmap containing rendering metadata
  • filter_scratch - Reusable scratch storage for intermediate buffers

Implementations on Foreign Types§

Source§

impl FilterEffect for DropShadow

Source§

fn execute_lowp(&self, pixmap: &mut Pixmap, filter_scratch: &mut ScratchBuffer)

Source§

fn execute_highp(&self, pixmap: &mut Pixmap, filter_scratch: &mut ScratchBuffer)

Source§

impl FilterEffect for Flood

Source§

fn execute_lowp(&self, pixmap: &mut Pixmap, _filter_scratch: &mut ScratchBuffer)

Source§

fn execute_highp( &self, pixmap: &mut Pixmap, _filter_scratch: &mut ScratchBuffer, )

Source§

impl FilterEffect for GaussianBlur

Source§

fn execute_lowp(&self, pixmap: &mut Pixmap, filter_scratch: &mut ScratchBuffer)

Source§

fn execute_highp(&self, pixmap: &mut Pixmap, filter_scratch: &mut ScratchBuffer)

Source§

impl FilterEffect for Offset

Source§

fn execute_lowp(&self, pixmap: &mut Pixmap, _: &mut ScratchBuffer)

Source§

fn execute_highp(&self, pixmap: &mut Pixmap, _: &mut ScratchBuffer)

Implementors§