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<'a> SoftMask<'a>
impl<'a> SoftMask<'a>
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.