pub enum DisplayElement {
Show 15 variants
Fill {
path: PsPath,
params: FillParams,
},
Stroke {
path: PsPath,
params: StrokeParams,
},
Clip {
path: PsPath,
params: ClipParams,
},
InitClip,
Image {
sample_data: Arc<Vec<u8>>,
params: ImageParams,
},
ErasePage,
AxialShading {
params: AxialShadingParams,
},
RadialShading {
params: RadialShadingParams,
},
MeshShading {
params: MeshShadingParams,
},
PatchShading {
params: PatchShadingParams,
},
PatternFill {
params: PatternFillParams,
},
Text {
params: TextParams,
},
Group {
elements: DisplayList,
params: GroupParams,
},
OcgGroup {
elements: DisplayList,
ocg_id: u32,
default_visible: bool,
},
SoftMasked {
mask: DisplayList,
content: DisplayList,
params: SoftMaskParams,
mask_cache: Arc<Mutex<Option<Option<MaskRaster>>>>,
},
}Expand description
A single recorded drawing operation.
Variants§
Fill
Fill a path.
Stroke
Stroke a path.
Clip
Intersect the clip region with a path.
InitClip
Reset clipping to the full page.
Image
Draw an image (raw sample data in native color space).
ErasePage
Erase the page (fill with white).
AxialShading
Axial (linear) gradient shading.
Fields
params: AxialShadingParamsRadialShading
Radial gradient shading.
Fields
params: RadialShadingParamsMeshShading
Gouraud-shaded triangle mesh.
Fields
params: MeshShadingParamsPatchShading
Coons/tensor-product patch mesh.
Fields
params: PatchShadingParamsPatternFill
Tiled pattern fill.
Fields
params: PatternFillParamsText
Text element from show operators (used by PDF device, ignored by rasterizer).
Fields
params: TextParamsGroup
Transparency group: render children offscreen, composite with blend mode + alpha.
OcgGroup
PDF Optional Content Group (layer). Children are rendered only when
the layer is visible. Visibility defaults to default_visible and
can be overridden at render time via a set of hidden layer IDs.
Fields
elements: DisplayListSoftMasked
Soft-masked content: render mask form to grayscale, multiply with content alpha.
Fields
mask: DisplayListcontent: DisplayListparams: SoftMaskParamsmask_cache: Arc<Mutex<Option<Option<MaskRaster>>>>Render-time cache of the rasterized mask. None means “not
yet rasterized”. Some(None) means “rasterized and produced
no visible mask” — memoized so subsequent bands skip the
rasterization work. Some(Some(raster)) is the populated
raster; the renderer compares raster.scale_x/scale_y
against the current render scale and re-rasterizes if they
differ.
Wrapped in Arc<Mutex<...>> so cloned display lists (e.g. by
the egui viewer or the WASM viewport during zoom) share the
same cache cell, and so the cache can be replaced when the
scale changes.
Trait Implementations§
Source§impl Clone for DisplayElement
impl Clone for DisplayElement
Source§fn clone(&self) -> DisplayElement
fn clone(&self) -> DisplayElement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more