This commit is contained in:
Ryan Oldenburg 2021-12-03 17:02:10 -06:00
parent f7a4bdcba7
commit c0b74fbc73
2 changed files with 5 additions and 5 deletions

View file

@ -95,7 +95,7 @@ proc setColor*(image: Image, x, y: int, color: Color) {.inline, raises: [].} =
proc fillUnsafe*(
data: var seq[ColorRGBX], color: SomeColor, start, len: int
) {.raises: [].} =
## Fills the image data with the parameter color starting at index start and
## Fills the image data with the color starting at index start and
## continuing for len indices.
let rgbx = color.asRgbx()
@ -126,7 +126,7 @@ proc fillUnsafe*(
data[j] = rgbx
proc fill*(image: Image, color: SomeColor) {.inline, raises: [].} =
## Fills the image with the parameter color.
## Fills the image with the color.
fillUnsafe(image.data, color, 0, image.data.len)
proc isOneColor*(image: Image): bool {.raises: [].} =
@ -565,7 +565,7 @@ proc blur*(
image.setRgbaUnsafe(x, y, rgbx(values))
proc newMask*(image: Image): Mask {.raises: [PixieError].} =
## Returns a new mask using the alpha values of the parameter image.
## Returns a new mask using the alpha values of the image.
result = newMask(image.width, image.height)
var i: int

View file

@ -172,12 +172,12 @@ proc magnifyBy2*(mask: Mask, power = 1): Mask {.raises: [PixieError].} =
proc fillUnsafe*(
data: var seq[uint8], value: uint8, start, len: int
) {.raises: [].} =
## Fills the mask data with the parameter value starting at index start and
## Fills the mask data with the value starting at index start and
## continuing for len indices.
nimSetMem(data[start].addr, value.cint, len)
proc fill*(mask: Mask, value: uint8) {.inline, raises: [].} =
## Fills the mask with the parameter value.
## Fills the mask with the value.
fillUnsafe(mask.data, value, 0, mask.data.len)
proc getValueSmooth*(mask: Mask, x, y: float32): uint8 {.raises: [].} =