diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-14 13:21:27 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-02-14 13:21:27 +0300 |
commit | c09e4ae08a4d97beaf919e6434eca4956a47d401 (patch) | |
tree | 4b0bc20e3910cf7b860f6752bee38074466e9ac0 /source/blender/blenlib/BLI_math_base.h | |
parent | a966852362bbeffab9e8b297da2d75bf53e69051 (diff) |
Math utils: Add clamping functions
Diffstat (limited to 'source/blender/blenlib/BLI_math_base.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_base.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index 377b9325717..3b24cae018d 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -132,6 +132,10 @@ MINLINE int max_iiii(int a, int b, int c, int d); MINLINE size_t min_zz(size_t a, size_t b); MINLINE size_t max_zz(size_t a, size_t b); +MINLINE int clamp_i(int value, int min, int max); +MINLINE float clamp_f(float value, float min, float max); +MINLINE size_t clamp_z(size_t value, size_t min, size_t max); + MINLINE int compare_ff(float a, float b, const float max_diff); MINLINE int compare_ff_relative(float a, float b, const float max_diff, const int max_ulps); |