f
This commit is contained in:
parent
f7a4bdcba7
commit
c0b74fbc73
2 changed files with 5 additions and 5 deletions
|
@ -95,7 +95,7 @@ proc setColor*(image: Image, x, y: int, color: Color) {.inline, raises: [].} =
|
||||||
proc fillUnsafe*(
|
proc fillUnsafe*(
|
||||||
data: var seq[ColorRGBX], color: SomeColor, start, len: int
|
data: var seq[ColorRGBX], color: SomeColor, start, len: int
|
||||||
) {.raises: [].} =
|
) {.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.
|
## continuing for len indices.
|
||||||
|
|
||||||
let rgbx = color.asRgbx()
|
let rgbx = color.asRgbx()
|
||||||
|
@ -126,7 +126,7 @@ proc fillUnsafe*(
|
||||||
data[j] = rgbx
|
data[j] = rgbx
|
||||||
|
|
||||||
proc fill*(image: Image, color: SomeColor) {.inline, raises: [].} =
|
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)
|
fillUnsafe(image.data, color, 0, image.data.len)
|
||||||
|
|
||||||
proc isOneColor*(image: Image): bool {.raises: [].} =
|
proc isOneColor*(image: Image): bool {.raises: [].} =
|
||||||
|
@ -565,7 +565,7 @@ proc blur*(
|
||||||
image.setRgbaUnsafe(x, y, rgbx(values))
|
image.setRgbaUnsafe(x, y, rgbx(values))
|
||||||
|
|
||||||
proc newMask*(image: Image): Mask {.raises: [PixieError].} =
|
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)
|
result = newMask(image.width, image.height)
|
||||||
|
|
||||||
var i: int
|
var i: int
|
||||||
|
|
|
@ -172,12 +172,12 @@ proc magnifyBy2*(mask: Mask, power = 1): Mask {.raises: [PixieError].} =
|
||||||
proc fillUnsafe*(
|
proc fillUnsafe*(
|
||||||
data: var seq[uint8], value: uint8, start, len: int
|
data: var seq[uint8], value: uint8, start, len: int
|
||||||
) {.raises: [].} =
|
) {.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.
|
## continuing for len indices.
|
||||||
nimSetMem(data[start].addr, value.cint, len)
|
nimSetMem(data[start].addr, value.cint, len)
|
||||||
|
|
||||||
proc fill*(mask: Mask, value: uint8) {.inline, raises: [].} =
|
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)
|
fillUnsafe(mask.data, value, 0, mask.data.len)
|
||||||
|
|
||||||
proc getValueSmooth*(mask: Mask, x, y: float32): uint8 {.raises: [].} =
|
proc getValueSmooth*(mask: Mask, x, y: float32): uint8 {.raises: [].} =
|
||||||
|
|
Loading…
Reference in a new issue