Jpeg.jpeg.components.allocate: def of gralha-jpeg-decode@0.1.0.1 Import: import gralha-jpeg-decode@0.1.0.1/jpeg.bend as Jpeg Lines 220-226 of gralha-jpeg-decode@0.1.0.1/jpeg.bend: https://jend.leeeet.dev/read.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&start_line=220&end_line=226 import Base import gralha-bytes@0.1.0.1/bytes.bend as Bin def jpeg.components.allocate(xs: List<&2, JPEGComponent>, +cols: U32, +rows: U32) -> List<&2, JPEGComponent>: match xs: case Nil{}: Nil{} case Con{JPEGComponent{id, h, v, quant, dc, ac, predictor, bw, bh, coefficients, samples}, rest}: +hh = h +vv = v Con{JPEGComponent{id, hh, vv, quant, dc, ac, predictor, (cols * hh : U32), (rows * vv : U32), Bin.bytes.zero((cols * hh * rows * vv * 64 : U32)), Bin.bytes.zero(64)}, jpeg.components.allocate(rest, cols, rows)} Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.mul https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.zero https://jend.leeeet.dev/definition.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&name=JPEGComponent