Jpeg.jpeg.progressive.walk: def of gralha-jpeg-decode@0.1.0.1 Import: import gralha-jpeg-decode@0.1.0.1/jpeg.bend as Jpeg Lines 313-322 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=313&end_line=322 import Base import gralha-text-scan@0.1.0.1/scan.bend as U import gralha-bytes@0.1.0.1/bytes.bend as Bin def jpeg.progressive.walk(+index: U32, +end: U32, +run: U32, +fresh: U32, +offset: U32, +p1: U32, +block: JPEGBlock) -> JPEGRefined: JPEGBlock{stream, coefficients, predictor} = block +at = (offset + jpeg.zigzag(index) : U32) +nonzero = Bool.not(U32.is_eq(Bin.bytes.get(coefficients, at), 0)) +done = U32.is_gt(index, end) || (U32.is_eq(run, 0) && U32.is_eq(fresh, 0)) || Bool.not(jpeg.stream.valid(stream)) U.branch(JPEGRefined, done, _ => JPEGRefined{index, U.choose(JPEGBlock, U32.is_gt(index, end) && Bool.not(U32.is_eq(fresh, 0)), jpeg.block.invalid(block), block)}, _ => U.branch(JPEGRefined, nonzero, _ => jpeg.progressive.walk(U32.inc(index), end, run, fresh, offset, p1, jpeg.progressive.refine.bit(jpeg.bits(stream, 1), coefficients, predictor, at, p1)), _ => U.branch(JPEGRefined, U32.is_gt(run, 0), _ => jpeg.progressive.walk(U32.inc(index), end, (run - 1 : U32), fresh, offset, p1, block), _ => JPEGRefined{U32.inc(index), JPEGBlock{stream, Bin.bytes.set(coefficients, at, fresh), predictor}}))) Uses (20): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.inc https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_gt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.get https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.set https://jend.leeeet.dev/definition.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&name=JPEGBlock https://jend.leeeet.dev/definition.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&name=JPEGRefined https://jend.leeeet.dev/definition.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&name=jpeg.bits https://jend.leeeet.dev/definition.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&name=jpeg.block.invalid https://jend.leeeet.dev/definition.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&name=jpeg.progressive.refine.bit https://jend.leeeet.dev/definition.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&name=jpeg.stream.valid https://jend.leeeet.dev/definition.txt?path=gralha-jpeg-decode@0.1.0.1/jpeg.bend&name=jpeg.zigzag https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=branch https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose