pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1648454 - in /pdfbox/trunk: examples/src/main/java/org/apache/pdfbox/examples/util/ pdfbox/src/main/java/org/apache/pdfbox/contentstream/ pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/ pdfbox/src/main/java/org/apac...
Date Tue, 30 Dec 2014 00:40:39 GMT
Author: jahewson
Date: Tue Dec 30 00:40:38 2014
New Revision: 1648454

URL: http://svn.apache.org/r1648454
Log:
PDFBOX-1094: Clean up Matrix API calls. Reinstate previously deprecated methods with new names.

Modified:
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFGraphicsStreamEngine.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFTextStreamEngine.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/AppendRectangleToPath.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveTo.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveToReplicateFinalPoint.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveToReplicateInitialPoint.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/LineTo.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/MoveTo.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/Concatenate.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetMatrix.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/MoveText.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDRectangle.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDCalRGB.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/form/PDFormXObject.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDAbstractPattern.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDTilingPattern.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/AxialShadingContext.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PDShadingType1.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/RadialShadingContext.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Matrix.java
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ExtractImages.java

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PrintImageLocations.java
Tue Dec 30 00:40:38 2014
@@ -149,23 +149,9 @@ public class PrintImageLocations extends
             }
             else if(xobject instanceof PDFormXObject)
             {
-                // save the graphics state
-                saveGraphicsState();
-                
                 PDFormXObject form = (PDFormXObject)xobject;
-                // if there is an optional form matrix, we have to map the form space to
the user space
-                Matrix matrix = form.getMatrix();
-                if (matrix != null) 
-                {
-                    Matrix xobjectCTM = matrix.multiply( getGraphicsState().getCurrentTransformationMatrix());
-                    getGraphicsState().setCurrentTransformationMatrix(xobjectCTM);
-                }
-                processChildStream(form);
-                
-                // restore the graphics state
-                restoreGraphicsState();
+                showForm(form);
             }
-            
         }
         else
         {

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFGraphicsStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFGraphicsStreamEngine.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFGraphicsStreamEngine.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFGraphicsStreamEngine.java
Tue Dec 30 00:40:38 2014
@@ -216,7 +216,7 @@ public abstract class PDFGraphicsStreamE
     /**
      * Returns the current point of the current path.
      */
-    public abstract Point2D getCurrentPoint() throws IOException;
+    public abstract Point2D.Float getCurrentPoint() throws IOException;
 
     /**
      * Closes the current path.

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFStreamEngine.java
Tue Dec 30 00:40:38 2014
@@ -299,7 +299,7 @@ public class PDFStreamEngine
             a.concatenate(Matrix.getTranslatingInstance((float) -transformedBox.getX(),
                     (float) -transformedBox.getY()));
 
-            // Matrix shall be concatenated with A to form a matrix AA that maps from the
appearance€™s
+            // Matrix shall be concatenated with A to form a matrix AA that maps from the
appearance��s
             // coordinate system to the annotation's rectangle in default user space
             Matrix aa = Matrix.concatenate(matrix, a);
 
@@ -956,32 +956,33 @@ public class PDFStreamEngine
         return currentPage;
     }
 
+    /**
+     * Gets the stream's initial matrix.
+     */
     public Matrix getInitialMatrix()
     {
         return initialMatrix;
     }
 
     /**
-     * use the current transformation matrix to transformPoint a single point.
-     *
-     * @param x x-coordinate of the point to be transformPoint
-     * @param y y-coordinate of the point to be transformPoint
-     * @return the transformed coordinates as Point2D.Double
+     * Transforms a point using the CTM.
      */
-    public Point2D.Double transformedPoint(double x, double y)
+    public Point2D.Float transformedPoint(float x, float y)
     {
-        double[] position = { x, y };
+        float[] position = { x, y };
         getGraphicsState().getCurrentTransformationMatrix().createAffineTransform()
                 .transform(position, 0, position, 0, 1);
-        return new Point2D.Double(position[0], position[1]);
+        return new Point2D.Float(position[0], position[1]);
     }
-    
-    // transforms a width using the CTM
+
+    /**
+     * Transforms a width using the CTM.
+     */
     protected float transformWidth(float width)
     {
         Matrix ctm = getGraphicsState().getCurrentTransformationMatrix();
-        float x = ctm.getValue(0, 0) + ctm.getValue(1, 0);
-        float y = ctm.getValue(0, 1) + ctm.getValue(1, 1);
+        float x = ctm.getScaleX() + ctm.getShearX();
+        float y = ctm.getScaleY() + ctm.getShearY();
         return width * (float)Math.sqrt((x * x + y * y) * 0.5);
     }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFTextStreamEngine.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFTextStreamEngine.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFTextStreamEngine.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/PDFTextStreamEngine.java
Tue Dec 30 00:40:38 2014
@@ -155,7 +155,7 @@ public class PDFTextStreamEngine extends
 
         // (modified) width and height calculations
         float dxDisplay = nextX - textRenderingMatrix.getTranslateX();
-        float dyDisplay = height * textRenderingMatrix.getScaleY();
+        float dyDisplay = height * textRenderingMatrix.getScalingFactorY();
 
         //
         // start of the original method
@@ -176,7 +176,7 @@ public class PDFTextStreamEngine extends
         {
             // This will typically be 1000 but in the case of a type3 font
             // this might be a different number
-            glyphSpaceToTextSpaceFactor = 1f / font.getFontMatrix().getValue(0, 0);
+            glyphSpaceToTextSpaceFactor = 1f / font.getFontMatrix().getScaleX();
         }
 
         float spaceWidthText = 0;
@@ -203,7 +203,7 @@ public class PDFTextStreamEngine extends
 
         // the space width has to be transformed into display units
         float spaceWidthDisplay = spaceWidthText * fontSizeText * horizontalScalingText *
-                textRenderingMatrix.getXScale()  * ctm.getXScale();
+                textRenderingMatrix.getScalingFactorX()  * ctm.getScalingFactorX();
 
         // use our additional glyph list for Unicode mapping
         unicode = font.toUnicode(code, glyphList);
@@ -230,7 +230,7 @@ public class PDFTextStreamEngine extends
                 pageSize.getHeight(), textRenderingMatrix, nextX, nextY,
                 dyDisplay, dxDisplay,
                 spaceWidthDisplay, unicode, new int[] { code } , font, fontSize,
-                (int)(fontSize * textRenderingMatrix.getXScale())));
+                (int)(fontSize * textRenderingMatrix.getScalingFactorX())));
     }
 
     /**

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/AppendRectangleToPath.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/AppendRectangleToPath.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/AppendRectangleToPath.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/AppendRectangleToPath.java
Tue Dec 30 00:40:38 2014
@@ -39,12 +39,12 @@ public final class AppendRectangleToPath
         COSNumber w = (COSNumber) operands.get(2);
         COSNumber h = (COSNumber) operands.get(3);
 
-        double x1 = x.doubleValue();
-        double y1 = y.doubleValue();
+        float x1 = x.floatValue();
+        float y1 = y.floatValue();
 
         // create a pair of coordinates for the transformation
-        double x2 = w.doubleValue() + x1;
-        double y2 = h.doubleValue() + y1;
+        float x2 = w.floatValue() + x1;
+        float y2 = h.floatValue() + y1;
 
         Point2D p0 = context.transformedPoint(x1, y1);
         Point2D p1 = context.transformedPoint(x2, y1);

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveTo.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveTo.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveTo.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveTo.java
Tue Dec 30 00:40:38 2014
@@ -41,13 +41,13 @@ public class CurveTo extends GraphicsOpe
         COSNumber x3 = (COSNumber)operands.get(4);
         COSNumber y3 = (COSNumber)operands.get(5);
 
-        Point2D point1 = context.transformedPoint(x1.doubleValue(), y1.doubleValue());
-        Point2D point2 = context.transformedPoint(x2.doubleValue(), y2.doubleValue());
-        Point2D point3 = context.transformedPoint(x3.doubleValue(), y3.doubleValue());
+        Point2D.Float point1 = context.transformedPoint(x1.floatValue(), y1.floatValue());
+        Point2D.Float point2 = context.transformedPoint(x2.floatValue(), y2.floatValue());
+        Point2D.Float point3 = context.transformedPoint(x3.floatValue(), y3.floatValue());
 
-        context.curveTo((float) point1.getX(), (float) point1.getY(),
-                        (float) point2.getX(), (float) point2.getY(),
-                        (float) point3.getX(), (float) point3.getY());
+        context.curveTo(point1.x, point1.y,
+                        point2.x, point2.y,
+                        point3.x, point3.y);
     }
 
     @Override

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveToReplicateFinalPoint.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveToReplicateFinalPoint.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveToReplicateFinalPoint.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveToReplicateFinalPoint.java
Tue Dec 30 00:40:38 2014
@@ -39,12 +39,12 @@ public final class CurveToReplicateFinal
         COSNumber x3 = (COSNumber)operands.get(2);
         COSNumber y3 = (COSNumber)operands.get(3);
 
-        Point2D point1 = context.transformedPoint(x1.doubleValue(), y1.doubleValue());
-        Point2D point3 = context.transformedPoint(x3.doubleValue(), y3.doubleValue());
+        Point2D.Float point1 = context.transformedPoint(x1.floatValue(), y1.floatValue());
+        Point2D.Float point3 = context.transformedPoint(x3.floatValue(), y3.floatValue());
 
-        context.curveTo((float) point1.getX(), (float) point1.getY(),
-                        (float) point3.getX(), (float) point3.getY(),
-                        (float) point3.getX(), (float) point3.getY());
+        context.curveTo(point1.x, point1.y,
+                        point3.x, point3.y,
+                        point3.x, point3.y);
     }
 
     @Override

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveToReplicateInitialPoint.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveToReplicateInitialPoint.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveToReplicateInitialPoint.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/CurveToReplicateInitialPoint.java
Tue Dec 30 00:40:38 2014
@@ -39,14 +39,14 @@ public class CurveToReplicateInitialPoin
         COSNumber x3 = (COSNumber)operands.get(2);
         COSNumber y3 = (COSNumber)operands.get(3);
 
-        Point2D currentPoint = context.getCurrentPoint();
+        Point2D.Float currentPoint = context.getCurrentPoint();
 
-        Point2D point2 = context.transformedPoint(x2.doubleValue(), y2.doubleValue());
-        Point2D point3 = context.transformedPoint(x3.doubleValue(), y3.doubleValue());
+        Point2D.Float point2 = context.transformedPoint(x2.floatValue(), y2.floatValue());
+        Point2D.Float point3 = context.transformedPoint(x3.floatValue(), y3.floatValue());
 
-        context.curveTo((float) currentPoint.getX(), (float) currentPoint.getY(),
-                        (float) point2.getX(), (float) point2.getY(),
-                        (float) point3.getX(), (float) point3.getY());
+        context.curveTo(currentPoint.x, currentPoint.y,
+                        point2.x, point2.y,
+                        point3.x, point3.y);
     }
 
     @Override

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/LineTo.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/LineTo.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/LineTo.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/LineTo.java
Tue Dec 30 00:40:38 2014
@@ -38,8 +38,8 @@ public class LineTo extends GraphicsOper
         COSNumber x = (COSNumber)operands.get(0);
         COSNumber y = (COSNumber)operands.get(1);
 
-        Point2D pos = context.transformedPoint(x.doubleValue(), y.doubleValue());
-        context.lineTo((float) pos.getX(), (float) pos.getY());
+        Point2D.Float pos = context.transformedPoint(x.floatValue(), y.floatValue());
+        context.lineTo(pos.x, pos.y);
     }
 
     @Override

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/MoveTo.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/MoveTo.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/MoveTo.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/graphics/MoveTo.java
Tue Dec 30 00:40:38 2014
@@ -36,8 +36,8 @@ public final class MoveTo extends Graphi
     {
         COSNumber x = (COSNumber)operands.get(0);
         COSNumber y = (COSNumber)operands.get(1);
-        Point2D pos = context.transformedPoint(x.doubleValue(), y.doubleValue());
-        context.moveTo((float) pos.getX(), (float) pos.getY());
+        Point2D.Float pos = context.transformedPoint(x.floatValue(), y.floatValue());
+        context.moveTo(pos.x, pos.y);
     }
 
     @Override

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/Concatenate.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/Concatenate.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/Concatenate.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/Concatenate.java
Tue Dec 30 00:40:38 2014
@@ -43,17 +43,10 @@ public class Concatenate extends Operato
         COSNumber e = (COSNumber) arguments.get(4);
         COSNumber f = (COSNumber) arguments.get(5);
 
-        Matrix newMatrix = new Matrix();
-        newMatrix.setValue(0, 0, a.floatValue());
-        newMatrix.setValue(0, 1, b.floatValue());
-        newMatrix.setValue(1, 0, c.floatValue());
-        newMatrix.setValue(1, 1, d.floatValue());
-        newMatrix.setValue(2, 0, e.floatValue());
-        newMatrix.setValue(2, 1, f.floatValue());
+        Matrix matrix = new Matrix(a.floatValue(), b.floatValue(), c.floatValue(),
+                                   d.floatValue(), e.floatValue(), f.floatValue());
 
-        // this line has changed
-        context.getGraphicsState().setCurrentTransformationMatrix(
-                newMatrix.multiply(context.getGraphicsState().getCurrentTransformationMatrix()));
+        context.getGraphicsState().getCurrentTransformationMatrix().concatenate(matrix);
     }
 
     @Override

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetMatrix.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetMatrix.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetMatrix.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetMatrix.java
Tue Dec 30 00:40:38 2014
@@ -34,7 +34,6 @@ public class SetMatrix extends OperatorP
     @Override
     public void process(Operator operator, List<COSBase> arguments)
     {
-        //Set text matrix and text line matrix
         COSNumber a = (COSNumber)arguments.get( 0 );
         COSNumber b = (COSNumber)arguments.get( 1 );
         COSNumber c = (COSNumber)arguments.get( 2 );
@@ -42,15 +41,11 @@ public class SetMatrix extends OperatorP
         COSNumber e = (COSNumber)arguments.get( 4 );
         COSNumber f = (COSNumber)arguments.get( 5 );
 
-        Matrix textMatrix = new Matrix();
-        textMatrix.setValue( 0, 0, a.floatValue() );
-        textMatrix.setValue( 0, 1, b.floatValue() );
-        textMatrix.setValue( 1, 0, c.floatValue() );
-        textMatrix.setValue( 1, 1, d.floatValue() );
-        textMatrix.setValue( 2, 0, e.floatValue() );
-        textMatrix.setValue( 2, 1, f.floatValue() );
-        context.setTextMatrix( textMatrix );
-        context.setTextLineMatrix( textMatrix.clone() );
+        Matrix matrix = new Matrix(a.floatValue(), b.floatValue(), c.floatValue(),
+                                   d.floatValue(), e.floatValue(), f.floatValue());
+
+        context.setTextMatrix(matrix);
+        context.setTextLineMatrix(matrix.clone());
     }
 
     @Override

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/MoveText.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/MoveText.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/MoveText.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/text/MoveText.java
Tue Dec 30 00:40:38 2014
@@ -36,11 +36,10 @@ public class MoveText extends OperatorPr
     {
         COSNumber x = (COSNumber)arguments.get( 0 );
         COSNumber y = (COSNumber)arguments.get( 1 );
-        Matrix td = new Matrix();
-        td.setValue( 2, 0, x.floatValue() );
-        td.setValue( 2, 1, y.floatValue() );
-        context.setTextLineMatrix( td.multiply( context.getTextLineMatrix() ) );
-        context.setTextMatrix( context.getTextLineMatrix().clone() );
+
+        Matrix matrix = new Matrix(1, 0, 0, 1, x.floatValue(), y.floatValue());
+        context.getTextLineMatrix().concatenate(matrix);
+        context.setTextMatrix(context.getTextLineMatrix().clone());
     }
 
     @Override

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDRectangle.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDRectangle.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDRectangle.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDRectangle.java Tue
Dec 30 00:40:38 2014
@@ -290,16 +290,16 @@ public class PDRectangle implements COSO
         float x2 = getUpperRightX();
         float y2 = getUpperRightY();
 
-        Point2D p0 = matrix.transformPoint(x1, y1);
-        Point2D p1 = matrix.transformPoint(x2, y1);
-        Point2D p2 = matrix.transformPoint(x2, y2);
-        Point2D p3 = matrix.transformPoint(x1, y2);
+        Point2D.Float p0 = matrix.transformPoint(x1, y1);
+        Point2D.Float p1 = matrix.transformPoint(x2, y1);
+        Point2D.Float p2 = matrix.transformPoint(x2, y2);
+        Point2D.Float p3 = matrix.transformPoint(x1, y2);
 
         GeneralPath path = new GeneralPath();
-        path.moveTo((float) p0.getX(), (float) p0.getY());
-        path.lineTo((float) p1.getX(), (float) p1.getY());
-        path.lineTo((float) p2.getX(), (float) p2.getY());
-        path.lineTo((float) p3.getX(), (float) p3.getY());
+        path.moveTo(p0.getX(), p0.getY());
+        path.lineTo(p1.getX(), p1.getY());
+        path.lineTo(p2.getX(), p2.getY());
+        path.lineTo(p3.getX(), p3.getY());
         path.closePath();
         return path;
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDCalRGB.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDCalRGB.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDCalRGB.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDCalRGB.java
Tue Dec 30 00:40:38 2014
@@ -83,14 +83,25 @@ public class PDCalRGB extends PDCIEDicti
             float b = value[1];
             float c = value[2];
 
-            Matrix matrix = getMatrix();
             PDGamma gamma = getGamma();
-            double powAR = Math.pow(a, gamma.getR());
-            double powBG = Math.pow(b, gamma.getG());
-            double powCB = Math.pow(c, gamma.getB());
-            float x = (float) (matrix.getValue(0, 0) * powAR + matrix.getValue(0, 1) * powBG
+ matrix.getValue(0, 2) * powCB);
-            float y = (float) (matrix.getValue(1, 0) * powAR + matrix.getValue(1, 1) * powBG
+ matrix.getValue(1, 2) * powCB);
-            float z = (float) (matrix.getValue(2, 0) * powAR + matrix.getValue(2, 1) * powBG
+ matrix.getValue(2, 2) * powCB);
+            float powAR = (float)Math.pow(a, gamma.getR());
+            float powBG = (float)Math.pow(b, gamma.getG());
+            float powCB = (float)Math.pow(c, gamma.getB());
+
+            float[] matrix = getMatrix();
+            float mXA = matrix[0];
+            float mYA = matrix[1];
+            float mZA = matrix[2];
+            float mXB = matrix[3];
+            float mYB = matrix[4];
+            float mZB = matrix[5];
+            float mXC = matrix[6];
+            float mYC = matrix[7];
+            float mZC = matrix[8];
+
+            float x = mXA * powAR + mXB * powBG + mXC * powCB;
+            float y = mYA * powAR + mYB * powBG + mYC * powCB;
+            float z = mZA * powAR + mZB * powBG + mZC * powCB;
             return convXYZtoRGB(x, y, z);
         }
         else
@@ -122,20 +133,20 @@ public class PDCalRGB extends PDCIEDicti
     }
 
     /**
-     * Returns the linear interpretation matrix.
+     * Returns the linear interpretation matrix, which is an array of nine numbers.
      * If the underlying dictionary contains null then the identity matrix will be returned.
      * @return the linear interpretation matrix
      */
-    public final Matrix getMatrix()
+    public final float[] getMatrix()
     {
         COSArray matrix = (COSArray)dictionary.getDictionaryObject(COSName.MATRIX);
-        if(matrix == null)
+        if (matrix == null)
         {
-            return new Matrix();
+            return new float[] {  0, 0, 0, 1, 0, 0, 0, 1 };
         }
         else
         {
-           return new Matrix(matrix);
+           return matrix.toFloatArray();
         }
     }
 

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/form/PDFormXObject.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/form/PDFormXObject.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/form/PDFormXObject.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/form/PDFormXObject.java
Tue Dec 30 00:40:38 2014
@@ -23,7 +23,6 @@ import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSFloat;
 import org.apache.pdfbox.cos.COSName;
-import org.apache.pdfbox.cos.COSNumber;
 import org.apache.pdfbox.cos.COSStream;
 import org.apache.pdfbox.pdmodel.PDDocument;
 import org.apache.pdfbox.pdmodel.PDResources;
@@ -196,24 +195,16 @@ public class PDFormXObject extends PDXOb
     @Override
     public Matrix getMatrix()
     {
-        Matrix retval = null;
         COSArray array = (COSArray) getCOSStream().getDictionaryObject(COSName.MATRIX);
         if (array != null)
         {
-            retval = new Matrix();
-            retval.setValue(0, 0, ((COSNumber) array.get(0)).floatValue());
-            retval.setValue(0, 1, ((COSNumber) array.get(1)).floatValue());
-            retval.setValue(1, 0, ((COSNumber) array.get(2)).floatValue());
-            retval.setValue(1, 1, ((COSNumber) array.get(3)).floatValue());
-            retval.setValue(2, 0, ((COSNumber) array.get(4)).floatValue());
-            retval.setValue(2, 1, ((COSNumber) array.get(5)).floatValue());
+            return new Matrix(array);
         }
         else
         {
             // default value is the identity matrix
-            retval = new Matrix();
+            return new Matrix();
         }
-        return retval;
     }
 
     /**

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDAbstractPattern.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDAbstractPattern.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDAbstractPattern.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDAbstractPattern.java
Tue Dec 30 00:40:38 2014
@@ -177,24 +177,16 @@ public abstract class PDAbstractPattern
      */
     public Matrix getMatrix()
     {
-        Matrix matrix;
         COSArray array = (COSArray)getCOSDictionary().getDictionaryObject(COSName.MATRIX);
         if (array != null)
         {
-            matrix = new Matrix();
-            matrix.setValue(0, 0, ((COSNumber) array.get(0)).floatValue());
-            matrix.setValue(0, 1, ((COSNumber) array.get(1)).floatValue());
-            matrix.setValue(1, 0, ((COSNumber) array.get(2)).floatValue());
-            matrix.setValue(1, 1, ((COSNumber) array.get(3)).floatValue());
-            matrix.setValue(2, 0, ((COSNumber) array.get(4)).floatValue());
-            matrix.setValue(2, 1, ((COSNumber) array.get(5)).floatValue());
+            return new Matrix(array);
         }
         else
         {
             // default value is the identity matrix
-            matrix = new Matrix();
+            return new Matrix();
         }
-        return matrix;
     }
 
     /**

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDTilingPattern.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDTilingPattern.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDTilingPattern.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/pattern/PDTilingPattern.java
Tue Dec 30 00:40:38 2014
@@ -20,11 +20,9 @@ import org.apache.pdfbox.contentstream.P
 import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
-import org.apache.pdfbox.cos.COSNumber;
 import org.apache.pdfbox.cos.COSStream;
 import org.apache.pdfbox.pdmodel.PDResources;
 import org.apache.pdfbox.pdmodel.common.PDRectangle;
-import org.apache.pdfbox.util.Matrix;
 
 /**
  * A tiling pattern dictionary.
@@ -239,55 +237,4 @@ public class PDTilingPattern extends PDA
             getCOSDictionary().setItem( COSName.BBOX, bbox.getCOSArray() );
         }
     }
-
-    /**
-     * This will get the optional Matrix of a Pattern. It maps the form space to user space.
-     * @return the form matrix
-     */
-    @Override
-    public Matrix getMatrix()
-    {
-        //TODO this method can be deleted if the "repair mechanism for invalid matrices"
is deleted
-        Matrix matrix;
-        COSArray array = (COSArray)getCOSDictionary().getDictionaryObject(COSName.MATRIX);
-        if (array != null)
-        {
-            matrix = new Matrix();
-            matrix.setValue(0, 0, ((COSNumber) array.get(0)).floatValue());
-            matrix.setValue(0, 1, ((COSNumber) array.get(1)).floatValue());
-            matrix.setValue(1, 0, ((COSNumber) array.get(2)).floatValue());
-            matrix.setValue(1, 1, ((COSNumber) array.get(3)).floatValue());
-            matrix.setValue(2, 0, ((COSNumber) array.get(4)).floatValue());
-            matrix.setValue(2, 1, ((COSNumber) array.get(5)).floatValue());
-
-            // repair mechanism for invalid matrices, this is based on pure guesswork based
on the
-            // PoolCompPDFA.pdf from PDFBOX-1265 which renders fine in Acrobat despite having
a
-            // scaling factor of zero.
-            if (matrix.getScaleX() == 0)
-            {
-                matrix.setValue(0, 0, ((COSNumber) array.get(1)).floatValue()); // scale
x -> skew x
-                matrix.setValue(1, 0, 0); // skew x -> 0
-            }
-            if (matrix.getScaleY() == 0)
-            {
-                matrix.setValue(1, 1, ((COSNumber) array.get(2)).floatValue()); // scale
y -> skew y
-                matrix.setValue(0, 1, 0); // skew y -> 0
-            }
-            if (matrix.getScaleX() == 0)
-            {
-                matrix.setValue(0, 0, 1);
-            }
-            if (matrix.getScaleY() == 0)
-            {
-                matrix.setValue(1, 1, 1);
-            }
-        }
-        else
-        {
-            // default value is the identity matrix
-            matrix = new Matrix();
-        }
-        return matrix;
-    }
-
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/AxialShadingContext.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/AxialShadingContext.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/AxialShadingContext.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/AxialShadingContext.java
Tue Dec 30 00:40:38 2014
@@ -126,8 +126,8 @@ public class AxialShadingContext extends
         }
 
         // transform the distance to actual pixel space
-        double maxX = Math.abs(ctm.getXScale() * xform.getScaleX() * longestDistance);
-        double maxY = Math.abs(ctm.getYScale() * xform.getScaleY() * longestDistance);
+        double maxX = Math.abs(ctm.getScalingFactorX() * xform.getScaleX() * longestDistance);
+        double maxY = Math.abs(ctm.getScalingFactorY() * xform.getScaleY() * longestDistance);
         factor = (int) Math.max(maxX, maxY);
         colorTable = calcColorTable();
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PDShadingType1.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PDShadingType1.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PDShadingType1.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/PDShadingType1.java
Tue Dec 30 00:40:38 2014
@@ -23,7 +23,6 @@ import org.apache.pdfbox.cos.COSArray;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSFloat;
 import org.apache.pdfbox.cos.COSName;
-import org.apache.pdfbox.cos.COSNumber;
 import org.apache.pdfbox.util.Matrix;
 
 /**
@@ -60,14 +59,9 @@ public class PDShadingType1 extends PDSh
         COSArray array = (COSArray) getCOSDictionary().getDictionaryObject(COSName.MATRIX);
         if (array != null)
         {
-            matrix = new Matrix();
-            matrix.setValue(0, 0, ((COSNumber) array.get(0)).floatValue());
-            matrix.setValue(0, 1, ((COSNumber) array.get(1)).floatValue());
-            matrix.setValue(1, 0, ((COSNumber) array.get(2)).floatValue());
-            matrix.setValue(1, 1, ((COSNumber) array.get(3)).floatValue());
-            matrix.setValue(2, 0, ((COSNumber) array.get(4)).floatValue());
-            matrix.setValue(2, 1, ((COSNumber) array.get(5)).floatValue());
+            matrix = new Matrix(array);
         }
+        // todo: else return identity matrix?
         return matrix;
     }
 

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/RadialShadingContext.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/RadialShadingContext.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/RadialShadingContext.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/shading/RadialShadingContext.java
Tue Dec 30 00:40:38 2014
@@ -134,8 +134,8 @@ public class RadialShadingContext extend
         }
 
         // transform the distance to actual pixel space
-        double maxX = Math.abs(ctm.getXScale() * xform.getScaleX() * longestDistance);
-        double maxY = Math.abs(ctm.getYScale() * xform.getScaleY() * longestDistance);
+        double maxX = Math.abs(ctm.getScalingFactorX() * xform.getScaleX() * longestDistance);
+        double maxY = Math.abs(ctm.getScalingFactorY() * xform.getScaleY() * longestDistance);
         factor = (int) Math.max(maxX, maxY);
         colorTable = calcColorTable();
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Tue Dec
30 00:40:38 2014
@@ -660,9 +660,10 @@ public final class PageDrawer extends PD
     }
 
     @Override
-    public Point2D getCurrentPoint()
+    public Point2D.Float getCurrentPoint()
     {
-        return linePath.getCurrentPoint();
+        Point2D current = linePath.getCurrentPoint();
+        return new Point2D.Float((float)current.getX(), (float)current.getY());
     }
 
     @Override

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/text/TextPosition.java Tue Dec 30
00:40:38 2014
@@ -189,10 +189,10 @@ public final class TextPosition
      */
     public float getDir()
     {
-        float a = textMatrix.getValue(0,0);
-        float b = textMatrix.getValue(0,1);
-        float c = textMatrix.getValue(1,0);
-        float d = textMatrix.getValue(1,1);
+        float a = textMatrix.getScaleY();
+        float b = textMatrix.getShearY();
+        float c = textMatrix.getShearX();
+        float d = textMatrix.getScaleX();
 
         // 12 0   left to right
         // 0 12
@@ -232,19 +232,19 @@ public final class TextPosition
     {
         if (rotation == 0)
         {
-            return textMatrix.getValue(2,0);
+            return textMatrix.getTranslateX();
         }
         else if (rotation == 90)
         {
-            return textMatrix.getValue(2,1);
+            return textMatrix.getTranslateY();
         }
         else if (rotation == 180)
         {
-            return pageWidth - textMatrix.getValue(2,0);
+            return pageWidth - textMatrix.getTranslateX();
         }
         else if (rotation == 270)
         {
-            return pageHeight - textMatrix.getValue(2,1);
+            return pageHeight - textMatrix.getTranslateY();
         }
         return 0;
     }
@@ -283,19 +283,19 @@ public final class TextPosition
     {
         if (rotation == 0)
         {
-            return textMatrix.getValue(2,1);
+            return textMatrix.getTranslateY();
         }
         else if (rotation == 90)
         {
-            return pageWidth - textMatrix.getValue(2,0);
+            return pageWidth - textMatrix.getTranslateX();
         }
         else if (rotation == 180)
         {
-            return pageHeight - textMatrix.getValue(2,1);
+            return pageHeight - textMatrix.getTranslateY();
         }
         else if (rotation == 270)
         {
-            return textMatrix.getValue(2,0);
+            return textMatrix.getTranslateX();
         }
         return 0;
     }
@@ -437,7 +437,7 @@ public final class TextPosition
      */
     public float getXScale()
     {
-        return textMatrix.getXScale();
+        return textMatrix.getScalingFactorX();
     }
 
     /**
@@ -445,7 +445,7 @@ public final class TextPosition
      */
     public float getYScale()
     {
-        return textMatrix.getYScale();
+        return textMatrix.getScalingFactorY();
     }
 
     /**

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Matrix.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Matrix.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Matrix.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/util/Matrix.java Tue Dec 30 00:40:38
2014
@@ -32,9 +32,9 @@ public final class Matrix implements Clo
 {
     static final float[] DEFAULT_SINGLE =
     {
-        1,0,0,  //  a  b  0
-        0,1,0,  //  c  d  0
-        0,0,1   //  tx ty 1
+        1,0,0,  //  a  b  0     sx hy 0    note: hx and hy are reversed vs. the PDF spec
as we use
+        0,1,0,  //  c  d  0  =  hx sy 0          AffineTransform's definition x and y shear
+        0,0,1   //  tx ty 1     tx ty 1
     };
 
     private float[] single;
@@ -94,11 +94,10 @@ public final class Matrix implements Clo
      */
     public AffineTransform createAffineTransform()
     {
-        AffineTransform retval = new AffineTransform(
-            single[0], single[1],
-            single[3], single[4],
-            single[6], single[7] );
-        return retval;
+        return new AffineTransform(
+            single[0], single[1],   // m00 m10 = scaleX shearY
+            single[3], single[4],   // m01 m11 = shearX scaleY
+            single[6], single[7] ); // m02 m12 = tx ty
     }
 
     /**
@@ -455,14 +454,11 @@ public final class Matrix implements Clo
     }
 
     /**
-     * Get the x-scaling factor of this matrix. This is a deprecated method which actually
-     * returns the x-scaling factor multiplied by the x-shear.
+     * Returns the x-scaling factor of this matrix. This is calculated from the scale and
shear.
      *
-     * @return The x-scale.
-     * @deprecated Use {@link #getScaleX} instead
+     * @return The x-scaling factor.
      */
-    @Deprecated
-    public float getXScale()
+    public float getScalingFactorX()
     {
         float xScale = single[0];
 
@@ -492,14 +488,11 @@ public final class Matrix implements Clo
     }
 
     /**
-     * Get the y-scaling factor of this matrix. This is a deprecated method which actually
-     * returns the y-scaling factor multiplied by the y-shear.
+     * Returns the y-scaling factor of this matrix. This is calculated from the scale and
shear.
      *
-     * @return The y-scale factor.
-     * @deprecated Use {@link #getScaleY} instead
+     * @return The y-scaling factor.
      */
-    @Deprecated
-    public float getYScale()
+    public float getScalingFactorY()
     {
         float yScale = single[4];
         if( !(single[1]==0.0f && single[3]==0.0f) )
@@ -511,7 +504,7 @@ public final class Matrix implements Clo
     }
 
     /**
-     * Returns the x-scaling factor of this matrix.
+     * Returns the x-scaling element of this matrix.
      */
     public float getScaleX()
     {
@@ -519,7 +512,7 @@ public final class Matrix implements Clo
     }
 
     /**
-     * Returns the y-shear factor of this matrix.
+     * Returns the y-shear element of this matrix.
      */
     public float getShearY()
     {
@@ -527,7 +520,7 @@ public final class Matrix implements Clo
     }
 
     /**
-     * Returns the x-shear factor of this matrix.
+     * Returns the x-shear element of this matrix.
      */
     public float getShearX()
     {
@@ -535,7 +528,7 @@ public final class Matrix implements Clo
     }
 
     /**
-     * Returns the y-scaling factor of this matrix.
+     * Returns the y-scaling element of this matrix.
      */
     public float getScaleY()
     {
@@ -543,7 +536,7 @@ public final class Matrix implements Clo
     }
 
     /**
-     * Returns the x-translation of this matrix.
+     * Returns the x-translation element of this matrix.
      */
     public float getTranslateX()
     {
@@ -551,7 +544,7 @@ public final class Matrix implements Clo
     }
 
     /**
-     * Returns the y-translation of this matrix.
+     * Returns the y-translation element of this matrix.
      */
     public float getTranslateY()
     {

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ExtractImages.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ExtractImages.java?rev=1648454&r1=1648453&r2=1648454&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ExtractImages.java (original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/ExtractImages.java Tue Dec 30
00:40:38 2014
@@ -249,7 +249,7 @@ public class ExtractImages
         }
 
         @Override
-        public Point2D getCurrentPoint() throws IOException
+        public Point2D.Float getCurrentPoint() throws IOException
         {
             return new Point2D.Float(0, 0);
         }



Mime
View raw message