Search in sources :

Example 1 with AffineTransform

use of com.itextpdf.kernel.geom.AffineTransform in project i7j-pdfsweep by itext.

the class PdfCleanUpFilter method transformPoints.

private static Point[] transformPoints(Matrix transformationMatrix, boolean inverse, Point... points) {
    AffineTransform t = new AffineTransform(transformationMatrix.get(Matrix.I11), transformationMatrix.get(Matrix.I12), transformationMatrix.get(Matrix.I21), transformationMatrix.get(Matrix.I22), transformationMatrix.get(Matrix.I31), transformationMatrix.get(Matrix.I32));
    Point[] transformed = new Point[points.length];
    if (inverse) {
        try {
            t = t.createInverse();
        } catch (NoninvertibleTransformException e) {
            throw new PdfException(CleanupExceptionMessageConstant.NONINVERTIBLE_MATRIX_CANNOT_BE_PROCESSED, e);
        }
    }
    t.transform(points, 0, transformed, 0, points.length);
    return transformed;
}
Also used : NoninvertibleTransformException(com.itextpdf.kernel.geom.NoninvertibleTransformException) PdfException(com.itextpdf.kernel.exceptions.PdfException) AffineTransform(com.itextpdf.kernel.geom.AffineTransform) Point(com.itextpdf.kernel.geom.Point)

Aggregations

PdfException (com.itextpdf.kernel.exceptions.PdfException)1 AffineTransform (com.itextpdf.kernel.geom.AffineTransform)1 NoninvertibleTransformException (com.itextpdf.kernel.geom.NoninvertibleTransformException)1 Point (com.itextpdf.kernel.geom.Point)1