def png.depth.valid

gralha-png-decode@0.1.0.1 · png.bend:50

import gralha-png-decode@0.1.0.1/png.bend as Png
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U

50def png.depth.valid(+kind: U32, +depth: U32) -> Bool:
51  +small = U32.is_eq(depth, 1) || U32.is_eq(depth, 2) || U32.is_eq(depth, 4) || U32.is_eq(depth, 8)
52  U.choose(Bool, U32.is_eq(kind, 0), small || U32.is_eq(depth, 16), U.choose(Bool, U32.is_eq(kind, 3), small, (U32.is_eq(kind, 2) || U32.is_eq(kind, 4) || U32.is_eq(kind, 6)) && (U32.is_eq(depth, 8) || U32.is_eq(depth, 16))))

Uses (6)

Used by (1)