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:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-08-04 16:38:03 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-08-04 16:46:54 +0300
commite5d4a0c5596daaae14251872755df1e71e54e108 (patch)
tree06ca2a1ab68e7c701d7fff1ee0ccdeb02ffa1502 /source/blender/blenlib/intern/math_base_inline.c
parent26c2c617b468ee2900f584b0ec0c82dfd632849a (diff)
BLI: add double version of 'scaleform'
No functional changes. New utility.
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_base_inline.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c
index 6e3846e59c6..a80c495ecf3 100644
--- a/source/blender/blenlib/intern/math_base_inline.c
+++ b/source/blender/blenlib/intern/math_base_inline.c
@@ -199,6 +199,13 @@ MINLINE float scalenorm(float a, float b, float x)
return (x * (b - a)) + a;
}
+/* Map a normalized value, i.e. from interval [0, 1] to interval [a, b]. */
+MINLINE double scalenormd(double a, double b, double x)
+{
+ BLI_assert(x <= 1 && x >= 0);
+ return (x * (b - a)) + a;
+}
+
/* Used for zoom values. */
MINLINE float power_of_2(float val)
{