Png.png.inflate: def of gralha-png-decode@0.1.0.1 Import: import gralha-png-decode@0.1.0.1/png.bend as Png Lines 181-187 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=181&end_line=187 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 import gralha-image@0.1.0.1/image.bend as Img def png.inflate(result: Maybe<&2, Bin.Bytes>, +info: PNGInfo, passes: List<&2, PNGPass>) -> Img.Picture: match result: case None{}: Img.Picture{0, 0, 0n, Img.Flat{Img.clear()}} case Some{raw}: PNGInfo{w, h, depth, kind, interlace, palette, alpha, compressed, valid} = info +dd = Img.picture.depth(U.choose(U32, U32.is_gt(w, h), w, h), 1, 0n) png.raster(png.decode.passes(passes, info, raw, U.choose(U32, U32.is_lt(depth, 8), 1, (png.channels(kind) * depth / 8 : U32)), dd, Img.Flat{Img.clear()}), w, h, dd) Uses (18): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.div 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.is_lt 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 https://jend.leeeet.dev/definition.txt?path=gralha-image@0.1.0.1/image.bend&name=Picture https://jend.leeeet.dev/definition.txt?path=gralha-image@0.1.0.1/image.bend&name=Pixels https://jend.leeeet.dev/definition.txt?path=gralha-image@0.1.0.1/image.bend&name=clear https://jend.leeeet.dev/definition.txt?path=gralha-image@0.1.0.1/image.bend&name=picture.depth 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-png-decode@0.1.0.1/png.bend&name=PNGPass https://jend.leeeet.dev/definition.txt?path=gralha-png-decode@0.1.0.1/png.bend&name=png.channels https://jend.leeeet.dev/definition.txt?path=gralha-png-decode@0.1.0.1/png.bend&name=png.decode.passes https://jend.leeeet.dev/definition.txt?path=gralha-png-decode@0.1.0.1/png.bend&name=png.raster https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose