diff --git a/src/pixie/blends.nim b/src/pixie/blends.nim index b6761ef..f9fd7c0 100644 --- a/src/pixie/blends.nim +++ b/src/pixie/blends.nim @@ -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 diff --git a/src/pixie/images.nim b/src/pixie/images.nim index 2bbb44c..45dcbe1 100644 --- a/src/pixie/images.nim +++ b/src/pixie/images.nim @@ -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: