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 @@ ...@@ -17,31 +17,27 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#ifndef INCLUDED_DRAWINGLAYER_TOOLS_CONVERTERS_HXX #ifndef INCLUDED_DRAWINGLAYER_INC_CONVERTERS_HXX
#define INCLUDED_DRAWINGLAYER_TOOLS_CONVERTERS_HXX #define INCLUDED_DRAWINGLAYER_INC_CONVERTERS_HXX
#include <drawinglayer/drawinglayerdllapi.h> #include <drawinglayer/drawinglayerdllapi.h>
#include <vcl/bitmapex.hxx> #include <vcl/bitmapex.hxx>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx> #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
namespace drawinglayer 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -31,12 +31,13 @@ ...@@ -31,12 +31,13 @@
#include <drawinglayer/geometry/viewinformation2d.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx>
#include <basegfx/numeric/ftools.hxx> #include <basegfx/numeric/ftools.hxx>
#include <vcl/bitmapex.hxx> #include <vcl/bitmapex.hxx>
#include <drawinglayer/tools/converters.hxx>
#include <vcl/canvastools.hxx> #include <vcl/canvastools.hxx>
#include <com/sun/star/geometry/RealRectangle2D.hpp> #include <com/sun/star/geometry/RealRectangle2D.hpp>
#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx> #include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include "converters.hxx"
#include <xprimitive2drenderer.hxx> #include <xprimitive2drenderer.hxx>
using namespace ::com::sun::star; using namespace ::com::sun::star;
...@@ -160,7 +161,7 @@ namespace drawinglayer ...@@ -160,7 +161,7 @@ namespace drawinglayer
const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef }; const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef };
BitmapEx aBitmapEx( BitmapEx aBitmapEx(
tools::convertToBitmapEx( convertToBitmapEx(
xEmbedSeq, xEmbedSeq,
aViewInformation2D, aViewInformation2D,
nDiscreteWidth, nDiscreteWidth,
......
...@@ -26,9 +26,10 @@ ...@@ -26,9 +26,10 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/texture/texture.hxx> #include <drawinglayer/texture/texture.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx> #include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/tools/converters.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx>
#include "converters.hxx"
using namespace com::sun::star; using namespace com::sun::star;
#define MAXIMUM_SQUARE_LENGTH (186.0) #define MAXIMUM_SQUARE_LENGTH (186.0)
...@@ -109,7 +110,7 @@ namespace drawinglayer ...@@ -109,7 +110,7 @@ namespace drawinglayer
const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef }; const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef };
const BitmapEx aBitmapEx( const BitmapEx aBitmapEx(
tools::convertToBitmapEx( convertToBitmapEx(
xEmbedSeq, xEmbedSeq,
aViewInformation2D, aViewInformation2D,
mnDiscreteWidth, mnDiscreteWidth,
......
...@@ -206,12 +206,9 @@ namespace drawinglayer ...@@ -206,12 +206,9 @@ namespace drawinglayer
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 namespace primitive2d
...@@ -270,7 +267,7 @@ namespace drawinglayer ...@@ -270,7 +267,7 @@ namespace drawinglayer
const basegfx::B2DPolyPolygon aNewPolyPolygon(aAreaPolyPolygon.getB2DPolygon(b)); const basegfx::B2DPolyPolygon aNewPolyPolygon(aAreaPolyPolygon.getB2DPolygon(b));
static bool bTestByUsingRandomColor(false); static bool bTestByUsingRandomColor(false);
const basegfx::BColor aColor(bTestByUsingRandomColor const basegfx::BColor aColor(bTestByUsingRandomColor
? basegfx::BColor(tools::getRandomColorRange(), tools::getRandomColorRange(), tools::getRandomColorRange()) ? basegfx::BColor(getRandomColorRange(), getRandomColorRange(), getRandomColorRange())
: getLineAttribute().getColor()); : getLineAttribute().getColor());
rContainer.push_back(new PolyPolygonColorPrimitive2D(aNewPolyPolygon, aColor)); rContainer.push_back(new PolyPolygonColorPrimitive2D(aNewPolyPolygon, aColor));
} }
......
...@@ -18,11 +18,12 @@ ...@@ -18,11 +18,12 @@
*/ */
#include <drawinglayer/texture/texture.hxx> #include <drawinglayer/texture/texture.hxx>
#include <drawinglayer/tools/converters.hxx>
#include <basegfx/numeric/ftools.hxx> #include <basegfx/numeric/ftools.hxx>
#include <basegfx/tools/gradienttools.hxx> #include <basegfx/tools/gradienttools.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "converters.hxx"
namespace drawinglayer namespace drawinglayer
{ {
namespace texture namespace texture
...@@ -44,9 +45,9 @@ namespace drawinglayer ...@@ -44,9 +45,9 @@ namespace drawinglayer
void GeoTexSvx::modifyBColor(const basegfx::B2DPoint& /*rUV*/, basegfx::BColor& rBColor, double& /*rfOpacity*/) const 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) // base implementation creates random color (for testing only, may also be pure virtual)
rBColor.setRed(tools::getRandomColorRange()); rBColor.setRed(getRandomColorRange());
rBColor.setGreen(tools::getRandomColorRange()); rBColor.setGreen(getRandomColorRange());
rBColor.setBlue(tools::getRandomColorRange()); rBColor.setBlue(getRandomColorRange());
} }
void GeoTexSvx::modifyOpacity(const basegfx::B2DPoint& rUV, double& rfOpacity) const 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