Skip to main content

ImageLinePattern

Trait ImageLinePattern 

Source
pub trait ImageLinePattern {
    // Required methods
    fn pattern_width(&self) -> i32;
    fn line_width(&self) -> i32;
    fn width(&self) -> f64;
    fn pixel(&self, p: &mut Rgba8, x: i32, y: i32);
}
Expand description

Trait for image-line patterns (both standard and pow2-optimized).

This abstracts over LineImagePattern and LineImagePatternPow2 so that RendererOutlineImage can work with either type.

Required Methods§

Source

fn pattern_width(&self) -> i32

Pattern width in subpixel coordinates (for repeating).

Source

fn line_width(&self) -> i32

Line width in subpixel coordinates (half-height of pattern).

Source

fn width(&self) -> f64

Width in floating-point (returns height, matching C++ behavior).

Source

fn pixel(&self, p: &mut Rgba8, x: i32, y: i32)

Get a pixel from the pattern at the given subpixel coordinates.

Implementors§