[babl] extensions: change the range of H in HSV.o from 0..360 to 0..1



commit 65fb471d011da49054c748b2214004f5fdd3f4d3
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 7 15:58:16 2013 +0200

    extensions: change the range of H in HSV.o from 0..360 to 0..1

 extensions/HSV.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/extensions/HSV.c b/extensions/HSV.c
index d4cf4c4..6185fb7 100644
--- a/extensions/HSV.c
+++ b/extensions/HSV.c
@@ -137,7 +137,7 @@ rgba_to_hsva (char *src,
       else
         hue = 4.0 + (red - green) / chroma;
 
-      hue *= 60.0;
+      hue /= 6.0;
     }
 
     ((double *) dst)[0] = hue;
@@ -168,7 +168,7 @@ hsva_to_rgba (char *src,
     double chroma, h_tmp, x, min;
 
     chroma = saturation * value;
-    h_tmp = hue / 60.0;
+    h_tmp = hue * 6.0;
     x = chroma * (1.0 - fabs(fmod(h_tmp, 2.0) - 1.0));
 
     if (h_tmp < 1.0)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]