def jpeg.components.max

gralha-jpeg-decode@0.1.0.1 · jpeg.bend:195

import gralha-jpeg-decode@0.1.0.1/jpeg.bend as Jpeg
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U

195def jpeg.components.max(xs: List<&2, JPEGComponent>, +vertical: Bool, +acc: U32) -> U32:
196  match xs:
197    case Nil{}: acc
198    case Con{JPEGComponent{id, h, v, quant, dc, ac, predictor, bw, bh, coefficients, samples}, rest}:
199      +val = U.choose(U32, vertical, v, h)
200      jpeg.components.max(rest, vertical, U.choose(U32, U32.is_gt(val, acc), val, acc))

Uses (6)

Used by (1)