pub struct MaskRaster {
pub data: Vec<u8>,
pub width: u32,
pub height: u32,
pub origin_x: i32,
pub origin_y: i32,
pub scale_x: f32,
pub scale_y: f32,
}Expand description
A pre-rasterized soft mask, cached on the display-list SoftMasked
element so the renderer can build it once at gs-time CTM and sample it
per content pixel without re-rasterizing for every band.
The renderer holds the mask raster in its own device-space pixel
coordinate system (anchored at (origin_x, origin_y)) rather than the
SoftMasked.params.bbox viewport, because the mask form’s internal
cm operators may translate the actual paint elements outside the
form’s /BBox after the gs-time CTM is applied. Sampling per content
pixel by device coordinates decouples the mask and content coordinate
systems entirely.
Fields§
§data: Vec<u8>Single-channel mask values (luminosity or alpha), row-major.
width: u32Width of the raster in pixels.
height: u32Height of the raster in pixels.
origin_x: i32Top-left corner of the raster in device-space pixels at scale.
origin_y: i32Top-left corner of the raster in device-space pixels at scale.
scale_x: f32Horizontal scale at which the raster was built. The CLI egui viewer and the WASM viewport both re-render the same captured display list at varying zoom scales, so the cache must invalidate when this changes.
scale_y: f32Vertical scale at which the raster was built.
Trait Implementations§
Source§impl Clone for MaskRaster
impl Clone for MaskRaster
Source§fn clone(&self) -> MaskRaster
fn clone(&self) -> MaskRaster
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more