rename to blender
This commit is contained in:
parent
dad7440e04
commit
03dcd05969
2 changed files with 6 additions and 6 deletions
|
@ -34,7 +34,7 @@ type
|
||||||
bmIntersectMask
|
bmIntersectMask
|
||||||
bmExcludeMask
|
bmExcludeMask
|
||||||
|
|
||||||
Mixer* = proc(a, b: ColorRGBA): ColorRGBA
|
Blender* = proc(a, b: ColorRGBA): ColorRGBA
|
||||||
|
|
||||||
when defined(release):
|
when defined(release):
|
||||||
{.push checks: off.}
|
{.push checks: off.}
|
||||||
|
@ -531,7 +531,7 @@ proc blendExcludeMask(backdrop, source: ColorRGBA): ColorRGBA =
|
||||||
proc blendOverwrite(backdrop, source: ColorRGBA): ColorRGBA =
|
proc blendOverwrite(backdrop, source: ColorRGBA): ColorRGBA =
|
||||||
source
|
source
|
||||||
|
|
||||||
proc mixer*(blendMode: BlendMode): Mixer =
|
proc blender*(blendMode: BlendMode): Blender =
|
||||||
case blendMode
|
case blendMode
|
||||||
of bmNormal: blendNormal
|
of bmNormal: blendNormal
|
||||||
of bmDarken: blendDarken
|
of bmDarken: blendDarken
|
||||||
|
|
|
@ -387,7 +387,7 @@ proc drawCorrect*(a, b: Image, mat: Mat3, blendMode: BlendMode) =
|
||||||
minFilterBy2 /= 2
|
minFilterBy2 /= 2
|
||||||
matInv = matInv * scale(vec2(0.5, 0.5))
|
matInv = matInv * scale(vec2(0.5, 0.5))
|
||||||
|
|
||||||
let mixer = blendMode.mixer()
|
let blender = blendMode.blender()
|
||||||
for y in 0 ..< a.height:
|
for y in 0 ..< a.height:
|
||||||
for x in 0 ..< a.width:
|
for x in 0 ..< a.width:
|
||||||
let
|
let
|
||||||
|
@ -396,7 +396,7 @@ proc drawCorrect*(a, b: Image, mat: Mat3, blendMode: BlendMode) =
|
||||||
yFloat = srcPos.y - h
|
yFloat = srcPos.y - h
|
||||||
rgba = a.getRgbaUnsafe(x, y)
|
rgba = a.getRgbaUnsafe(x, y)
|
||||||
rgba2 = b.getRgbaSmooth(xFloat, yFloat)
|
rgba2 = b.getRgbaSmooth(xFloat, yFloat)
|
||||||
a.setRgbaUnsafe(x, y, mixer(rgba, rgba2))
|
a.setRgbaUnsafe(x, y, blender(rgba, rgba2))
|
||||||
|
|
||||||
proc drawUber(
|
proc drawUber(
|
||||||
a, b: Image,
|
a, b: Image,
|
||||||
|
@ -405,7 +405,7 @@ proc drawUber(
|
||||||
blendMode: BlendMode,
|
blendMode: BlendMode,
|
||||||
smooth: bool
|
smooth: bool
|
||||||
) =
|
) =
|
||||||
let mixer = blendMode.mixer()
|
let blender = blendMode.blender()
|
||||||
for y in 0 ..< a.height:
|
for y in 0 ..< a.height:
|
||||||
var
|
var
|
||||||
xMin = a.width
|
xMin = a.width
|
||||||
|
@ -439,7 +439,7 @@ proc drawUber(
|
||||||
b.getRgbaSmooth(xFloat, yFloat)
|
b.getRgbaSmooth(xFloat, yFloat)
|
||||||
else:
|
else:
|
||||||
b.getRgbaUnsafe(xFloat.int, yFloat.int)
|
b.getRgbaUnsafe(xFloat.int, yFloat.int)
|
||||||
a.setRgbaUnsafe(x, y, mixer(rgba, rgba2))
|
a.setRgbaUnsafe(x, y, blender(rgba, rgba2))
|
||||||
|
|
||||||
if blendMode == bmIntersectMask:
|
if blendMode == bmIntersectMask:
|
||||||
if a.width - xMax > 0:
|
if a.width - xMax > 0:
|
||||||
|
|
Loading…
Reference in a new issue