This commit is contained in:
Ryan Oldenburg 2021-02-08 22:29:36 -06:00
parent 0fe613cf7f
commit 3e096792c0

View file

@ -476,9 +476,6 @@ proc draw*(
) {.inline.} =
mask.draw(image, translate(pos), blendMode)
when defined(release):
{.pop.}
proc gaussianLookup(radius: int): seq[float32] =
## Compute lookup table for 1d Gaussian kernel.
result.setLen(radius * 2 + 1)
@ -493,6 +490,9 @@ proc gaussianLookup(radius: int): seq[float32] =
for xb in -radius .. radius:
result[xb + radius] = result[xb + radius] / total
when defined(release):
{.pop.}
proc blur*(image: Image, radius: float32) =
## Applies Gaussian blur to the image given a radius.
let radius = round(radius).int