Examples of AffineTransform


Examples of ae.java.awt.geom.AffineTransform

             focus,
             fractions,
             colors,
             cycleMethod,
             ColorSpaceType.SRGB,
             new AffineTransform());
    }
View Full Code Here

Examples of chunmap.model.crs.transf.AffineTransform

  private Geometry getGeometry(CPoint p1, CPoint p2) {

    Vector v1 = new Vector(p1, p2);
    Vector v2 = new Vector(new Coordinate2D(0, 0), new Coordinate2D(0, 1));
    double angle = v1.computeAngle(v2);
    AffineTransform transf = AffineTransform.rotate(0, 0, angle + Math.PI
        / 2d);
    AffineTransform transf2 = transf.accumulate(AffineTransform.pan(p2
        .getX(), p2.getY()));
    return geometry.transform(transf2);
  }
View Full Code Here

Examples of com.google.code.appengine.awt.geom.AffineTransform

        m12 = py * (1.0 - m00) - px * m10;
        type = TYPE_UNKNOWN;
    }

    public static AffineTransform getTranslateInstance(double mx, double my) {
        AffineTransform t = new AffineTransform();
        t.setToTranslation(mx, my);
        return t;
    }
View Full Code Here

Examples of com.itextpdf.awt.geom.AffineTransform

     * @deprecated use com.itextpdf.text.geom.AffineTransform as parameter
     */
    public void addImage(final Image image, final java.awt.geom.AffineTransform transform) throws DocumentException {
      double matrix[] = new double[6];
      transform.getMatrix(matrix);
      addImage(image, new AffineTransform(matrix));
    }
View Full Code Here

Examples of com.jgraph.gaeawt.java.awt.geom.AffineTransform

    Rectangle normDstBounds = new Rectangle(0, 0, dstBounds.width,
        dstBounds.height);
    Rectangle bounds = getBounds2D(src).getBounds().intersection(
        normDstBounds);

    AffineTransform inv = null;
    try
    {
      inv = at.createInverse();
    }
    catch (NoninvertibleTransformException e)
    {
      return -1;
    }

    double[] m = new double[6];
    inv.getMatrix(m);

    int minSrcX = srcBounds.x;
    int minSrcY = srcBounds.y;
    int maxSrcX = srcBounds.x + srcBounds.width;
    int maxSrcY = srcBounds.y + srcBounds.height;
View Full Code Here

Examples of com.sk89q.worldedit.math.transform.AffineTransform

        Vector size = region.getMaximumPoint().subtract(region.getMinimumPoint()).add(1, 1, 1);
        Vector to = region.getMinimumPoint();
        ForwardExtentCopy copy = new ForwardExtentCopy(this, region, this, to);
        copy.setRepetitions(count);
        copy.setTransform(new AffineTransform().translate(dir.multiply(size)));
        if (!copyAir) {
            copy.setSourceMask(new ExistingBlockMask(this));
        }
        Operations.completeLegacy(copy);
        return copy.getAffected();
View Full Code Here

Examples of java.awt.geom.AffineTransform

    int width = old_img.getWidth();
    int height = old_img.getHeight();
    BufferedImage new_img = new BufferedImage(height,width,BufferedImage.TYPE_INT_RGB);       
        Graphics2D g2d =new_img.createGraphics();
       
        AffineTransform origXform = g2d.getTransform();
        AffineTransform newXform = (AffineTransform)(origXform.clone());
        // center of rotation is center of the panel
    double radian = 0;
        double xRot = 0;
        double yRot = 0;
    switch(orient){
    case 3:
      radian = 180.0;
      xRot = width/2.0;
      yRot = height/2.0;
    case 6:
      radian = 90.0;
          xRot = height/2.0;
          yRot = xRot;
      break;
    case 8:
      radian = 270.0;
          xRot = width/2.0;
          yRot = xRot;
          break;
        default:
          return false;
    }
        newXform.rotate(Math.toRadians(radian), xRot, yRot);

        g2d.setTransform(newXform);  
        // draw image centered in panel
        g2d.drawImage(old_img, 0, 0, null);
        // Reset to Original
View Full Code Here

Examples of java.awt.geom.AffineTransform

    int height = old_img.getHeight();
   
    BufferedImage new_img = new BufferedImage(height,width,BufferedImage.TYPE_INT_BGR);       
        Graphics2D g2d =new_img.createGraphics();
       
        AffineTransform origXform = g2d.getTransform();
        AffineTransform newXform = (AffineTransform)(origXform.clone());
        // center of rotation is center of the panel
        double xRot = width/2.0;
        newXform.rotate(Math.toRadians(270.0), xRot, xRot);

        g2d.setTransform(newXform);  
        // draw image centered in panel
        g2d.drawImage(old_img, 0, 0, null);
        // Reset to Original
View Full Code Here

Examples of java.awt.geom.AffineTransform

        g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
            smooth ? RenderingHints.VALUE_RENDER_QUALITY :
                RenderingHints.VALUE_RENDER_SPEED
        );

        AffineTransform at = AffineTransform.getScaleInstance(
            (double) w / width,
            (double) h / height
        );
        g2d.drawImage(image, at, null);
        g2d.dispose();
View Full Code Here

Examples of java.awt.geom.AffineTransform

        if (log.isDebugEnabled()) {
            log.debug("Generating SVG at " + deviceResolution + "dpi.");
        }

        final float uaResolution = userAgent.getSourceResolution();
        SVGUserAgent ua = new SVGUserAgent(userAgent, new AffineTransform());

        //Scale for higher resolution on-the-fly images from Batik
        double s = uaResolution / deviceResolution;
        AffineTransform resolutionScaling = new AffineTransform();
        resolutionScaling.scale(s, s);

        //Controls whether text painted by Batik is generated using text or path operations
        boolean strokeText = false;
        Configuration cfg = pdfInfo.cfg;
        if (cfg != null) {
            strokeText = cfg.getChild("stroke-text", true).getValueAsBoolean(strokeText);
        }

        BridgeContext ctx = new PDFBridgeContext(ua,
                (strokeText ? null : pdfInfo.fi),
                userAgent.getFactory().getImageManager(),
                userAgent.getImageSessionContext(),
                new AffineTransform());

        //Cloning SVG DOM as Batik attaches non-thread-safe facilities (like the CSS engine)
        //to it.
        Document clonedDoc = BatikUtil.cloneSVGDocument(doc);

        GraphicsNode root;
        try {
            GVTBuilder builder = new GVTBuilder();
            root = builder.build(ctx, clonedDoc);
        } catch (Exception e) {
            SVGEventProducer eventProducer = SVGEventProducer.Provider.get(
                    context.getUserAgent().getEventBroadcaster());
            eventProducer.svgNotBuilt(this, e, getDocumentURI(doc));
            return;
        }
        // get the 'width' and 'height' attributes of the SVG document
        float w = (float)ctx.getDocumentSize().getWidth() * 1000f;
        float h = (float)ctx.getDocumentSize().getHeight() * 1000f;

        float sx = pdfInfo.width / w;
        float sy = pdfInfo.height / h;

        //Scaling and translation for the bounding box of the image
        AffineTransform scaling = new AffineTransform(
                sx, 0, 0, sy, xOffset / 1000f, yOffset / 1000f);

        //Transformation matrix that establishes the local coordinate system for the SVG graphic
        //in relation to the current coordinate system
        AffineTransform imageTransform = new AffineTransform();
        imageTransform.concatenate(scaling);
        imageTransform.concatenate(resolutionScaling);

        /*
         * Clip to the svg area.
         * Note: To have the svg overlay (under) a text area then use
         * an fo:block-container
View Full Code Here
TOP
Copyright © 2015 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.