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
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c')
-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 */