Skip to main content

render_span

Function render_span 

Source
pub fn render_span<P: Pixel>(
    pipe: &PipeState<'_>,
    src: &PipeSrc<'_>,
    dst_pixels: &mut [u8],
    dst_alpha: Option<&mut [u8]>,
    shape: Option<&[u8]>,
    x0: i32,
    x1: i32,
    y: i32,
)
Expand description

Select and run the appropriate pipeline variant for a horizontal span.

  • pipe: compositing parameters for this paint operation.
  • src: source colour (solid or pattern).
  • dst_pixels: raw pixel bytes for the destination row, starting at x0.
  • dst_alpha: alpha plane bytes for the destination row, starting at x0. None means the destination has no separate alpha (Mono1, or solid-color bitmaps without transparency).
  • soft_mask_row: per-pixel soft-mask byte for this row, starting at x0.
  • alpha0_row: per-pixel alpha0 byte for this row, starting at x0.
  • shape: per-pixel AA shape byte, or None for the simple path.
  • screen: optional halftone screen for Mono1 dithering.
  • x0, x1: inclusive pixel coordinate range within the row.
  • y: scanline y coordinate (used by pattern and halftone screen).
  • ncomps: bytes per pixel (must match P::BYTES).

§Panics

Panics in debug mode if x0 > x1 or P::BYTES == 0 (Mono1 must be handled by the caller). Also panics if dst_pixels.len() does not equal (x1 - x0 + 1) * P::BYTES.