draw proc cleanup
This commit is contained in:
parent
54ee511a47
commit
f72fff8651
1 changed files with 27 additions and 27 deletions
|
@ -784,41 +784,41 @@ proc drawUber(a, b: Image | Mask, mat = mat3(), blendMode = bmNormal) =
|
||||||
if a.width - xMax > 0:
|
if a.width - xMax > 0:
|
||||||
zeroMem(a.data[a.dataIndex(xMax, y)].addr, 4 * (a.width - xMax))
|
zeroMem(a.data[a.dataIndex(xMax, y)].addr, 4 * (a.width - xMax))
|
||||||
|
|
||||||
proc draw*(a, b: Image, mat: Mat3, blendMode = bmNormal) {.inline.} =
|
proc draw*(
|
||||||
|
a, b: Image, transform: Vec2 | Mat3 = vec2(), blendMode = bmNormal
|
||||||
|
) {.inline.} =
|
||||||
## Draws one image onto another using matrix with color blending.
|
## Draws one image onto another using matrix with color blending.
|
||||||
a.drawUber(b, mat, blendMode)
|
when type(transform) is Vec2:
|
||||||
|
a.drawUber(b, translate(transform), blendMode)
|
||||||
proc draw*(a, b: Image, pos = vec2(0, 0), blendMode = bmNormal) {.inline.} =
|
else:
|
||||||
## Draws one image onto another using a position offset with color blending.
|
a.drawUber(b, transform, blendMode)
|
||||||
a.draw(b, translate(pos), blendMode)
|
|
||||||
|
|
||||||
proc draw*(image: Image, mask: Mask, mat: Mat3, blendMode = bmMask) {.inline.} =
|
|
||||||
## Draws a mask onto an image using a matrix with color blending.
|
|
||||||
image.drawUber(mask, mat, blendMode)
|
|
||||||
|
|
||||||
proc draw*(
|
proc draw*(
|
||||||
image: Image, mask: Mask, pos = vec2(0, 0), blendMode = bmMask
|
a, b: Mask, transform: Vec2 | Mat3 = vec2(), blendMode = bmMask
|
||||||
) {.inline.} =
|
) {.inline.} =
|
||||||
## Draws a mask onto an image using a position offset with color blending.
|
|
||||||
image.drawUber(mask, translate(pos), blendMode)
|
|
||||||
|
|
||||||
proc draw*(a, b: Mask, mat: Mat3, blendMode = bmMask) {.inline.} =
|
|
||||||
## Draws a mask onto a mask using a matrix with color blending.
|
## Draws a mask onto a mask using a matrix with color blending.
|
||||||
a.drawUber(b, mat, blendMode)
|
when type(transform) is Vec2:
|
||||||
|
a.drawUber(b, translate(transform), blendMode)
|
||||||
proc draw*(a, b: Mask, pos = vec2(0, 0), blendMode = bmMask) {.inline.} =
|
else:
|
||||||
## Draws a mask onto a mask using a position offset with color blending.
|
a.drawUber(b, transform, blendMode)
|
||||||
a.draw(b, translate(pos), blendMode)
|
|
||||||
|
|
||||||
proc draw*(mask: Mask, image: Image, mat: Mat3, blendMode = bmMask) {.inline.} =
|
|
||||||
## Draws a image onto a mask using a matrix with color blending.
|
|
||||||
mask.drawUber(image, mat, blendMode)
|
|
||||||
|
|
||||||
proc draw*(
|
proc draw*(
|
||||||
mask: Mask, image: Image, pos = vec2(0, 0), blendMode = bmMask
|
image: Image, mask: Mask, transform: Vec2 | Mat3 = vec2(), blendMode = bmMask
|
||||||
) {.inline.} =
|
) {.inline.} =
|
||||||
## Draws a image onto a mask using a position offset with color blending.
|
## Draws a mask onto an image using a matrix with color blending.
|
||||||
mask.draw(image, translate(pos), blendMode)
|
when type(transform) is Vec2:
|
||||||
|
image.drawUber(mask, translate(transform), blendMode)
|
||||||
|
else:
|
||||||
|
image.drawUber(mask, transform, blendMode)
|
||||||
|
|
||||||
|
proc draw*(
|
||||||
|
mask: Mask, image: Image, transform: Vec2 | Mat3 = vec2(), blendMode = bmMask
|
||||||
|
) {.inline.} =
|
||||||
|
## Draws a image onto a mask using a matrix with color blending.
|
||||||
|
when type(transform) is Vec2:
|
||||||
|
mask.drawUber(image, translate(transform), blendMode)
|
||||||
|
else:
|
||||||
|
mask.drawUber(image, transform, blendMode)
|
||||||
|
|
||||||
proc drawTiled*(dest, src: Image, mat: Mat3, blendMode = bmNormal) =
|
proc drawTiled*(dest, src: Image, mat: Mat3, blendMode = bmNormal) =
|
||||||
dest.drawCorrect(src, mat, true, blendMode)
|
dest.drawCorrect(src, mat, true, blendMode)
|
||||||
|
|
Loading…
Reference in a new issue