Skip to main content

PatternFilter

Trait PatternFilter 

Source
pub trait PatternFilter {
    // Required methods
    fn dilation() -> u32;
    fn pixel_low_res(buf: &[Vec<Rgba8>], x: i32, y: i32) -> Rgba8;
    fn pixel_high_res(buf: &[Vec<Rgba8>], p: &mut Rgba8, x: i32, y: i32);
}
Expand description

Trait for pattern pixel access.

The buffer is a 2D grid stored as &[Vec<Rgba8>] where each inner Vec is one row of pixels. This maps to the C++ row_ptr_cache pattern.

Required Methods§

Source

fn dilation() -> u32

Number of extra pixels needed on each side of the pattern.

Source

fn pixel_low_res(buf: &[Vec<Rgba8>], x: i32, y: i32) -> Rgba8

Get pixel at integer coordinates.

Source

fn pixel_high_res(buf: &[Vec<Rgba8>], p: &mut Rgba8, x: i32, y: i32)

Get pixel at subpixel coordinates (shifted by LINE_SUBPIXEL_SHIFT). Writes the result into p.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§