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-12-13 20:56:48 +00:00
|
|
|
timeIt "magnifyBy2":
|
|
|
|
let magnified = mask.magnifyBy2()
|
|
|
|
doAssert magnified[0, 0] == 63
|
|
|
|
|
|
|
|
reset()
|
|
|
|
|
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:
|
2021-10-03 22:49:21 +00:00
|
|
|
let p = newPath()
|
2021-06-19 20:06:50 +00:00
|
|
|
p.rect(500, 500, 500, 500)
|
|
|
|
|
|
|
|
timeIt "spread_1":
|
|
|
|
mask.fill(0)
|
|
|
|
mask.fillPath(p)
|
|
|
|
mask.spread(10)
|
|
|
|
|
|
|
|
block spread_2:
|
2021-10-03 22:49:21 +00:00
|
|
|
let p = newPath()
|
2021-06-19 20:06:50 +00:00
|
|
|
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)
|
2021-12-12 19:47:43 +00:00
|
|
|
mask.unsafe[1000, 1000] = 255
|
2021-06-19 20:06:50 +00:00
|
|
|
mask.spread(10)
|