Example usage for com.itextpdf.awt.geom Point Point

List of usage examples for com.itextpdf.awt.geom Point Point

Introduction

In this page you can find the example usage for com.itextpdf.awt.geom Point Point.

Prototype

public Point(double x, double y) 

Source Link

Usage

From source file:mkl.testarea.itext5.pdfcleanup.PdfCleanUpRegionFilter.java

License:Open Source License

/**
 * @return Image boundary rectangle in device space.
 *///from   w w  w. j  av  a2  s .c  o  m
private Rectangle calcImageRect(ImageRenderInfo renderInfo) {
    Matrix ctm = renderInfo.getImageCTM();

    if (ctm == null) {
        return null;
    }

    Point2D[] points = transformPoints(ctm, false, new Point(0, 0), new Point(0, 1), new Point(1, 0),
            new Point(1, 1));
    return getRectangle(points[0], points[1], points[2], points[3]);
}

From source file:mkl.testarea.itext5.pdfcleanup.PdfCleanUpRegionFilter.java

License:Open Source License

/**
 * Transforms the given Rectangle into the image coordinate system which is [0,1]x[0,1] by default
 *///from  ww  w  . ja  v a2s.  c  om
private Rectangle transformIntersection(Matrix imageCTM, Rectangle rect) {
    Point2D[] points = transformPoints(imageCTM, true, new Point(rect.getLeft(), rect.getBottom()),
            new Point(rect.getLeft(), rect.getTop()), new Point(rect.getRight(), rect.getBottom()),
            new Point(rect.getRight(), rect.getTop()));
    return getRectangle(points[0], points[1], points[2], points[3]);
}