no need for setmem
This commit is contained in:
parent
25cbf803cc
commit
e8da814856
1 changed files with 8 additions and 11 deletions
|
@ -70,9 +70,6 @@ proc `[]=`*(image: Image, x, y: int, rgba: ColorRGBA) {.inline.} =
|
||||||
|
|
||||||
proc fill*(image: Image, rgba: ColorRgba) =
|
proc fill*(image: Image, rgba: ColorRgba) =
|
||||||
## Fills the image with a solid color.
|
## Fills the image with a solid color.
|
||||||
if rgba.r == rgba.g and rgba.r == rgba.b and rgba.r == rgba.a:
|
|
||||||
nimSetMem(image.data[0].addr, rgba.r.cint, image.data.len * 4)
|
|
||||||
else:
|
|
||||||
# SIMD fill until we run out of room.
|
# SIMD fill until we run out of room.
|
||||||
let m = mm_set1_epi32(cast[int32](rgba))
|
let m = mm_set1_epi32(cast[int32](rgba))
|
||||||
var i: int
|
var i: int
|
||||||
|
|
Loading…
Reference in a new issue