2021-02-14 18:27:32 +00:00
|
|
|
import benchy, chroma, pixie
|
2021-02-08 22:34:05 +00:00
|
|
|
|
|
|
|
let mask = newMask(2560, 1440)
|
|
|
|
|
|
|
|
proc reset() =
|
|
|
|
mask.fill(63)
|
|
|
|
|
|
|
|
reset()
|
|
|
|
|
|
|
|
timeIt "minifyBy2":
|
|
|
|
let minified = mask.minifyBy2()
|
|
|
|
doAssert minified[0, 0] == 63
|
|
|
|
|
|
|
|
reset()
|
2021-02-08 23:26:48 +00:00
|
|
|
|
2021-02-09 04:26:51 +00:00
|
|
|
timeIt "invert":
|
|
|
|
mask.invert()
|
|
|
|
|
|
|
|
reset()
|
|
|
|
|
2021-02-08 23:26:48 +00:00
|
|
|
timeIt "applyOpacity":
|
|
|
|
mask.applyOpacity(0.5)
|
2021-02-10 03:13:23 +00:00
|
|
|
|
|
|
|
reset()
|
|
|
|
|
|
|
|
timeIt "blur":
|
|
|
|
mask.blur(40)
|
2021-02-11 08:38:27 +00:00
|
|
|
|
|
|
|
reset()
|
|
|
|
|
2021-02-11 19:13:09 +00:00
|
|
|
timeIt "ceil":
|
|
|
|
mask.ceil()
|
2021-02-11 21:05:34 +00:00
|
|
|
|
|
|
|
reset()
|
|
|
|
|
2021-06-19 20:06:50 +00:00
|
|
|
block spread_1:
|
|
|
|
var p: Path
|
|
|
|
p.rect(500, 500, 500, 500)
|
|
|
|
|
|
|
|
timeIt "spread_1":
|
|
|
|
mask.fill(0)
|
|
|
|
mask.fillPath(p)
|
|
|
|
mask.spread(10)
|
|
|
|
|
|
|
|
block spread_2:
|
|
|
|
var p: Path
|
|
|
|
p.rect(500, 500, 1000, 1000)
|
|
|
|
|
|
|
|
timeIt "spread_2":
|
|
|
|
mask.fill(0)
|
|
|
|
mask.fillPath(p)
|
|
|
|
mask.spread(10)
|
|
|
|
|
|
|
|
block spread_3:
|
|
|
|
timeIt "spread_3":
|
|
|
|
mask.fill(255)
|
|
|
|
mask.spread(10)
|
|
|
|
|
|
|
|
block spread_4:
|
|
|
|
timeIt "spread_4":
|
|
|
|
mask.fill(0)
|
|
|
|
mask.setValueUnsafe(1000, 1000, 255)
|
|
|
|
mask.spread(10)
|