pub enum OcgVisibility {
Single {
ocg_id: u32,
default_visible: bool,
},
Membership {
ocg_ids: Vec<u32>,
policy: MembershipPolicy,
default_visible: bool,
},
Expression {
expr: VisibilityExpr,
default_visible: bool,
},
}Expand description
Visibility predicate for an DisplayElement::OcgGroup.
Three forms exist in PDF:
Single— a/OC BDCblock whose property is a direct OCG ref, or a single-OCG OCMD. Most common case.Membership— an OCMD with a/Ppolicy (AllOn / AnyOn / AllOff / AnyOff) over multiple OCGs. PDF default policy isAnyOn.Expression— an OCMD with a/VEboolean expression (PDF 1.6+). Most expressive form.
The renderer evaluates the predicate against the active
LayerSet (in stet-pdf-reader); each variant’s
default_visible is the fallback when the LayerSet has no
opinion.
Variants§
Single
Visibility tied to a single OCG.
Membership
OCMD with a /P membership policy over a set of OCGs.
Expression
OCMD with a /VE visibility expression.
Implementations§
Source§impl OcgVisibility
impl OcgVisibility
Sourcepub fn single(ocg_id: u32, default_visible: bool) -> OcgVisibility
pub fn single(ocg_id: u32, default_visible: bool) -> OcgVisibility
Convenience constructor for the most common case.
Sourcepub fn default_visible(&self) -> bool
pub fn default_visible(&self) -> bool
The fallback visibility used when no LayerSet has an
opinion. Renderers that do not consult a LayerSet read this.
Trait Implementations§
Source§impl Clone for OcgVisibility
impl Clone for OcgVisibility
Source§fn clone(&self) -> OcgVisibility
fn clone(&self) -> OcgVisibility
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OcgVisibility
impl RefUnwindSafe for OcgVisibility
impl Send for OcgVisibility
impl Sync for OcgVisibility
impl Unpin for OcgVisibility
impl UnsafeUnpin for OcgVisibility
impl UnwindSafe for OcgVisibility
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more