[Libreoffice-commits] core.git: filter/source

Rohan Kumar rohankanojia420 at gmail.com
Thu Apr 6 23:17:26 UTC 2017


 filter/source/svg/presentation_engine.js |  115 +++++++++++++++++++++++++++++++
 1 file changed, 115 insertions(+)

New commits:
commit 616efc4a11481ecafe40ca1de3ef93841c11dc9a
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date:   Sat Feb 4 03:15:06 2017 +0530

    tdf#51358 Add Support for FanWipe class
    
    Ported the class FanWipe In SVG engine.
    
    Change-Id: I8a067f2df32968bb00d5b3adc020bc9ee8296f33
    Reviewed-on: https://gerrit.libreoffice.org/33910
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/filter/source/svg/presentation_engine.js b/filter/source/svg/presentation_engine.js
index d46cc96d235d..b2383a9b4af7 100644
--- a/filter/source/svg/presentation_engine.js
+++ b/filter/source/svg/presentation_engine.js
@@ -5182,6 +5182,7 @@ BARNDOORWIPE_TRANSITION     = 15; // 4
 VEEWIPE_TRANSITION          = 16; // 8
 ZIGZAGWIPE_TRANSITION       = 17; // 10
 BARNZIGZAGWIPE_TRANSITION   = 18; // 11
+FANWIPE_TRANSITION          = 19; // 25
 
 aTransitionTypeInMap = {
     'barWipe'           : BARWIPE_TRANSITION,
@@ -5194,6 +5195,7 @@ aTransitionTypeInMap = {
     'pushWipe'          : PUSHWIPE_TRANSITION,
     'slideWipe'         : SLIDEWIPE_TRANSITION,
     'fade'              : FADE_TRANSITION,
+    'fanWipe'           : FANWIPE_TRANSITION,
     'randomBarWipe'     : RANDOMBARWIPE_TRANSITION,
     'checkerBoardWipe'  : CHECKERBOARDWIPE_TRANSITION,
     'dissolve'          : DISSOLVE_TRANSITION,
@@ -5259,6 +5261,12 @@ UP_TRANS_SUBTYPE                    = 45; // 21
 RIGHT_TRANS_SUBTYPE                 = 46; // 22
 DIAGONALBOTTOMLEFT_TRANS_SUBTYPE    = 47; // 15
 DIAGONALTOPLEFT_TRANS_SUBTYPE       = 48; // 16
+CENTERTOP_TRANS_SUBTYPE             = 49; // 48
+CENTERRIGHT_TRANS_SUBTYPE           = 50; // 49
+TOP_TRANS_SUBTYPE                   = 51; // 50
+RIGHT_TRANS_SUBTYPE                 = 52; // 22
+BOTTOM_TRANS_SUBTYPE                = 53; // 52
+LEFT_TRANS_SUBTYPE                  = 54; // 20
 
 aTransitionSubtypeInMap = {
     'default'           : DEFAULT_TRANS_SUBTYPE,
@@ -5267,6 +5275,12 @@ aTransitionSubtypeInMap = {
     'cornersIn'         : CORNERSIN_TRANS_SUBTYPE,
     'cornersOut'        : CORNERSOUT_TRANS_SUBTYPE,
     'vertical'          : VERTICAL_TRANS_SUBTYPE,
+    'centerTop'         : CENTERTOP_TRANS_SUBTYPE,
+    'centerRight'       : CENTERRIGHT_TRANS_SUBTYPE,
+    'top'               : TOP_TRANS_SUBTYPE,
+    'right'             : RIGHT_TRANS_SUBTYPE,
+    'bottom'            : BOTTOM_TRANS_SUBTYPE,
+    'left'              : LEFT_TRANS_SUBTYPE,
     'horizontal'        : HORIZONTAL_TRANS_SUBTYPE,
     'down'              : DOWN_TRANS_SUBTYPE,
     'circle'            : CIRCLE_TRANS_SUBTYPE,
@@ -5765,6 +5779,69 @@ aTransitionInfoTable[VEEWIPE_TRANSITION][RIGHT_TRANS_SUBTYPE] =
     'scaleIsotropically' : false
 };
 
+aTransitionInfoTable[FANWIPE_TRANSITION] = {};
+aTransitionInfoTable[FANWIPE_TRANSITION][CENTERTOP_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 0.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_Y,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[FANWIPE_TRANSITION][CENTERRIGHT_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 90.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_X,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[FANWIPE_TRANSITION][TOP_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 180.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_Y,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[FANWIPE_TRANSITION][RIGHT_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : -90.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_X,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[FANWIPE_TRANSITION][BOTTOM_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 180.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_Y,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+aTransitionInfoTable[FANWIPE_TRANSITION][LEFT_TRANS_SUBTYPE] =
+{
+    'class' : TRANSITION_CLIP_POLYPOLYGON,
+    'rotationAngle' : 90.0,
+    'scaleX' : 1.0,
+    'scaleY' : 1.0,
+    'reverseMethod' : REVERSEMETHOD_FLIP_X,
+    'outInvertsSweep' : true,
+    'scaleIsotropically' : false
+};
+
+
 aTransitionInfoTable[PINWHEELWIPE_TRANSITION] = {};
 aTransitionInfoTable[PINWHEELWIPE_TRANSITION][ONEBLADE_TRANS_SUBTYPE] =
 aTransitionInfoTable[PINWHEELWIPE_TRANSITION][TWOBLADEVERTICAL_TRANS_SUBTYPE] =
@@ -9454,6 +9531,9 @@ function createClipPolyPolygon( nType, nSubtype )
                                     nSubtype == BOTTOMCENTER_TRANS_SUBTYPE );
         case ELLIPSEWIPE_TRANSITION:
             return new EllipseWipePath( nSubtype );
+        case FANWIPE_TRANSITION:
+            return new FanWipePath(nSubtype == CENTERTOP_TRANS_SUBTYPE ||
+                                   nSubtype == CENTERRIGHT_TRANS_SUBTYPE, true, false);
         case PINWHEELWIPE_TRANSITION:
             var nBlades;
             switch( nSubtype )
@@ -9731,6 +9811,41 @@ EllipseWipePath.prototype.perform = function( nT )
     return aEllipse;
 };
 
+/*
+ * Class FanWipePath
+ *
+ */
+function FanWipePath(bIsCenter, bIsSingle, bIsFanIn) {
+    this.bCenter = bIsCenter;
+    this.bSingle = bIsSingle;
+    this.bFanIn  = bIsFanIn;
+    this.aBasePath = createUnitSquarePath();
+}
+
+FanWipePath.prototype.perform = function( nT ) {
+  var res = this.aBasePath.cloneNode(true);
+  var poly = PinWheelWipePath.calcCenteredClock(
+          nT / ((this.bCenter && this.bSingle) ? 2.0 : 4.0), 1.0);
+  res.appendPath(poly);
+  // flip on y-axis
+  var aTransform = SVGIdentityMatrix.flipY();
+  aTransform = aTransform.scaleNonUniform(-1.0, 1.0);
+  poly.matrixTransform(aTransform);
+  res.appendPath(poly);
+
+  if(this.bCenter) {
+      aTransform = SVGIdentityMatrix.scaleNonUniform(0.5, 0.5).translate(0.5, 0.5);
+      res.matrixTransform(aTransform);
+
+      if(!this.bSingle)
+          res.appendPath(flipOnXAxis(res));
+  }
+  else {
+      aTransform = SVGIdentityMatrix.scaleNonUniform(0.5, 1.0).translate(0.5, 1.0);
+      res.matrixTransform(aTransform);
+  }
+  return res;
+}
 
 /**
  * Class ClockWipePath


More information about the Libreoffice-commits mailing list