rename to blender

This commit is contained in:
Ryan Oldenburg 2021-01-28 22:28:05 -06:00
parent dad7440e04
commit 03dcd05969
2 changed files with 6 additions and 6 deletions

View file

@ -34,7 +34,7 @@ type
bmIntersectMask
bmExcludeMask
Mixer* = proc(a, b: ColorRGBA): ColorRGBA
Blender* = proc(a, b: ColorRGBA): ColorRGBA
when defined(release):
{.push checks: off.}
@ -531,7 +531,7 @@ proc blendExcludeMask(backdrop, source: ColorRGBA): ColorRGBA =
proc blendOverwrite(backdrop, source: ColorRGBA): ColorRGBA =
source
proc mixer*(blendMode: BlendMode): Mixer =
proc blender*(blendMode: BlendMode): Blender =
case blendMode
of bmNormal: blendNormal
of bmDarken: blendDarken

View file

@ -387,7 +387,7 @@ proc drawCorrect*(a, b: Image, mat: Mat3, blendMode: BlendMode) =
minFilterBy2 /= 2
matInv = matInv * scale(vec2(0.5, 0.5))
let mixer = blendMode.mixer()
let blender = blendMode.blender()
for y in 0 ..< a.height:
for x in 0 ..< a.width:
let
@ -396,7 +396,7 @@ proc drawCorrect*(a, b: Image, mat: Mat3, blendMode: BlendMode) =
yFloat = srcPos.y - h
rgba = a.getRgbaUnsafe(x, y)
rgba2 = b.getRgbaSmooth(xFloat, yFloat)
a.setRgbaUnsafe(x, y, mixer(rgba, rgba2))
a.setRgbaUnsafe(x, y, blender(rgba, rgba2))
proc drawUber(
a, b: Image,
@ -405,7 +405,7 @@ proc drawUber(
blendMode: BlendMode,
smooth: bool
) =
let mixer = blendMode.mixer()
let blender = blendMode.blender()
for y in 0 ..< a.height:
var
xMin = a.width
@ -439,7 +439,7 @@ proc drawUber(
b.getRgbaSmooth(xFloat, yFloat)
else:
b.getRgbaUnsafe(xFloat.int, yFloat.int)
a.setRgbaUnsafe(x, y, mixer(rgba, rgba2))
a.setRgbaUnsafe(x, y, blender(rgba, rgba2))
if blendMode == bmIntersectMask:
if a.width - xMax > 0: