Expand description
Transparency group compositing — replaces Splash::beginTransparencyGroup,
Splash::endTransparencyGroup, and Splash::paintTransparencyGroup.
§PDF transparency model (§11.3–11.4)
A transparency group is an intermediate compositing surface. The caller:
- Calls
begin_groupto allocate a fresh group bitmap and push it onto the stack. All subsequent paint operations target that group. - Renders into the group normally (fill, stroke, image, shading, glyph calls on the group bitmap).
- Calls
paint_group(ordiscard_groupon error) to pop the group and composite it back into the underlying bitmap.
§Isolated vs. non-isolated groups
| Flag | Effect |
|---|---|
isolated = true | Group starts with a transparent background (alpha = 0). |
isolated = false | Group is pre-initialised with the backdrop’s colours. |
Knockout groups clear the accumulated alpha on each object; non-knockout groups accumulate.
§Soft masks
When soft_mask_type != SoftMaskType::None, the group is later used as a
luminosity or alpha soft mask rather than being composited directly. Call
extract_soft_mask on the finished GroupBitmap to obtain the mask bytes,
then store them in crate::GraphicsState::soft_mask after wrapping in AnyBitmap.
§C++ equivalents
Splash::beginTransparencyGroupSplash::endTransparencyGroupSplash::paintTransparencyGroup
Structs§
- Group
Bitmap - A group bitmap together with its compositing metadata.
- Group
Params - Parameters for one transparency group, collected before
begin_group.
Enums§
- Soft
Mask Type - Whether the group’s soft-mask channel is alpha-based or luminosity-based.
Functions§
- begin_
group - Open a new transparency group and return a group bitmap to render into.
- discard_
group - Discard a group without compositing it (used on error paths).
- extract_
soft_ mask - Convert a finished group bitmap into a single-channel soft mask.
- paint_
group - Composite a finished group back into the parent bitmap and return the saved clip.