pub struct ContentShading {
pub name: String,
pub shading_dict: Option<Dict>,
pub ctm: Transform2D,
pub clip: Option<Path>,
pub mesh: Option<MeshShading>,
pub gradient: Option<ShadingGradient>,
}Expand description
One name sh shading-paint event surfaced by
parse_content_stream_full_with_shading. ISO 32000-1 §8.7.4.5
defines sh as “paint the shape and colour shading described by
a shading dictionary, subject to the current clipping path”. This
surface captures every input that determines the painted region
and colour:
name— the shading-resource key the operator named (leading/stripped).shading_dict— the resolved shading dictionary from/Resources /Shading /<name>, orNonewhen the caller didn’t plumb inshading_resources(or when the name wasn’t a key in the supplied resources).ctm— the composed current transformation matrix at the moment of the paint (everycmin every enclosingqframe, composed root-to-leaf). All coordinates insideshading_dictare interpreted relative to this transform per §8.7.4.5 (“interpreted relative to the current user space”).clip— the most recentW/W*-committed clip path in the activeqframe, orNonewhen no clip is in force. The shading is subject to this region (§8.7.4.5 “subject to the current clipping path”).
Fields§
§name: StringShading-resource key the sh operator named, with the
leading / stripped (e.g. "Sh1"). Empty when the operator
was issued without a /Name operand (malformed but
tolerated, mirroring the round-128 Tj-without-Tf stance).
shading_dict: Option<Dict>Resolved shading dictionary from /Resources /Shading /<name>, or None when the caller didn’t plumb in
shading_resources (the legacy entry points) or when the
name wasn’t a key in the supplied resources.
ctm: Transform2DEffective CTM at the moment of the paint — composed of every
cm operator in every enclosing q frame, root-to-leaf.
clip: Option<Path>Active clip path from the current q frame’s most recent
W/W*. None when no clip is in force.
mesh: Option<MeshShading>Evaluated mesh geometry for a Type 4–7 shading (free-form /
lattice-form Gouraud triangle mesh, Coons patch mesh, or
tensor-product patch mesh, §8.7.4.5.5–8.7.4.5.8). None for an
axial / radial / function-based shading (Types 1–3, which carry
their colour in the Function entry rather than a mesh stream),
for a shading the caller didn’t plumb resources for, or for a
mesh whose stream / colour space / function couldn’t be reduced
to evaluated RGB vertices. Coordinates are in the shading’s
target coordinate space (pre-ctm); apply ctm to map them to
device space.
gradient: Option<ShadingGradient>Evaluated gradient geometry + sampled colour stops for a Type 1–3
shading (function-based / axial / radial, §8.7.4.5.2–4). None
for a Type 4–7 mesh shading (use mesh instead),
for a shading the caller didn’t plumb resources for, or for a
shading whose colour space / function couldn’t be evaluated.
Coordinates are in the shading’s target coordinate space
(pre-ctm).
Trait Implementations§
Source§impl Clone for ContentShading
impl Clone for ContentShading
Source§fn clone(&self) -> ContentShading
fn clone(&self) -> ContentShading
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more