diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-08-04 16:38:03 +0300 |
---|---|---|
committer | Siddhartha Jejurkar <f20180617@goa.bits-pilani.ac.in> | 2021-08-06 09:09:42 +0300 |
commit | 8506edc0b8a9b9e2b5a3b955d984aabf76c8e543 (patch) | |
tree | 0dd1a1f04e87f6d1258cf8f9687c8f8ffefc65cf /source/blender/blenlib/intern | |
parent | 5c4bd878a23dccd829f448a6ca152b25d62faa72 (diff) |
BLI: add double version of 'scaleform'
No functional changes. New utility.
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/math_base_inline.c | 7 |
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) { |