Skip to main content

DisplayElement

Enum DisplayElement 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Fill

Fill a path.

Fields

§path: PsPath
§params: FillParams
§

Stroke

Stroke a path.

Fields

§path: PsPath
§

Clip

Intersect the clip region with a path.

Fields

§path: PsPath
§params: ClipParams
§

InitClip

Reset clipping to the full page.

§

Image

Draw an image (raw sample data in native color space).

Fields

§sample_data: Arc<Vec<u8>>
§

ErasePage

Erase the page (fill with white).

§

AxialShading

Axial (linear) gradient shading.

Fields

§

RadialShading

Radial gradient shading.

Fields

§

MeshShading

Gouraud-shaded triangle mesh.

Fields

§

PatchShading

Coons/tensor-product patch mesh.

Fields

§

PatternFill

Tiled pattern fill.

Fields

§

Text

Text element from show operators (used by PDF device, ignored by rasterizer).

Fields

§params: TextParams
§

Group

Transparency group: render children offscreen, composite with blend mode + alpha.

Fields

§elements: DisplayList
§

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: DisplayList
§visibility: OcgVisibility

Visibility 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

§content: DisplayList
§mask_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

Source§

fn clone(&self) -> DisplayElement

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.