pub trait Pattern: Send + Sync {
// Required method
fn fill_span(&self, y: i32, x0: i32, x1: i32, out: &mut [u8]);
// Provided method
fn is_static_color(&self) -> bool { ... }
}Expand description
A source of per-pixel colour for use with the compositing pipeline.
Implementors return raw device-space byte sequences into the provided buffer.
The buffer length is (x1 - x0 + 1) * ncomps where ncomps is the pixel size
for the target bitmap mode.
Required Methods§
Provided Methods§
Sourcefn is_static_color(&self) -> bool
fn is_static_color(&self) -> bool
Return true if this pattern yields the same colour at every coordinate.
When true, fill_span will be called once and the result reused across
the whole span (optimisation hint only — correctness is not affected).