Kaydet (Commit) 632edfab authored tarafından Tor Lillqvist's avatar Tor Lillqvist

<drawinglayer/tools/converters.hxx> can be internal to drawinglayer

And while moving it, get rid of the 'drawinglyer::tools' subnamespace.
Less potential confusion with the global 'tools' namespace.

Change-Id: Iab3c25be0cec7f3d182228d122837e9f2ac9a529
Reviewed-on: https://gerrit.libreoffice.org/42619Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
Tested-by: 's avatarTor Lillqvist <tml@collabora.com>
üst 442df6cf
......@@ -17,31 +17,27 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_DRAWINGLAYER_TOOLS_CONVERTERS_HXX
#define INCLUDED_DRAWINGLAYER_TOOLS_CONVERTERS_HXX
#ifndef INCLUDED_DRAWINGLAYER_INC_CONVERTERS_HXX
#define INCLUDED_DRAWINGLAYER_INC_CONVERTERS_HXX
#include <drawinglayer/drawinglayerdllapi.h>
#include <vcl/bitmapex.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
namespace drawinglayer
{
namespace tools
{
BitmapEx DRAWINGLAYER_DLLPUBLIC convertToBitmapEx(
const drawinglayer::primitive2d::Primitive2DContainer& rSeq,
const geometry::ViewInformation2D& rViewInformation2D,
sal_uInt32 nDiscreteWidth,
sal_uInt32 nDiscreteHeight,
sal_uInt32 nMaxQuadratPixels);
double DRAWINGLAYER_DLLPUBLIC getRandomColorRange();
} // end of namespace tools
} // end of namespace drawinglayer
BitmapEx convertToBitmapEx(
const drawinglayer::primitive2d::Primitive2DContainer& rSeq,
const geometry::ViewInformation2D& rViewInformation2D,
sal_uInt32 nDiscreteWidth,
sal_uInt32 nDiscreteHeight,
sal_uInt32 nMaxQuadratPixels);
double getRandomColorRange();
} // end of namespace drawinglayer
#endif // INCLUDED_DRAWINGLAYER_TOOLS_CONVERTERS_HXX
#endif // INCLUDED_DRAWINGLAYER_INC_CONVERTERS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -31,12 +31,13 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <vcl/bitmapex.hxx>
#include <drawinglayer/tools/converters.hxx>
#include <vcl/canvastools.hxx>
#include <com/sun/star/geometry/RealRectangle2D.hpp>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include "converters.hxx"
#include <xprimitive2drenderer.hxx>
using namespace ::com::sun::star;
......@@ -160,7 +161,7 @@ namespace drawinglayer
const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef };
BitmapEx aBitmapEx(
tools::convertToBitmapEx(
convertToBitmapEx(
xEmbedSeq,
aViewInformation2D,
nDiscreteWidth,
......
......@@ -26,9 +26,10 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/texture/texture.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/tools/converters.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include "converters.hxx"
using namespace com::sun::star;
#define MAXIMUM_SQUARE_LENGTH (186.0)
......@@ -109,7 +110,7 @@ namespace drawinglayer
const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef };
const BitmapEx aBitmapEx(
tools::convertToBitmapEx(
convertToBitmapEx(
xEmbedSeq,
aViewInformation2D,
mnDiscreteWidth,
......
......@@ -206,12 +206,9 @@ namespace drawinglayer
namespace drawinglayer
{
namespace tools
double getRandomColorRange()
{
double getRandomColorRange()
{
return comphelper::rng::uniform_real_distribution(0.0, nextafter(1.0, DBL_MAX));
}
return comphelper::rng::uniform_real_distribution(0.0, nextafter(1.0, DBL_MAX));
}
namespace primitive2d
......@@ -270,7 +267,7 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon aNewPolyPolygon(aAreaPolyPolygon.getB2DPolygon(b));
static bool bTestByUsingRandomColor(false);
const basegfx::BColor aColor(bTestByUsingRandomColor
? basegfx::BColor(tools::getRandomColorRange(), tools::getRandomColorRange(), tools::getRandomColorRange())
? basegfx::BColor(getRandomColorRange(), getRandomColorRange(), getRandomColorRange())
: getLineAttribute().getColor());
rContainer.push_back(new PolyPolygonColorPrimitive2D(aNewPolyPolygon, aColor));
}
......
......@@ -18,11 +18,12 @@
*/
#include <drawinglayer/texture/texture.hxx>
#include <drawinglayer/tools/converters.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/tools/gradienttools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "converters.hxx"
namespace drawinglayer
{
namespace texture
......@@ -44,9 +45,9 @@ namespace drawinglayer
void GeoTexSvx::modifyBColor(const basegfx::B2DPoint& /*rUV*/, basegfx::BColor& rBColor, double& /*rfOpacity*/) const
{
// base implementation creates random color (for testing only, may also be pure virtual)
rBColor.setRed(tools::getRandomColorRange());
rBColor.setGreen(tools::getRandomColorRange());
rBColor.setBlue(tools::getRandomColorRange());
rBColor.setRed(getRandomColorRange());
rBColor.setGreen(getRandomColorRange());
rBColor.setBlue(getRandomColorRange());
}
void GeoTexSvx::modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment