benchmark
This commit is contained in:
parent
aeb531aedb
commit
e16fcb595d
|
@ -209,7 +209,7 @@ proc minifyBy2*(image: Image, power = 1): Image =
|
|||
return image.copy()
|
||||
|
||||
var src = image
|
||||
for i in 1 .. power:
|
||||
for _ in 1 .. power:
|
||||
result = newImage(src.width div 2, src.height div 2)
|
||||
for y in 0 ..< result.height:
|
||||
for x in 0 ..< result.width:
|
||||
|
|
|
@ -33,6 +33,10 @@ timeIt "minifyBy2":
|
|||
let minified = image.minifyBy2()
|
||||
doAssert minified[0, 0] == rgba(63, 127, 191, 191)
|
||||
|
||||
timeIt "magnifyBy2":
|
||||
let minified = image.magnifyBy2()
|
||||
doAssert minified[0, 0] == rgba(63, 127, 191, 191)
|
||||
|
||||
reset()
|
||||
|
||||
timeIt "invert":
|
||||
|
|
Loading…
Reference in a new issue