pub struct PipeState<'bmp> {
pub blend_mode: BlendMode,
pub a_input: u8,
pub overprint_mask: u32,
pub overprint_additive: bool,
pub transfer: TransferSet<'bmp>,
pub soft_mask: Option<&'bmp [u8]>,
pub alpha0: Option<&'bmp [u8]>,
pub knockout: bool,
pub knockout_opacity: u8,
pub non_isolated_group: bool,
}Expand description
Immutable parameters for one paint operation, built once per fill/stroke/glyph call.
'bmp borrows slices out of the destination bitmap’s alpha plane and the
current graphics state’s transfer tables.
Fields§
§blend_mode: BlendModeCompositing blend mode.
a_input: u8Source opacity, pre-scaled: state.fill_alpha * 255.0 rounded to u8.
For stroke operations the caller passes stroke_alpha * 255.0.
overprint_mask: u32Overprint mask: bit k set means channel k is painted.
0xFFFF_FFFF means all channels are painted (the default).
overprint_additive: boolIf true, overprinted channels are additively blended (ink accumulation)
rather than replaced. Corresponds to state.overprint_additive.
transfer: TransferSet<'bmp>Transfer function tables for the current pixel mode, borrowed from
GraphicsState. Applied to the composited result before writing.
soft_mask: Option<&'bmp [u8]>Soft mask alpha plane for the current transparency group, if any.
One byte per bitmap pixel; shares the bitmap’s row stride.
When Some, a_input is multiplied by the soft mask value per pixel.
alpha0: Option<&'bmp [u8]>Group alpha0 plane (non-isolated transparency group).
One byte per bitmap pixel; None for isolated groups and normal painting.
knockout: booltrue if this is a knockout group: later objects replace earlier objects
within the group rather than compositing on top of them.
knockout_opacity: u8For knockout compositing: the accumulated group opacity threshold.
non_isolated_group: booltrue if we are inside a non-isolated group.
Implementations§
Source§impl PipeState<'_>
impl PipeState<'_>
Sourcepub const fn no_transparency(&self, uses_shape: bool) -> bool
pub const fn no_transparency(&self, uses_shape: bool) -> bool
Returns true when the simple (no-transparency) fast path is applicable.
Matches C++ pipe->noTransparency:
a_input == 255 && no soft_mask && no shape && !in_non_isolated_group && !in_knockout_group
Overprint must be excluded: the simple path overwrites dst_pixels before
reading the original destination, making channel-selective restore impossible.
Sourcepub fn use_aa_path(&self) -> bool
pub fn use_aa_path(&self) -> bool
Returns true when the AA (shape-only) fast path is applicable.
Matches C++ pipeRunAA* selection condition:
no pattern, not noTransparency, no soft_mask, usesShape,
no alpha0, BlendMode::Normal, not non_isolated_group.