Java BufferedImage Flip flipBothVerticallyAndHorizontallyWithAffineTransformOp(BufferedImage srcImage)

Here you can find the source of flipBothVerticallyAndHorizontallyWithAffineTransformOp(BufferedImage srcImage)

Description

flip Both Vertically And Horizontally With Affine Transform Op

License

Open Source License

Declaration

private static BufferedImage flipBothVerticallyAndHorizontallyWithAffineTransformOp(BufferedImage srcImage) 

Method Source Code

//package com.java2s;

import java.awt.image.BufferedImage;

import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;

public class Main {
    private static BufferedImage flipBothVerticallyAndHorizontallyWithAffineTransformOp(BufferedImage srcImage) {
        // equivalent to rotating the image 180 degrees
        AffineTransform tx = AffineTransform.getScaleInstance(-1, -1);
        tx.translate(-srcImage.getWidth(null), -srcImage.getHeight(null));
        AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
        return op.filter(srcImage, null);
    }/*from w ww. j a  va2 s  .  c o m*/
}

Related

  1. flip(BufferedImage image, boolean flipHorizontal, boolean flipVertical)
  2. flip(BufferedImage image, int direction)
  3. flip(BufferedImage myImage, int type)
  4. flipAroundX(BufferedImage image)
  5. flipBufferedImage(BufferedImage bufferedImage)
  6. flipBufferedImageVertically(BufferedImage bufferedImage)
  7. flipHorizontal(BufferedImage bufferedImage)
  8. flipHorizontally(BufferedImage srcImage)