sharpen -> ceil

This commit is contained in:
Ryan Oldenburg 2021-02-11 13:13:09 -06:00
parent 7e06625c27
commit b6b1d3a44c
4 changed files with 14 additions and 3 deletions

View file

@ -135,7 +135,7 @@ proc spread*(mask: Mask, spread: float32) =
break blurBox
mask.setValueUnsafe(x, y, maxValue)
proc sharpen*(mask: Mask) =
proc ceil*(mask: Mask) =
## A value of 0 stays 0. Anything else turns into 255.
var i: int
when defined(amd64) and not defined(pixieNoSimd):

View file

@ -28,5 +28,5 @@ timeIt "blur":
reset()
timeIt "sharpen":
mask.sharpen()
timeIt "ceil":
mask.ceil()

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

View file

@ -91,3 +91,14 @@ block:
a.spread(10)
writeFile("tests/images/masks/spread.png", a.encodePng())
block:
let mask = newMask(100, 100)
var path: Path
path.ellipse(mask.width / 2, mask.height / 2, 25, 25)
mask.fillPath(path)
mask.ceil()
writeFile("tests/images/masks/circleMaskSharpened.png", mask.encodePng())