[gimp] app: improve vivid-light formula
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: improve vivid-light formula
- Date: Mon, 23 Jan 2017 21:40:29 +0000 (UTC)
commit 5978def585fdee633eb8581fa68c7436ddeaad73
Author: Øyvind Kolås <pippin gimp org>
Date: Mon Jan 23 22:39:42 2017 +0100
app: improve vivid-light formula
app/operations/layer-modes/gimpblendcomposite.h | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/app/operations/layer-modes/gimpblendcomposite.h b/app/operations/layer-modes/gimpblendcomposite.h
index 6ee6292..1a0b555 100644
--- a/app/operations/layer-modes/gimpblendcomposite.h
+++ b/app/operations/layer-modes/gimpblendcomposite.h
@@ -1150,12 +1150,13 @@ blendfun_vivid_light (const float *dest,
if (src[c] > 0.5f)
{
- comp = (1.0f - (1.0f - dest[c]) / (2.0f * (src[c] - 0.5f)));
+ comp = (1.0f - (1.0f - dest[c]) / (2.0f * (src[c])));
}
else
{
- comp = dest[c] / (1.0f - 2.0f * src[c]);
+ comp = dest[c] / (1.0f - 2.0f * (src[c] - 0.5));
}
+ comp = MIN (comp, 1.0f);
out[c] = comp;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]