Png.png.paeth: def of gralha-png-decode@0.1.0.1 Import: import gralha-png-decode@0.1.0.1/png.bend as Png Lines 58-65 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=58&end_line=65 import Base import gralha-text-scan@0.1.0.1/scan.bend as U def png.paeth(+a: U32, +b: U32, +c: U32) -> U32: +aa = U32.to_f32(a) +bb = U32.to_f32(b) +cc = U32.to_f32(c) +pa = F32.abs((bb - cc : F32)) +pb = F32.abs((aa - cc : F32)) +pc = F32.abs((aa + bb - 2.0 * cc : F32)) U.choose(U32, F32.is_le(pa, pb) && F32.is_le(pa, pc), a, U.choose(U32, F32.is_le(pb, pc), b, c)) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.abs https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_f32 https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose