From a16315a9cf0efcf1b6c98af08569ef442a70d47f Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Fri, 29 Jan 2021 13:00:35 -0600 Subject: [PATCH] for non simd for now --- src/pixie/blends.nim | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/pixie/blends.nim b/src/pixie/blends.nim index 61a6a4f..9ba66f0 100644 --- a/src/pixie/blends.nim +++ b/src/pixie/blends.nim @@ -239,9 +239,9 @@ proc `-`*(c: Color, v: float32): Color {.inline.} = # else: # screen(backdrop, 2 * source - 1) -# proc softLight(backdrop, source: float32): float32 {.inline.} = -# ## Pegtop -# (1 - 2 * source) * backdrop ^ 2 + 2 * source * backdrop +proc softLight(backdrop, source: float32): float32 {.inline.} = + ## Pegtop + (1 - 2 * source) * backdrop ^ 2 + 2 * source * backdrop proc Lum(C: Color): float32 {.inline.} = 0.3 * C.r + 0.59 * C.g + 0.11 * C.b @@ -367,11 +367,11 @@ proc alphaFix(backdrop, source, mixed: Color): Color = # result.b = hardLight(backdrop.b, source.b) # result = alphaFix(backdrop, source, result) -# proc blendSoftLightFloats*(backdrop, source: Color): Color {.inline.} = -# result.r = softLight(backdrop.r, source.r) -# result.g = softLight(backdrop.g, source.g) -# result.b = softLight(backdrop.b, source.b) -# result = alphaFix(backdrop, source, result) +proc blendSoftLightFloats*(backdrop, source: Color): Color {.inline.} = + result.r = softLight(backdrop.r, source.r) + result.g = softLight(backdrop.g, source.g) + result.b = softLight(backdrop.b, source.b) + result = alphaFix(backdrop, source, result) # proc blendDifferenceFloats*(backdrop, source: Color): Color {.inline.} = # result.r = abs(backdrop.r - source.r)