Skip to main content

Module layer_set

Module layer_set 

Source
Expand description

Per-render OCG visibility overrides.

LayerSet is the renderer-side contract for “which OCGs are currently on”. The display list carries every OcgGroup’s per-variant default_visible fallback baked from the document’s default configuration, but a consumer building a layer panel needs to flip a layer on or off without re-parsing the PDF or rebuilding its display list.

The flow:

  1. The PDF reader (or any other producer) builds a display list whose crate::display_list::DisplayElement::OcgGroup elements each carry an crate::display_list::OcgVisibility predicate.
  2. The consumer constructs a LayerSet — empty (every OCG falls back to its default_visible) or populated from a particular PDF configuration.
  3. Mutate it as needed, e.g. via LayerSet::set.
  4. Pass it into the renderer; rendering calls LayerSet::evaluate for each OcgGroup.

Higher-level constructors that build a LayerSet from a parsed document live in stet-pdf-reader’s layers module.

Structs§

LayerSet
Per-render override of OCG visibility.