sharpen -> ceil
This commit is contained in:
parent
7e06625c27
commit
b6b1d3a44c
4 changed files with 14 additions and 3 deletions
|
@ -135,7 +135,7 @@ proc spread*(mask: Mask, spread: float32) =
|
||||||
break blurBox
|
break blurBox
|
||||||
mask.setValueUnsafe(x, y, maxValue)
|
mask.setValueUnsafe(x, y, maxValue)
|
||||||
|
|
||||||
proc sharpen*(mask: Mask) =
|
proc ceil*(mask: Mask) =
|
||||||
## A value of 0 stays 0. Anything else turns into 255.
|
## A value of 0 stays 0. Anything else turns into 255.
|
||||||
var i: int
|
var i: int
|
||||||
when defined(amd64) and not defined(pixieNoSimd):
|
when defined(amd64) and not defined(pixieNoSimd):
|
||||||
|
|
|
@ -28,5 +28,5 @@ timeIt "blur":
|
||||||
|
|
||||||
reset()
|
reset()
|
||||||
|
|
||||||
timeIt "sharpen":
|
timeIt "ceil":
|
||||||
mask.sharpen()
|
mask.ceil()
|
||||||
|
|
BIN
tests/images/masks/circleMaskSharpened.png
Normal file
BIN
tests/images/masks/circleMaskSharpened.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 380 B |
|
@ -91,3 +91,14 @@ block:
|
||||||
a.spread(10)
|
a.spread(10)
|
||||||
|
|
||||||
writeFile("tests/images/masks/spread.png", a.encodePng())
|
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())
|
||||||
|
|
Loading…
Reference in a new issue