def soa.store.go

gralha-coverage@0.1.0.1 · cover.bend:754

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

754# Store each line at 4i and count its top row.
755def soa.store.go(xs: List<&2, CovLine>, a: Array<F32>, counts: Array<U32>, +i: U32, +h: U32) -> Array<F32> & Array<U32>:
756  match xs:
757    case Nil{}: (a, counts)
758    case Con{CovLine{x0, y0, x1, y1}, rest}:
759      +ay = y0
760      +by = y1
761      +base = (i * 4 : U32)
762      soa.store.go(rest, Array.set(F32, Array.set(F32, Array.set(F32, Array.set(F32, a, base, x0), (base + 1 : U32), ay), (base + 2 : U32), x1), (base + 3 : U32), by),
763        counts.inc(counts, row.of(U.min(ay, by), h)), (i + 1 : U32), h)

Uses (13)

Used by (1)