pub struct SoftMask<'a> { /* private fields */ }Expand description
Writer for a soft mask dictionary.
This struct is created by ExtGraphicsState::soft_mask.
Implementations§
Source§impl SoftMask<'_>
impl SoftMask<'_>
Sourcepub fn subtype(&mut self, subtype: MaskType) -> &mut Self
pub fn subtype(&mut self, subtype: MaskType) -> &mut Self
Write the S attribute to set the soft mask subtype. Required.
Sourcepub fn group(&mut self, group: Ref) -> &mut Self
pub fn group(&mut self, group: Ref) -> &mut Self
Write the G attribute to set the transparency group XObject. The group
has to have a color space set in the /CS attribute if the mask subtype
is Luminosity. Required.
Sourcepub fn backdrop(&mut self, color: impl IntoIterator<Item = f32>) -> &mut Self
pub fn backdrop(&mut self, color: impl IntoIterator<Item = f32>) -> &mut Self
Write the BC attribute to set the background color for the
transparency group. Only applicable if the mask subtype is Luminosity.
Has to be set in the group’s color space.
Sourcepub fn transfer_function(&mut self, function: Ref) -> &mut Self
pub fn transfer_function(&mut self, function: Ref) -> &mut Self
Write the TR attribute, a function that maps from the group’s output
values to the mask opacity.
Methods from Deref<Target = Dict<'a>>§
Sourcepub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
pub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
Start writing a pair with an arbitrary value.
Sourcepub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self
pub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self
Write a pair with a primitive value.
This is a shorthand for dict.insert(key).primitive(value).
Sourcepub fn pairs<'n, T: Primitive>(
&mut self,
pairs: impl IntoIterator<Item = (Name<'n>, T)>,
) -> &mut Self
pub fn pairs<'n, T: Primitive>( &mut self, pairs: impl IntoIterator<Item = (Name<'n>, T)>, ) -> &mut Self
Write a sequence of pairs with primitive values.