pub struct SoftMask {
pub group: Stream,
pub kind: SoftMaskKind,
pub backdrop: Rgb,
pub transfer: Option<Box<[u8; 256]>>,
pub matrix: Affine,
pub objects: Vec<PageObject>,
}Expand description
A soft mask from an /ExtGState’s /SMask.
Fields§
§group: StreamThe group whose rendering becomes the mask.
kind: SoftMaskKindWhich channel to read.
backdrop: RgbThe backdrop the group composites against, in luminosity mode. Opaque black by default.
transfer: Option<Box<[u8; 256]>>The transfer applied to each mask value, when /TR supplied one.
matrix: AffineThe transformation in force when the /ExtGState was applied, which
is what places the mask.
objects: Vec<PageObject>The group’s own page objects, interpreted from group.
A soft mask’s /G is a form XObject like any other, and what it paints
is what the mask is: a luminosity mask reads the group’s rendered
luminance, an alpha mask its coverage. Left empty the mask is the /BC
backdrop alone — exact for a backdrop-only mask and wrong for every
other, which is how it silently blanked or revealed whole objects.
Filled in by the interpreter, which is the only layer with a resolver;
load leaves it empty.
Implementations§
Source§impl SoftMask
impl SoftMask
Sourcepub fn load<R: Resolve>(
value: &Object,
matrix: Affine,
r: &R,
functions: &mut FunctionCache,
limits: &Limits,
diags: &mut Diagnostics,
) -> Option<Self>
pub fn load<R: Resolve>( value: &Object, matrix: Affine, r: &R, functions: &mut FunctionCache, limits: &Limits, diags: &mut Diagnostics, ) -> Option<Self>
Read a /SMask dictionary.
Returns None — meaning no mask — when the value is not a dictionary
at all, which is how /SMask /None reaches the correct answer, and
when /G is not a stream.
Sourcepub fn apply_transfer(&self, value: u8) -> u8
pub fn apply_transfer(&self, value: u8) -> u8
The mask value for one luminosity or alpha byte.