Java BufferedImage Operation findTranslation(AffineTransform at, BufferedImage bi)

Here you can find the source of findTranslation(AffineTransform at, BufferedImage bi)

Description

find Translation

License

Apache License

Declaration

private static AffineTransform findTranslation(AffineTransform at, BufferedImage bi) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.geom.AffineTransform;

import java.awt.geom.Point2D;

import java.awt.image.BufferedImage;

public class Main {
    private static AffineTransform findTranslation(AffineTransform at, BufferedImage bi) {
        Point2D p2din, p2dout;//from  ww  w .j  a  v a2s.  c o m

        p2din = new Point2D.Double(0.0, 0.0);
        p2dout = at.transform(p2din, null);
        double ytrans = p2dout.getY();

        p2din = new Point2D.Double(0, bi.getHeight());
        p2dout = at.transform(p2din, null);
        double xtrans = p2dout.getX();

        AffineTransform tat = new AffineTransform();
        tat.translate(-xtrans, -ytrans);
        return tat;
    }
}

Related

  1. findColor(BufferedImage image, int startX, int startY, int dirX, int dirY, int colorIndex)
  2. findDifference(BufferedImage img2, BufferedImage img1)
  3. findDominantColor(BufferedImage paramBufferedImage)
  4. findLegacyColorModel(BufferedImage image)
  5. findLegendLH(BufferedImage bufferedImage)
  6. fixImage(BufferedImage img, String ext)
  7. floatBufferToGrayBufferedImage(FloatBuffer floatBuffer, BufferedImage bi)
  8. floodFill(BufferedImage img, int startX, int startY, Color targetColor, Color replacementColor)
  9. fuzzyCompare(final BufferedImage img1, final BufferedImage img2, final double colorTolerance, final double pixelTolerance, final int fuzzyBlockDimension)