From f261a22263414520d7a6ad6e0d674f828b0c0373 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 17 Apr 2011 22:11:23 +0000 Subject: Committing patch [#26960] bu MiikaH, fixes bug: [#26945] Hue Correct doesn't Hue But Rather Saturate thanks! --- source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source') 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 */ -- cgit v1.2.3