summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-01-21 13:49:22 +0100
committerMathias Bauer <mba@openoffice.org>2010-01-21 13:49:22 +0100
commita934a163b50c787074eca3e5463ddab9fbd9b413 (patch)
treeb4fe00ef54597533059ca383e28e8ddbe5c9996c /slideshow
parentbeef7ed3c16db7f41b5f2ff5ec1dd271e046c137 (diff)
parent5c2d284b0f9973aada365a8f464f1152671bd629 (diff)
resync to DEV300_m70
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/shapes/viewbackgroundshape.cxx8
-rw-r--r--slideshow/source/engine/shapes/viewshape.cxx6
-rw-r--r--slideshow/source/engine/slidebitmap.cxx5
-rw-r--r--slideshow/source/engine/tools.cxx8
-rw-r--r--slideshow/source/engine/transitions/barndoorwipe.cxx7
-rw-r--r--slideshow/source/engine/transitions/clippingfunctor.cxx14
-rw-r--r--slideshow/source/engine/transitions/clockwipe.cxx5
-rw-r--r--slideshow/source/engine/transitions/combtransition.cxx23
-rw-r--r--slideshow/source/engine/transitions/fanwipe.cxx20
-rw-r--r--slideshow/source/engine/transitions/figurewipe.cxx6
-rw-r--r--slideshow/source/engine/transitions/fourboxwipe.cxx20
-rw-r--r--slideshow/source/engine/transitions/iriswipe.cxx8
-rw-r--r--slideshow/source/engine/transitions/pinwheelwipe.cxx11
-rw-r--r--slideshow/source/engine/transitions/randomwipe.cxx5
-rw-r--r--slideshow/source/engine/transitions/slidechangebase.cxx6
-rw-r--r--slideshow/source/engine/transitions/snakewipe.cxx36
-rw-r--r--slideshow/source/engine/transitions/spiralwipe.cxx7
-rw-r--r--slideshow/source/engine/transitions/sweepwipe.cxx21
-rw-r--r--slideshow/source/engine/transitions/transitiontools.cxx11
-rw-r--r--slideshow/source/engine/transitions/waterfallwipe.cxx5
-rw-r--r--slideshow/source/engine/transitions/zigzagwipe.cxx9
-rw-r--r--slideshow/test/demoshow.cxx9
22 files changed, 114 insertions, 136 deletions
diff --git a/slideshow/source/engine/shapes/viewbackgroundshape.cxx b/slideshow/source/engine/shapes/viewbackgroundshape.cxx
index 8e6db547cb85..5826f752cbec 100644
--- a/slideshow/source/engine/shapes/viewbackgroundshape.cxx
+++ b/slideshow/source/engine/shapes/viewbackgroundshape.cxx
@@ -48,6 +48,7 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <com/sun/star/rendering/XCanvas.hpp>
@@ -120,10 +121,9 @@ namespace slideshow
aLinearTransform.set( 1, 2, 0.0 );
pBitmapCanvas->setTransformation( aLinearTransform );
- ::basegfx::B2DHomMatrix aShapeTransform;
-
- aShapeTransform.scale( maBounds.getWidth(), maBounds.getHeight() );
- aShapeTransform.translate( maBounds.getMinX(), maBounds.getMinY() );
+ const basegfx::B2DHomMatrix aShapeTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(
+ maBounds.getWidth(), maBounds.getHeight(),
+ maBounds.getMinX(), maBounds.getMinY()));
::cppcanvas::RendererSharedPtr pRenderer(
::cppcanvas::VCLFactory::getInstance().createRenderer(
diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx
index fb2246309343..4e9c255c86ea 100644
--- a/slideshow/source/engine/shapes/viewshape.cxx
+++ b/slideshow/source/engine/shapes/viewshape.cxx
@@ -51,6 +51,7 @@
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <canvas/verbosetrace.hxx>
#include <canvas/canvastools.hxx>
@@ -713,9 +714,8 @@ namespace slideshow
aBitmapTransform.invert();
- ::basegfx::B2DHomMatrix aTranslation;
- aTranslation.translate( aTmpRect.getMinX(),
- aTmpRect.getMinY() );
+ const basegfx::B2DHomMatrix aTranslation(basegfx::tools::createTranslateB2DHomMatrix(
+ aTmpRect.getMinX(), aTmpRect.getMinY()));
aBitmapTransform = aBitmapTransform * aTranslation;
pBitmap->setTransformation( aBitmapTransform );
diff --git a/slideshow/source/engine/slidebitmap.cxx b/slideshow/source/engine/slidebitmap.cxx
index 9cc6f042cdb2..c06cc0786865 100644
--- a/slideshow/source/engine/slidebitmap.cxx
+++ b/slideshow/source/engine/slidebitmap.cxx
@@ -42,6 +42,7 @@
#include <cppuhelper/exc_hlp.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <canvas/canvastools.hxx>
#include <basegfx/tools/canvastools.hxx>
@@ -78,9 +79,7 @@ namespace slideshow
rendering::RenderState aRenderState;
::canvas::tools::initRenderState( aRenderState );
- ::basegfx::B2DHomMatrix aTranslation;
- aTranslation.translate( maOutputPos.getX(),
- maOutputPos.getY() );
+ const basegfx::B2DHomMatrix aTranslation(basegfx::tools::createTranslateB2DHomMatrix(maOutputPos));
::canvas::tools::setRenderStateTransform( aRenderState, aTranslation );
try
diff --git a/slideshow/source/engine/tools.cxx b/slideshow/source/engine/tools.cxx
index b2c179647db3..136e70743916 100644
--- a/slideshow/source/engine/tools.cxx
+++ b/slideshow/source/engine/tools.cxx
@@ -51,6 +51,7 @@
#include <basegfx/vector/b2ivector.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <cppcanvas/basegfxfactory.hxx>
@@ -524,10 +525,9 @@ namespace slideshow
{
if( !pAttr )
{
- ::basegfx::B2DHomMatrix aTransform;
-
- aTransform.scale( rShapeBounds.getWidth(), rShapeBounds.getHeight() );
- aTransform.translate( rShapeBounds.getMinX(), rShapeBounds.getMinY() );
+ const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(
+ rShapeBounds.getWidth(), rShapeBounds.getHeight(),
+ rShapeBounds.getMinX(), rShapeBounds.getMinY()));
return aTransform;
}
diff --git a/slideshow/source/engine/transitions/barndoorwipe.cxx b/slideshow/source/engine/transitions/barndoorwipe.cxx
index fb9388ff9ee8..be226c2c560d 100644
--- a/slideshow/source/engine/transitions/barndoorwipe.cxx
+++ b/slideshow/source/engine/transitions/barndoorwipe.cxx
@@ -34,6 +34,7 @@
#include <canvas/debug.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "barndoorwipe.hxx"
@@ -45,8 +46,7 @@ namespace internal {
if (m_doubled)
t /= 2.0;
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.translate( -0.5, -0.5 );
+ basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5));
aTransform.scale( ::basegfx::pruneScaleValue(t), 1.0 );
aTransform.translate( 0.5, 0.5 );
::basegfx::B2DPolygon poly( m_unitRect );
@@ -54,8 +54,7 @@ namespace internal {
::basegfx::B2DPolyPolygon res(poly);
if (m_doubled) {
- aTransform.identity();
- aTransform.translate( -0.5, -0.5 );
+ aTransform = basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5);
aTransform.rotate( M_PI_2 );
aTransform.translate( 0.5, 0.5 );
poly.transform( aTransform );
diff --git a/slideshow/source/engine/transitions/clippingfunctor.cxx b/slideshow/source/engine/transitions/clippingfunctor.cxx
index 97bb7fbd688f..58a50815b3ce 100644
--- a/slideshow/source/engine/transitions/clippingfunctor.cxx
+++ b/slideshow/source/engine/transitions/clippingfunctor.cxx
@@ -40,6 +40,7 @@
#include <basegfx/polygon/b2dpolygonclipper.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
namespace slideshow
{
@@ -134,20 +135,19 @@ namespace slideshow
break;
case TransitionInfo::REVERSEMETHOD_ROTATE_180:
- maStaticTransformation.translate( -0.5, -0.5 );
- maStaticTransformation.rotate( M_PI );
- maStaticTransformation.translate( 0.5, 0.5 );
+ maStaticTransformation = basegfx::tools::createRotateAroundPoint(0.5, 0.5, M_PI)
+ * maStaticTransformation;
break;
case TransitionInfo::REVERSEMETHOD_FLIP_X:
- maStaticTransformation.scale( -1.0, 1.0 );
- maStaticTransformation.translate( 1.0, 0.0 );
+ maStaticTransformation = basegfx::tools::createScaleTranslateB2DHomMatrix(-1.0, 1.0, 1.0, 0.0)
+ * maStaticTransformation;
mbFlip = true;
break;
case TransitionInfo::REVERSEMETHOD_FLIP_Y:
- maStaticTransformation.scale( 1.0, -1.0 );
- maStaticTransformation.translate( 0.0, 1.0 );
+ maStaticTransformation = basegfx::tools::createScaleTranslateB2DHomMatrix(1.0, -1.0, 0.0, 1.0)
+ * maStaticTransformation;
mbFlip = true;
break;
}
diff --git a/slideshow/source/engine/transitions/clockwipe.cxx b/slideshow/source/engine/transitions/clockwipe.cxx
index 16088f1954d0..5beef1efcbd9 100644
--- a/slideshow/source/engine/transitions/clockwipe.cxx
+++ b/slideshow/source/engine/transitions/clockwipe.cxx
@@ -35,6 +35,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "clockwipe.hxx"
@@ -66,9 +67,7 @@ namespace internal {
::basegfx::B2DPolyPolygon ClockWipe::operator () ( double t )
{
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.scale( 0.5, 0.5 );
- aTransform.translate( 0.5, 0.5 );
+ const basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
::basegfx::B2DPolygon poly( calcCenteredClock(t) );
poly.transform( aTransform );
return ::basegfx::B2DPolyPolygon(poly);
diff --git a/slideshow/source/engine/transitions/combtransition.cxx b/slideshow/source/engine/transitions/combtransition.cxx
index a222592b7d8d..93238162cadb 100644
--- a/slideshow/source/engine/transitions/combtransition.cxx
+++ b/slideshow/source/engine/transitions/combtransition.cxx
@@ -35,6 +35,7 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <cppcanvas/spritecanvas.hxx>
@@ -70,11 +71,7 @@ basegfx::B2DPolyPolygon createClipPolygon(
// rotate polygons, such that the strips are parallel to
// the given direction vector
const ::basegfx::B2DVector aUpVec(0.0, 1.0);
- ::basegfx::B2DHomMatrix aMatrix;
-
- aMatrix.translate( -0.5, -0.5 );
- aMatrix.rotate( aUpVec.angle( rDirection ) );
- aMatrix.translate( 0.5, 0.5 );
+ basegfx::B2DHomMatrix aMatrix(basegfx::tools::createRotateAroundPoint(0.5, 0.5, aUpVec.angle( rDirection )));
// blow up clip polygon to slide size
aMatrix.scale( rSlideSize.getX(),
@@ -129,7 +126,6 @@ void CombTransition::renderComb( double t,
// change transformation on cloned canvas to be in
// device pixel
cppcanvas::CanvasSharedPtr pCanvas( pCanvas_->clone() );
- basegfx::B2DHomMatrix transform;
basegfx::B2DPoint p;
// TODO(Q2): Use basegfx bitmaps here
@@ -156,17 +152,14 @@ void CombTransition::renderComb( double t,
pLeavingBitmap->clip( aClipPolygon1 );
// don't modify bitmap object (no move!):
p = basegfx::B2DPoint( pageOrigin + (t * aPushDirection) );
- transform.translate( p.getX(), p.getY() );
- pCanvas->setTransformation( transform );
+ pCanvas->setTransformation(basegfx::tools::createTranslateB2DHomMatrix(p.getX(), p.getY()));
pLeavingBitmap->draw( pCanvas );
// render even strips:
pLeavingBitmap->clip( aClipPolygon2 );
// don't modify bitmap object (no move!):
- transform.identity();
p = basegfx::B2DPoint( pageOrigin - (t * aPushDirection) );
- transform.translate( p.getX(), p.getY() );
- pCanvas->setTransformation( transform );
+ pCanvas->setTransformation(basegfx::tools::createTranslateB2DHomMatrix(p.getX(), p.getY()));
pLeavingBitmap->draw( pCanvas );
}
@@ -176,19 +169,15 @@ void CombTransition::renderComb( double t,
// render odd strips:
pEnteringBitmap->clip( aClipPolygon1 );
// don't modify bitmap object (no move!):
- transform.identity();
p = basegfx::B2DPoint( pageOrigin + ((t - 1.0) * aPushDirection) );
- transform.translate( p.getX(), p.getY() );
- pCanvas->setTransformation( transform );
+ pCanvas->setTransformation(basegfx::tools::createTranslateB2DHomMatrix(p.getX(), p.getY()));
pEnteringBitmap->draw( pCanvas );
// render even strips:
pEnteringBitmap->clip( aClipPolygon2 );
// don't modify bitmap object (no move!):
- transform.identity();
p = basegfx::B2DPoint( pageOrigin + ((1.0 - t) * aPushDirection) );
- transform.translate( p.getX(), p.getY() );
- pCanvas->setTransformation( transform );
+ pCanvas->setTransformation(basegfx::tools::createTranslateB2DHomMatrix(p.getX(), p.getY()));
pEnteringBitmap->draw( pCanvas );
}
diff --git a/slideshow/source/engine/transitions/fanwipe.cxx b/slideshow/source/engine/transitions/fanwipe.cxx
index 286d2a6b57de..220aa108c3f6 100644
--- a/slideshow/source/engine/transitions/fanwipe.cxx
+++ b/slideshow/source/engine/transitions/fanwipe.cxx
@@ -33,6 +33,7 @@
#include <canvas/debug.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "transitiontools.hxx"
#include "clockwipe.hxx"
#include "fanwipe.hxx"
@@ -50,26 +51,21 @@ namespace internal {
res.append( poly );
// flip on y-axis:
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.scale( -1.0, 1.0 );
- poly.transform( aTransform );
+ poly.transform(basegfx::tools::createScaleB2DHomMatrix(-1.0, 1.0));
poly.flip();
res.append( poly );
- aTransform.identity();
- if (m_center) {
- aTransform.scale( 0.5, 0.5 );
- aTransform.translate( 0.5, 0.5 );
- res.transform( aTransform );
+ if (m_center)
+ {
+ res.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
if (! m_single)
res.append( flipOnXAxis(res) );
}
- else {
+ else
+ {
OSL_ASSERT( ! m_fanIn );
- aTransform.scale( 0.5, 1.0 );
- aTransform.translate( 0.5, 1.0 );
- res.transform( aTransform );
+ res.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 1.0, 0.5, 1.0));
}
return res;
}
diff --git a/slideshow/source/engine/transitions/figurewipe.cxx b/slideshow/source/engine/transitions/figurewipe.cxx
index d4f4a2d2fe52..9c0576905877 100644
--- a/slideshow/source/engine/transitions/figurewipe.cxx
+++ b/slideshow/source/engine/transitions/figurewipe.cxx
@@ -35,6 +35,7 @@
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/point/b2dpoint.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "transitiontools.hxx"
#include "figurewipe.hxx"
@@ -45,10 +46,7 @@ namespace internal {
::basegfx::B2DPolyPolygon FigureWipe::operator () ( double t )
{
::basegfx::B2DPolyPolygon res(m_figure);
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.scale( t, t );
- aTransform.translate( 0.5, 0.5 );
- res.transform( aTransform );
+ res.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(t, t, 0.5, 0.5));
return res;
}
diff --git a/slideshow/source/engine/transitions/fourboxwipe.cxx b/slideshow/source/engine/transitions/fourboxwipe.cxx
index 61793eaa5a6b..96895cf44b10 100644
--- a/slideshow/source/engine/transitions/fourboxwipe.cxx
+++ b/slideshow/source/engine/transitions/fourboxwipe.cxx
@@ -35,6 +35,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "fourboxwipe.hxx"
@@ -45,13 +46,15 @@ namespace internal {
{
::basegfx::B2DHomMatrix aTransform;
const double d = ::basegfx::pruneScaleValue( t / 2.0 );
- if (m_cornersOut) {
- aTransform.translate( -0.5, -0.5 );
- aTransform.scale( d, d );
- aTransform.translate( -0.25, -0.25 );
- } else {
- aTransform.scale( d, d );
- aTransform.translate( -0.5, -0.5 );
+ if (m_cornersOut)
+ {
+ aTransform = basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5);
+ aTransform = basegfx::tools::createScaleTranslateB2DHomMatrix(d, d, -0.25, -0.25)
+ * aTransform;
+ }
+ else
+ {
+ aTransform = basegfx::tools::createScaleTranslateB2DHomMatrix(d, d, -0.5, -0.5);
}
// top left:
@@ -76,8 +79,7 @@ namespace internal {
square4.flip(); // flip direction
res.append( square4 );
- aTransform.identity();
- aTransform.translate( 0.5, 0.5 );
+ aTransform = basegfx::tools::createTranslateB2DHomMatrix(0.5, 0.5);
res.transform( aTransform );
return res;
}
diff --git a/slideshow/source/engine/transitions/iriswipe.cxx b/slideshow/source/engine/transitions/iriswipe.cxx
index 757108ada909..e58a8363e3f8 100644
--- a/slideshow/source/engine/transitions/iriswipe.cxx
+++ b/slideshow/source/engine/transitions/iriswipe.cxx
@@ -33,6 +33,7 @@
#include <canvas/debug.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "iriswipe.hxx"
@@ -41,11 +42,10 @@ namespace internal {
::basegfx::B2DPolyPolygon IrisWipe::operator () ( double t )
{
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.translate( -0.5, -0.5 );
const double d = ::basegfx::pruneScaleValue(t);
- aTransform.scale( d, d );
- aTransform.translate( 0.5, 0.5 );
+ basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5));
+ aTransform = basegfx::tools::createScaleTranslateB2DHomMatrix(d, d, 0.5, 0.5) * aTransform;
+
::basegfx::B2DPolyPolygon res( m_unitRect );
res.transform( aTransform );
return res;
diff --git a/slideshow/source/engine/transitions/pinwheelwipe.cxx b/slideshow/source/engine/transitions/pinwheelwipe.cxx
index 7e0ec35dff21..d959abb72a4d 100644
--- a/slideshow/source/engine/transitions/pinwheelwipe.cxx
+++ b/slideshow/source/engine/transitions/pinwheelwipe.cxx
@@ -34,6 +34,7 @@
#include <canvas/debug.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "clockwipe.hxx"
#include "pinwheelwipe.hxx"
@@ -43,23 +44,17 @@ namespace internal {
::basegfx::B2DPolyPolygon PinWheelWipe::operator () ( double t )
{
- ::basegfx::B2DHomMatrix aTransform;
::basegfx::B2DPolygon poly( ClockWipe::calcCenteredClock(
t / m_blades,
2.0 /* max edge when rotating */ ) );
::basegfx::B2DPolyPolygon res;
for ( sal_Int32 i = m_blades; i--; )
{
- aTransform.identity();
- aTransform.rotate( (i * 2.0 * M_PI) / m_blades );
::basegfx::B2DPolygon p(poly);
- p.transform( aTransform );
+ p.transform(basegfx::tools::createRotateB2DHomMatrix((i * 2.0 * M_PI) / m_blades));
res.append( p );
}
- aTransform.identity();
- aTransform.scale( 0.5, 0.5 );
- aTransform.translate( 0.5, 0.5 );
- res.transform( aTransform );
+ res.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5, 0.5, 0.5));
return res;
}
diff --git a/slideshow/source/engine/transitions/randomwipe.cxx b/slideshow/source/engine/transitions/randomwipe.cxx
index 94d73d613845..875ec1b3daa0 100644
--- a/slideshow/source/engine/transitions/randomwipe.cxx
+++ b/slideshow/source/engine/transitions/randomwipe.cxx
@@ -34,6 +34,7 @@
#include <canvas/debug.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "randomwipe.hxx"
#include "tools.hxx"
@@ -85,11 +86,9 @@ RandomWipe::RandomWipe( sal_Int32 nElements, bool randomBars )
::basegfx::B2DPolyPolygon res;
for ( sal_Int32 pos = static_cast<sal_Int32>(t * m_nElements); pos--; )
{
- ::basegfx::B2DHomMatrix aTransform;
::basegfx::B2DPoint const & point = m_positions[ pos ];
- aTransform.translate( point.getX(), point.getY() );
::basegfx::B2DPolygon poly( m_rect );
- poly.transform( aTransform );
+ poly.transform(basegfx::tools::createTranslateB2DHomMatrix(point.getX(), point.getY()));
res.append( poly );
}
return res;
diff --git a/slideshow/source/engine/transitions/slidechangebase.cxx b/slideshow/source/engine/transitions/slidechangebase.cxx
index c8b5cc4a4970..d855b7114ec6 100644
--- a/slideshow/source/engine/transitions/slidechangebase.cxx
+++ b/slideshow/source/engine/transitions/slidechangebase.cxx
@@ -37,6 +37,7 @@
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <cppcanvas/basegfxfactory.hxx>
#include "slidechangebase.hxx"
@@ -179,9 +180,10 @@ void SlideChangeBase::renderBitmap(
viewTransform * basegfx::B2DPoint() );
const cppcanvas::CanvasSharedPtr pDevicePixelCanvas(
pCanvas->clone() );
- basegfx::B2DHomMatrix transform;
+
// render at output position, don't modify bitmap object (no move!):
- transform.translate( pageOrigin.getX(), pageOrigin.getY() );
+ const basegfx::B2DHomMatrix transform(basegfx::tools::createTranslateB2DHomMatrix(
+ pageOrigin.getX(), pageOrigin.getY()));
pDevicePixelCanvas->setTransformation( transform );
pSlideBitmap->draw( pDevicePixelCanvas );
diff --git a/slideshow/source/engine/transitions/snakewipe.cxx b/slideshow/source/engine/transitions/snakewipe.cxx
index 496eaa559a6a..a8050a1b0e9a 100644
--- a/slideshow/source/engine/transitions/snakewipe.cxx
+++ b/slideshow/source/engine/transitions/snakewipe.cxx
@@ -35,6 +35,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "snakewipe.hxx"
#include "transitiontools.hxx"
@@ -121,16 +122,20 @@ SnakeWipe::SnakeWipe( sal_Int32 nElements, bool diagonal, bool flipOnYAxis )
poly.append( ::basegfx::B2DPoint( len + a, 0.0 ) );
poly.setClosed(true);
::basegfx::B2DHomMatrix aTransform;
- if ((static_cast<sal_Int32>(sqrtArea2) & 1) == 1) {
+
+ if ((static_cast<sal_Int32>(sqrtArea2) & 1) == 1)
+ {
// odd line
- aTransform.rotate( M_PI_2 + M_PI_4 );
- aTransform.translate( edge + m_elementEdge, 0.0 );
+ aTransform = basegfx::tools::createRotateB2DHomMatrix(M_PI_2 + M_PI_4);
+ aTransform.translate(edge + m_elementEdge, 0.0);
}
- else {
- aTransform.translate( -a, 0.0 );
+ else
+ {
+ aTransform = basegfx::tools::createTranslateB2DHomMatrix(-a, 0.0);
aTransform.rotate( -M_PI_4 );
aTransform.translate( 0.0, edge );
}
+
poly.transform( aTransform );
res.append(poly);
}
@@ -161,14 +166,17 @@ SnakeWipe::SnakeWipe( sal_Int32 nElements, bool diagonal, bool flipOnYAxis )
poly.append( ::basegfx::B2DPoint( len + a, 0.0 ) );
poly.setClosed(true);
::basegfx::B2DHomMatrix aTransform;
- if ((static_cast<sal_Int32>(sqrtArea2) & 1) == 1) {
+
+ if ((static_cast<sal_Int32>(sqrtArea2) & 1) == 1)
+ {
// odd line
- aTransform.translate( 0.0, -height );
+ aTransform = basegfx::tools::createTranslateB2DHomMatrix(0.0, -height);
aTransform.rotate( M_PI_2 + M_PI_4 );
aTransform.translate( 1.0, edge );
}
- else {
- aTransform.rotate( -M_PI_4 );
+ else
+ {
+ aTransform = basegfx::tools::createRotateB2DHomMatrix(-M_PI_4);
aTransform.translate( edge, 1.0 );
}
poly.transform( aTransform );
@@ -205,17 +213,16 @@ SnakeWipe::SnakeWipe( sal_Int32 nElements, bool diagonal, bool flipOnYAxis )
::basegfx::B2DPolyPolygon half(
calcHalfDiagonalSnake( t, false /* out */ ) );
// flip on x axis and rotate 90 degrees:
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.scale( 1.0, -1.0 );
+ basegfx::B2DHomMatrix aTransform(basegfx::tools::createScaleB2DHomMatrix(1.0, -1.0));
aTransform.translate( -0.5, 0.5 );
aTransform.rotate( M_PI_2 );
aTransform.translate( 0.5, 0.5 );
half.transform( aTransform );
half.flip();
res.append( half );
+
// rotate 180 degrees:
- aTransform.identity();
- aTransform.translate( -0.5, -0.5 );
+ aTransform = basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5);
aTransform.rotate( M_PI );
aTransform.translate( 0.5, 0.5 );
half.transform( aTransform );
@@ -225,8 +232,7 @@ SnakeWipe::SnakeWipe( sal_Int32 nElements, bool diagonal, bool flipOnYAxis )
{
::basegfx::B2DPolyPolygon half( calcSnake( t / 2.0 ) );
// rotate 90 degrees:
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.translate( -0.5, -0.5 );
+ basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5));
aTransform.rotate( M_PI_2 );
aTransform.translate( 0.5, 0.5 );
half.transform( aTransform );
diff --git a/slideshow/source/engine/transitions/spiralwipe.cxx b/slideshow/source/engine/transitions/spiralwipe.cxx
index f02c360a2628..5b8463ad9eea 100644
--- a/slideshow/source/engine/transitions/spiralwipe.cxx
+++ b/slideshow/source/engine/transitions/spiralwipe.cxx
@@ -38,6 +38,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
namespace slideshow {
@@ -57,8 +58,7 @@ SpiralWipe::SpiralWipe( sal_Int32 nElements, bool flipOnYAxis )
const double e = (sqrt(area) / 2.0);
const sal_Int32 edge = (static_cast<sal_Int32>(e) * 2);
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.translate( -0.5, -0.5 );
+ basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5));
const double edge_ = ::basegfx::pruneScaleValue(
static_cast<double>(edge) / m_sqrtElements );
aTransform.scale( edge_, edge_ );
@@ -75,8 +75,7 @@ SpiralWipe::SpiralWipe( sal_Int32 nElements, bool flipOnYAxis )
const sal_Int32 alen = (len > edge1 ? edge1 : len);
len -= alen;
poly = createUnitRect();
- aTransform.identity();
- aTransform.scale(
+ aTransform = basegfx::tools::createScaleB2DHomMatrix(
::basegfx::pruneScaleValue( static_cast<double>(alen) / m_sqrtElements ),
::basegfx::pruneScaleValue( 1.0 / m_sqrtElements ) );
aTransform.translate(
diff --git a/slideshow/source/engine/transitions/sweepwipe.cxx b/slideshow/source/engine/transitions/sweepwipe.cxx
index 17a3d8933797..ae6bd8a21f82 100644
--- a/slideshow/source/engine/transitions/sweepwipe.cxx
+++ b/slideshow/source/engine/transitions/sweepwipe.cxx
@@ -34,6 +34,7 @@
#include <canvas/debug.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "clockwipe.hxx"
#include "sweepwipe.hxx"
#include "transitiontools.hxx"
@@ -52,22 +53,26 @@ namespace internal {
::basegfx::B2DPolygon poly( ClockWipe::calcCenteredClock( 0.25 + t ) );
::basegfx::B2DHomMatrix aTransform;
- if (m_center) {
- aTransform.translate( 0.5, 0.0 );
+
+ if (m_center)
+ {
+ aTransform = basegfx::tools::createTranslateB2DHomMatrix(0.5, 0.0);
poly.transform( aTransform );
}
::basegfx::B2DPolyPolygon res(poly);
- if (! m_single) {
- aTransform.identity();
- if (m_oppositeVertical) {
- aTransform.scale( 1.0, -1.0 );
+ if (! m_single)
+ {
+ if (m_oppositeVertical)
+ {
+ aTransform = basegfx::tools::createScaleB2DHomMatrix(1.0, -1.0);
aTransform.translate( 0.0, 1.0 );
poly.transform( aTransform );
poly.flip();
}
- else {
- aTransform.translate( -0.5, -0.5 );
+ else
+ {
+ aTransform = basegfx::tools::createTranslateB2DHomMatrix(-0.5, -0.5);
aTransform.rotate( M_PI );
aTransform.translate( 0.5, 0.5 );
poly.transform( aTransform );
diff --git a/slideshow/source/engine/transitions/transitiontools.cxx b/slideshow/source/engine/transitions/transitiontools.cxx
index 6197e24514e0..c09bd12ef43d 100644
--- a/slideshow/source/engine/transitions/transitiontools.cxx
+++ b/slideshow/source/engine/transitions/transitiontools.cxx
@@ -36,6 +36,7 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
namespace slideshow {
@@ -53,10 +54,7 @@ namespace internal {
::basegfx::B2DPolyPolygon const & polypoly )
{
::basegfx::B2DPolyPolygon res(polypoly);
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.scale( -1.0, 1.0 );
- aTransform.translate( 1.0, 0.0 );
- res.transform( aTransform );
+ res.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(-1.0, 1.0, 1.0, 0.0));
res.flip();
return res;
}
@@ -65,10 +63,7 @@ namespace internal {
::basegfx::B2DPolyPolygon const & polypoly )
{
::basegfx::B2DPolyPolygon res(polypoly);
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.scale( 1.0, -1.0 );
- aTransform.translate( 0.0, 1.0 );
- res.transform( aTransform );
+ res.transform(basegfx::tools::createScaleTranslateB2DHomMatrix(1.0, -1.0, 0.0, 1.0));
res.flip();
return res;
}
diff --git a/slideshow/source/engine/transitions/waterfallwipe.cxx b/slideshow/source/engine/transitions/waterfallwipe.cxx
index 7a86edff5c67..c81cf2c68433 100644
--- a/slideshow/source/engine/transitions/waterfallwipe.cxx
+++ b/slideshow/source/engine/transitions/waterfallwipe.cxx
@@ -35,6 +35,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "waterfallwipe.hxx"
#include "transitiontools.hxx"
@@ -67,9 +68,7 @@ WaterfallWipe::WaterfallWipe( sal_Int32 nElements, bool flipOnYAxis )
::basegfx::B2DPolyPolygon WaterfallWipe::operator () ( double t )
{
::basegfx::B2DPolygon poly( m_waterfall );
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.translate( 0.0, ::basegfx::pruneScaleValue( 2.0 * t ) );
- poly.transform( aTransform );
+ poly.transform(basegfx::tools::createTranslateB2DHomMatrix(0.0, ::basegfx::pruneScaleValue(2.0 * t)));
poly.setB2DPoint( 0, ::basegfx::B2DPoint( 0.0, -1.0 ) );
poly.setB2DPoint( poly.count()-1, ::basegfx::B2DPoint( 1.0, -1.0 ) );
diff --git a/slideshow/source/engine/transitions/zigzagwipe.cxx b/slideshow/source/engine/transitions/zigzagwipe.cxx
index edc16099f843..8fa22c15c052 100644
--- a/slideshow/source/engine/transitions/zigzagwipe.cxx
+++ b/slideshow/source/engine/transitions/zigzagwipe.cxx
@@ -35,6 +35,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/numeric/ftools.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include "transitiontools.hxx"
#include "zigzagwipe.hxx"
@@ -58,10 +59,8 @@ ZigZagWipe::ZigZagWipe( sal_Int32 nZigs ) : m_zigEdge( 1.0 / nZigs )
::basegfx::B2DPolyPolygon ZigZagWipe::operator () ( double t )
{
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.translate( (1.0 + m_zigEdge) * t, 0.0 );
::basegfx::B2DPolyPolygon res(m_stdZigZag);
- res.transform( aTransform );
+ res.transform(basegfx::tools::createTranslateB2DHomMatrix((1.0 + m_zigEdge) * t, 0.0));
return res;
}
@@ -70,8 +69,8 @@ ZigZagWipe::ZigZagWipe( sal_Int32 nZigs ) : m_zigEdge( 1.0 / nZigs )
::basegfx::B2DPolyPolygon res( createUnitRect() );
::basegfx::B2DPolygon poly( m_stdZigZag );
poly.flip();
- ::basegfx::B2DHomMatrix aTransform;
- aTransform.translate( (1.0 + m_zigEdge) * (1.0 - t) / 2.0, 0.0 );
+ basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix(
+ (1.0 + m_zigEdge) * (1.0 - t) / 2.0, 0.0));
poly.transform( aTransform );
res.append( poly );
aTransform.scale( -1.0, 1.0 );
diff --git a/slideshow/test/demoshow.cxx b/slideshow/test/demoshow.cxx
index da7b4bfe3d3a..f860644dd5ac 100644
--- a/slideshow/test/demoshow.cxx
+++ b/slideshow/test/demoshow.cxx
@@ -100,12 +100,9 @@ public:
void resize( const ::Size& rNewSize )
{
maSize = rNewSize;
- maTransform.identity();
- const sal_Int32 nSize( std::min( rNewSize.Width(),
- rNewSize.Height() ) - 10 );
- maTransform.scale( nSize, nSize );
- maTransform.translate( (rNewSize.Width() - nSize) / 2,
- (rNewSize.Height() - nSize) / 2 );
+ const sal_Int32 nSize( std::min( rNewSize.Width(), rNewSize.Height() ) - 10);
+ maTransform = basegfx::tools::createScaleTranslateB2DHomMatrix(
+ nSize, nSize, (rNewSize.Width() - nSize) / 2, (rNewSize.Height() - nSize) / 2);
lang::EventObject aEvent( *this );
maTransformationListeners.notifyEach( &util::XModifyListener::modified,