pixie/tests/benchmark_masks.nim
Ryan Oldenburg f2b3c67d4b morepretty
2021-02-16 00:35:36 -06:00

38 lines
415 B
Nim

import benchy, chroma, pixie
let mask = newMask(2560, 1440)
proc reset() =
mask.fill(63)
reset()
timeIt "minifyBy2":
let minified = mask.minifyBy2()
doAssert minified[0, 0] == 63
reset()
timeIt "invert":
mask.invert()
reset()
timeIt "applyOpacity":
mask.applyOpacity(0.5)
reset()
timeIt "blur":
mask.blur(40)
reset()
timeIt "ceil":
mask.ceil()
reset()
timeIt "spread":
mask.spread(10)