diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-08-17 16:32:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-08-17 20:13:21 +0200 |
commit | f4351535f3bf10b94cccc721ab395e2c7f5010a4 (patch) | |
tree | 19c18c568867d47918fad11b5c2bd70459cf74cc /include/basegfx | |
parent | 13db6e8671c36e1a028d6a8ad63f518e60f84870 (diff) |
Consolidate: basegfx::clamp -> o3tl::clamp
Change-Id: Iffd8b0a19d4479b6c70dc834c6f64499e87e01b1
Reviewed-on: https://gerrit.libreoffice.org/59265
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/basegfx')
-rw-r--r-- | include/basegfx/color/bcolor.hxx | 7 | ||||
-rw-r--r-- | include/basegfx/numeric/ftools.hxx | 18 |
2 files changed, 4 insertions, 21 deletions
diff --git a/include/basegfx/color/bcolor.hxx b/include/basegfx/color/bcolor.hxx index 02f8fb882790..9722e88c5b65 100644 --- a/include/basegfx/color/bcolor.hxx +++ b/include/basegfx/color/bcolor.hxx @@ -27,6 +27,7 @@ #include <basegfx/tuple/b3dtuple.hxx> #include <vector> #include <basegfx/basegfxdllapi.h> +#include <o3tl/clamp.hxx> namespace com { namespace sun { namespace star { namespace rendering { class XGraphicDevice; @@ -158,9 +159,9 @@ namespace basegfx // clamp color to [0.0..1.0] values in all three intensity components BColor& clamp() { - mfX = basegfx::clamp(mfX, 0.0, 1.0); - mfY = basegfx::clamp(mfY, 0.0, 1.0); - mfZ = basegfx::clamp(mfZ, 0.0, 1.0); + mfX = o3tl::clamp(mfX, 0.0, 1.0); + mfY = o3tl::clamp(mfY, 0.0, 1.0); + mfZ = o3tl::clamp(mfZ, 0.0, 1.0); return *this; } diff --git a/include/basegfx/numeric/ftools.hxx b/include/basegfx/numeric/ftools.hxx index da453a1a1b3d..5604a64ba626 100644 --- a/include/basegfx/numeric/ftools.hxx +++ b/include/basegfx/numeric/ftools.hxx @@ -105,24 +105,6 @@ namespace basegfx return std::max(fVal, 0.00001); } - /** clamp given value against given minimum and maximum values - */ - template <class T> inline const T& clamp(const T& value, const T& minimum, const T& maximum) - { - if(value < minimum) - { - return minimum; - } - else if(value > maximum) - { - return maximum; - } - else - { - return value; - } - } - /** Convert value from degrees to radians */ constexpr double deg2rad( double v ) |