def mask.build

gralha-coverage@0.1.0.1 · cover.bend:1165

import gralha-coverage@0.1.0.1/cover.bend as Cover
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U

1165def mask.build(xs: List<&2, CovLine>, +gx: U32, +gy: U32, +w: U32, +h: U32, +even: Bool, +sub: U32, +trees: Bool) -> CovMask:
1166  +side = U.choose(U32, U32.is_gt(w, h), w, h)
1167  +depth = depth.for(side, 1, 0n)
1168  +size = U32.shln(1, depth)
1169  CovMask{gx, gy, w, h, size, depth, mask.data(trees, mask.scan(lines.prepare(xs, U32.to_f32(gx), U32.to_f32(gy), U32.to_f32(w), ({Nil{} : List<&2, CovLine>}, 0)), even, h, sub, w), size, depth), True{}}

Uses (14)

Used by (1)