Skip to main content

Module blend

Module blend 

Source
Expand description

Pixel arithmetic.

Everything here is integer. There is no f32 in the rasteriser at all, which buys three things: no libm dependency in a no_std build, no FPU traffic on targets where that is expensive, and — most usefully — output that is bit-identical on x86 and ARM, so a golden-image test is a meaningful test.

Structs§

Paint
A colour prepared for drawing.

Functions§

blend_pixel
Composites a paint over a single pixel at coverage (0..=255).
blend_span
Composites a constant paint over a span.
fill_span
Overwrites a span with an opaque word.
premultiply
Premultiplies straight-alpha 0xAARRGGBB words in place.
scale_premul
Scales a premultiplied 0xAARRGGBB word — alpha lane included — by a coverage of 0..=255.
source_over
Composites a premultiplied source over a destination pixel.