def pixel.color

gralha-svg-render@0.1.0.1 · svg.bend:3985

import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base
import gralha-image@0.1.0.1/image.bend as Img

3985# Every fill, stroke and clip carries its analytic coverage (see cover.scenes), so
3986# one sample at the pixel center reads exact area coverage; paint is evaluated there.
3987def pixel.color(+scene: List<&2, Scene<Brush>>, x: U32, y: U32, +aa: U32) -> Img.Color:
3988  +center = {Point{(U32.to_f32(x) + 0.5 : F32), (U32.to_f32(y) + 0.5 : F32)} : Point}
3989  sample(scene, center, center, Img.clear(), False{}, 1.0)

Uses (12)

Used by (1)