Mercurial > hg > svgui
diff layer/ColourMapper.cpp @ 904:e0f08e108064 cxx11
Move to using double rather than float for floating-point calculations (float only for storage); more build fixes
author | Chris Cannam |
---|---|
date | Mon, 09 Mar 2015 12:02:10 +0000 |
parents | a1226b3b7925 |
children | 6e2a034f7117 |
line wrap: on
line diff
--- a/layer/ColourMapper.cpp Mon Mar 09 08:43:20 2015 +0000 +++ b/layer/ColourMapper.cpp Mon Mar 09 12:02:10 2015 +0000 @@ -120,7 +120,7 @@ v = norm * 2.0; if (v > 1.0) { v = 1.0; - s = 1.0 - (sqrtf(norm) - 0.707) * 3.413; + s = 1.0 - (sqrt(norm) - 0.707) * 3.413; if (s < 0.0) s = 0.0; if (s > 1.0) s = 1.0; } @@ -188,7 +188,7 @@ if (norm <= 1.0 / 256.0) { norm = 0.0; } else { - norm = 0.1f + (powf(((norm - 0.5) * 2.0), 3.0) + 1.0) / 2.081; + norm = 0.1f + (pow(((norm - 0.5) * 2.0), 3.0) + 1.0) / 2.081; } // now as for Sunset r = (norm - 0.24) * 2.38;