Cover.mask.uniform.in: def of gralha-coverage@0.1.0.1 Import: import gralha-coverage@0.1.0.1/cover.bend as Cover Lines 141-149 of gralha-coverage@0.1.0.1/cover.bend: https://jend.leeeet.dev/read.txt?path=gralha-coverage@0.1.0.1/cover.bend&start_line=141&end_line=149 import Base import gralha-text-scan@0.1.0.1/scan.bend as U def mask.uniform.in(+m: CovMask, +x0: U32, +y0: U32, +x1: U32, +y1: U32) -> F32: CovMask{x, y, w, h, size, depth, data, present} = m +mx = x +my = y +sz = size +outside = U32.is_lt(x0, mx) || U32.is_lt(y0, my) || U32.is_gt(x1, (mx + sz : U32)) || U32.is_gt(y1, (my + sz : U32)) +inside = data.uniform(data, mx, my, sz, U.max.u32(x0, mx), U.max.u32(y0, my), U.min.u32(x1, (mx + sz : U32)), U.min.u32(y1, (my + sz : U32))) +v = U.choose(F32, F32.is_gt(inside, 1.5), 0.0, inside) U.choose(F32, outside && F32.is_gt(v, 0.0), F32.neg(1.0), v) Uses (14): 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.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.is_gt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.neg 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.is_gt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_lt https://jend.leeeet.dev/definition.txt?path=gralha-coverage@0.1.0.1/cover.bend&name=CovMask https://jend.leeeet.dev/definition.txt?path=gralha-coverage@0.1.0.1/cover.bend&name=data.uniform https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=max.u32 https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=min.u32