#[non_exhaustive]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,
visibility: OcgVisibility,
},
SoftMasked {
mask: DisplayList,
content: DisplayList,
params: SoftMaskParams,
mask_cache: Arc<Mutex<Option<Option<MaskRaster>>>>,
},
}Expand description
A single recorded drawing operation.
Marked #[non_exhaustive] so additional element kinds can land
without breaking third-party renderers; consumers must include a
wildcard arm in their match expressions. See
docs/DISPLAY-LIST.md (“Stability”) for the policy.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
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 OcgVisibility evaluates to true under the active
LayerSet (consult stet-pdf-reader’s LayerSet::evaluate).
default_visible on each variant is the fallback used when the
renderer has no LayerSet opinion for the relevant OCGs.
Fields
elements: DisplayListvisibility: OcgVisibilityVisibility predicate: a single OCG, an OCMD membership policy, or a /VE expression.
SoftMasked
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more