def jpeg.component.tables

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

import gralha-jpeg-decode@0.1.0.1/jpeg.bend as Jpeg
import Base
import gralha-bytes@0.1.0.1/bytes.bend as Bin

491def jpeg.component.tables(found: Maybe<&2, JPEGComponent>, spec: U32) -> JPEGComponent:
492  match found:
493    case None{}: JPEGComponent{255, 1, 1, 0, 4, 4, 0, 0, 0, Bin.bytes.empty(), Bin.bytes.empty()}
494    case Some{JPEGComponent{id, h, v, quant, dc, ac, predictor, bw, bh, coefficients, samples}}:
495      +tag = spec
496      JPEGComponent{id, h, v, quant, (tag / 16 : U32), (tag % 16 : U32), 0, bw, bh, coefficients, samples}

Uses (6)

Used by (1)