Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2011-04-18 02:11:23 +0400
committerMatt Ebb <matt@mke3.net>2011-04-18 02:11:23 +0400
commitf261a22263414520d7a6ad6e0d674f828b0c0373 (patch)
tree7a883c83c94b5638f3a79cece1c266f466aedb1f /source
parent0862abf68bf1c9601080d4fb142c8f7edc6b300f (diff)
Committing patch [#26960] bu MiikaH, fixes bug:
[#26945] Hue Correct doesn't Hue But Rather Saturate thanks!
Diffstat (limited to 'source')
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c b/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c
index ce5092e2859..edf6c454285 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c
@@ -53,7 +53,7 @@ static void do_huecorrect(bNode *node, float *out, float *in)
/* adjust hue, scaling returned default 0.5 up to 1 */
f = curvemapping_evaluateF(node->storage, 0, hsv[0]);
- hsv[0] *= (f * 2.f);
+ hsv[0] += f-0.5f;
/* adjust saturation, scaling returned default 0.5 up to 1 */
f = curvemapping_evaluateF(node->storage, 1, hsv[0]);
@@ -63,7 +63,7 @@ static void do_huecorrect(bNode *node, float *out, float *in)
f = curvemapping_evaluateF(node->storage, 2, hsv[0]);
hsv[2] *= (f * 2.f);
- CLAMP(hsv[0], 0.f, 1.f);
+ hsv[0] = hsv[0] - floor(hsv[0]); /* mod 1.0 */
CLAMP(hsv[1], 0.f, 1.f);
/* convert back to rgb */
@@ -81,7 +81,7 @@ static void do_huecorrect_fac(bNode *node, float *out, float *in, float *fac)
/* adjust hue, scaling returned default 0.5 up to 1 */
f = curvemapping_evaluateF(node->storage, 0, hsv[0]);
- hsv[0] *= (f * 2.f);
+ hsv[0] += f-0.5f;
/* adjust saturation, scaling returned default 0.5 up to 1 */
f = curvemapping_evaluateF(node->storage, 1, hsv[0]);
@@ -91,7 +91,7 @@ static void do_huecorrect_fac(bNode *node, float *out, float *in, float *fac)
f = curvemapping_evaluateF(node->storage, 2, hsv[0]);
hsv[2] *= (f * 2.f);
- CLAMP(hsv[0], 0.f, 1.f);
+ hsv[0] = hsv[0] - floor(hsv[0]); /* mod 1.0 */
CLAMP(hsv[1], 0.f, 1.f);
/* convert back to rgb */