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§
Sourcefn execute_lowp(&self, pixmap: &mut Pixmap, filter_scratch: &mut ScratchBuffer)
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 metadatafilter_scratch- Reusable scratch storage for intermediate buffers
Sourcefn execute_highp(&self, pixmap: &mut Pixmap, filter_scratch: &mut ScratchBuffer)
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 metadatafilter_scratch- Reusable scratch storage for intermediate buffers