Png.png.chunk: def of gralha-png-decode@0.1.0.1 Import: import gralha-png-decode@0.1.0.1/png.bend as Png Lines 20-31 of gralha-png-decode@0.1.0.1/png.bend: https://jend.leeeet.dev/read.txt?path=gralha-png-decode@0.1.0.1/png.bend&start_line=20&end_line=31 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 png.chunk(info: PNGInfo, +name: U32, +src: Bin.Bytes, +at: U32, +count: U32) -> PNGInfo: PNGInfo{w, h, depth, kind, interlace, palette, alpha, compressed, valid} = info +pal = palette +trans = alpha +data = compressed PNGInfo{w, h, depth, kind, interlace, U.branch(Bin.Bytes, U32.is_eq(name, 1347179589), _ => Bin.bytes.slice(U32.to_nat(count), src, at, Bin.bytes.empty()), _ => pal), U.branch(Bin.Bytes, U32.is_eq(name, 1951551059), _ => Bin.bytes.slice(U32.to_nat(count), src, at, Bin.bytes.empty()), _ => trans), U.branch(Bin.Bytes, U32.is_eq(name, 1229209940), _ => Bin.bytes.slice(U32.to_nat(count), src, at, data), _ => data), valid && Bool.not(U32.is_eq(name, 1229472850)) && (U32.is_eq(name, 1347179589) || U32.is_eq(name, 1229209940) || U32.is_eq(U32.and(U32.shrn(name, 24n), 32), 32))} @unsafe Uses (13): 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.and 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.shrn https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.empty https://jend.leeeet.dev/definition.txt?path=gralha-bytes@0.1.0.1/bytes.bend&name=bytes.slice https://jend.leeeet.dev/definition.txt?path=gralha-png-decode@0.1.0.1/png.bend&name=PNGInfo https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=branch