This commit is contained in:
Ryan Oldenburg 2022-06-29 00:34:47 -05:00
parent e56ad9e403
commit cf81556100
2 changed files with 3 additions and 3 deletions

View file

@ -418,8 +418,8 @@ proc applyOpacity*(target: Image | Mask, opacity: float32) {.raises: [].} =
proc invert*(image: Image) {.raises: [].} =
## Inverts all of the colors and alpha.
when allowSimd and compiles(invertSimd):
invertSimd(
when allowSimd and compiles(invertImageSimd):
invertImageSimd(
cast[ptr UncheckedArray[ColorRGBX]](image.data[0].addr),
image.data.len
)

View file

@ -231,7 +231,7 @@ when defined(amd64):
for i in i ..< len:
dst[i] = src[i].a
proc invertSimd*(data: ptr UncheckedArray[ColorRGBX], len: int) =
proc invertImageSimd*(data: ptr UncheckedArray[ColorRGBX], len: int) =
var i: int
let vec255 = mm_set1_epi8(cast[int8](255))
for _ in 0 ..< len div 16: