summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-08-17 16:32:17 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-08-17 20:13:21 +0200
commitf4351535f3bf10b94cccc721ab395e2c7f5010a4 (patch)
tree19c18c568867d47918fad11b5c2bd70459cf74cc /drawinglayer
parent13db6e8671c36e1a028d6a8ad63f518e60f84870 (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 'drawinglayer')
-rw-r--r--drawinglayer/source/attribute/fillgraphicattribute.cxx5
-rw-r--r--drawinglayer/source/attribute/sdrfillgraphicattribute.cxx5
-rw-r--r--drawinglayer/source/primitive2d/graphicprimitive2d.cxx15
-rw-r--r--drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx5
-rw-r--r--drawinglayer/source/texture/texture.cxx5
-rw-r--r--drawinglayer/source/texture/texture3d.cxx5
6 files changed, 23 insertions, 17 deletions
diff --git a/drawinglayer/source/attribute/fillgraphicattribute.cxx b/drawinglayer/source/attribute/fillgraphicattribute.cxx
index 867fecd79b52..406486ce794b 100644
--- a/drawinglayer/source/attribute/fillgraphicattribute.cxx
+++ b/drawinglayer/source/attribute/fillgraphicattribute.cxx
@@ -18,6 +18,7 @@
*/
#include <drawinglayer/attribute/fillgraphicattribute.hxx>
+#include <o3tl/clamp.hxx>
#include <vcl/graph.hxx>
namespace drawinglayer
@@ -98,8 +99,8 @@ namespace drawinglayer
double fOffsetY)
: mpFillGraphicAttribute(ImpFillGraphicAttribute(
rGraphic, rGraphicRange, bTiling,
- basegfx::clamp(fOffsetX, 0.0, 1.0),
- basegfx::clamp(fOffsetY, 0.0, 1.0)))
+ o3tl::clamp(fOffsetX, 0.0, 1.0),
+ o3tl::clamp(fOffsetY, 0.0, 1.0)))
{
}
diff --git a/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx b/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx
index f1bce0064dd8..84fbaea1d998 100644
--- a/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx
+++ b/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx
@@ -19,6 +19,7 @@
#include <drawinglayer/attribute/sdrfillgraphicattribute.hxx>
#include <drawinglayer/attribute/fillgraphicattribute.hxx>
+#include <o3tl/clamp.hxx>
#include <rtl/instance.hxx>
#include <vcl/graph.hxx>
@@ -289,8 +290,8 @@ namespace drawinglayer
}
// get offset in percent
- const double fOffsetX(basegfx::clamp(getOffset().getX() * 0.01, 0.0, 1.0));
- const double fOffsetY(basegfx::clamp(getOffset().getY() * 0.01, 0.0, 1.0));
+ const double fOffsetX(o3tl::clamp(getOffset().getX() * 0.01, 0.0, 1.0));
+ const double fOffsetY(o3tl::clamp(getOffset().getY() * 0.01, 0.0, 1.0));
// create FillGraphicAttribute
return FillGraphicAttribute(
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index 4c2f80f87327..35ac0366a0fa 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -25,6 +25,7 @@
#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <o3tl/clamp.hxx>
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
@@ -122,12 +123,12 @@ namespace drawinglayer
aRetval = create2DColorModifierEmbeddingsAsNeeded(
aRetval,
aSuppressGraphicAttr.GetDrawMode(),
- basegfx::clamp(aSuppressGraphicAttr.GetLuminance() * 0.01, -1.0, 1.0),
- basegfx::clamp(aSuppressGraphicAttr.GetContrast() * 0.01, -1.0, 1.0),
- basegfx::clamp(aSuppressGraphicAttr.GetChannelR() * 0.01, -1.0, 1.0),
- basegfx::clamp(aSuppressGraphicAttr.GetChannelG() * 0.01, -1.0, 1.0),
- basegfx::clamp(aSuppressGraphicAttr.GetChannelB() * 0.01, -1.0, 1.0),
- basegfx::clamp(aSuppressGraphicAttr.GetGamma(), 0.0, 10.0),
+ o3tl::clamp(aSuppressGraphicAttr.GetLuminance() * 0.01, -1.0, 1.0),
+ o3tl::clamp(aSuppressGraphicAttr.GetContrast() * 0.01, -1.0, 1.0),
+ o3tl::clamp(aSuppressGraphicAttr.GetChannelR() * 0.01, -1.0, 1.0),
+ o3tl::clamp(aSuppressGraphicAttr.GetChannelG() * 0.01, -1.0, 1.0),
+ o3tl::clamp(aSuppressGraphicAttr.GetChannelB() * 0.01, -1.0, 1.0),
+ o3tl::clamp(aSuppressGraphicAttr.GetGamma(), 0.0, 10.0),
aSuppressGraphicAttr.IsInvert());
if(!aRetval.size())
@@ -140,7 +141,7 @@ namespace drawinglayer
if(getGraphicAttr().IsTransparent())
{
// check for transparency
- const double fTransparency(basegfx::clamp(getGraphicAttr().GetTransparency() * (1.0 / 255.0), 0.0, 1.0));
+ const double fTransparency(o3tl::clamp(getGraphicAttr().GetTransparency() * (1.0 / 255.0), 0.0, 1.0));
if(!basegfx::fTools::equalZero(fTransparency))
{
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index ba5cc8441122..bb0430d3fa68 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -29,6 +29,7 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <o3tl/clamp.hxx>
// helper class for animated graphics
@@ -590,8 +591,8 @@ namespace drawinglayer
// original in svtools uses:
// #define WATERMARK_LUM_OFFSET 50
// #define WATERMARK_CON_OFFSET -70
- fLuminance = basegfx::clamp(fLuminance + 0.5, -1.0, 1.0);
- fContrast = basegfx::clamp(fContrast - 0.7, -1.0, 1.0);
+ fLuminance = o3tl::clamp(fLuminance + 0.5, -1.0, 1.0);
+ fContrast = o3tl::clamp(fContrast - 0.7, -1.0, 1.0);
aGraphicDrawMode = GraphicDrawMode::Standard;
}
diff --git a/drawinglayer/source/texture/texture.cxx b/drawinglayer/source/texture/texture.cxx
index cf10feab336d..d8cd40e4e919 100644
--- a/drawinglayer/source/texture/texture.cxx
+++ b/drawinglayer/source/texture/texture.cxx
@@ -21,6 +21,7 @@
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/utils/gradienttools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <o3tl/clamp.hxx>
#include <converters.hxx>
@@ -697,8 +698,8 @@ namespace drawinglayer
double fOffsetX,
double fOffsetY)
: maRange(rRange),
- mfOffsetX(basegfx::clamp(fOffsetX, 0.0, 1.0)),
- mfOffsetY(basegfx::clamp(fOffsetY, 0.0, 1.0))
+ mfOffsetX(o3tl::clamp(fOffsetX, 0.0, 1.0)),
+ mfOffsetY(o3tl::clamp(fOffsetY, 0.0, 1.0))
{
if(!basegfx::fTools::equalZero(mfOffsetX))
{
diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx
index c021c336bb2c..67e7ed56da19 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -18,6 +18,7 @@
*/
#include <drawinglayer/texture/texture3d.hxx>
+#include <o3tl/clamp.hxx>
#include <vcl/bitmapaccess.hxx>
#include <drawinglayer/primitive3d/hatchtextureprimitive3d.hxx>
#include <sal/log.hxx>
@@ -288,8 +289,8 @@ namespace drawinglayer
double fOffsetX,
double fOffsetY)
: GeoTexSvxBitmapEx(rBitmapEx, rRange),
- mfOffsetX(basegfx::clamp(fOffsetX, 0.0, 1.0)),
- mfOffsetY(basegfx::clamp(fOffsetY, 0.0, 1.0)),
+ mfOffsetX(o3tl::clamp(fOffsetX, 0.0, 1.0)),
+ mfOffsetY(o3tl::clamp(fOffsetY, 0.0, 1.0)),
mbUseOffsetX(!basegfx::fTools::equalZero(mfOffsetX)),
mbUseOffsetY(!mbUseOffsetX && !basegfx::fTools::equalZero(mfOffsetY))
{