Java BufferedImage Flip flipImage(BufferedImage image)

Here you can find the source of flipImage(BufferedImage image)

Description

flip Image

License

Open Source License

Declaration

private static BufferedImage flipImage(BufferedImage image) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    private static BufferedImage flipImage(BufferedImage image) {
        AffineTransform tx = AffineTransform.getScaleInstance(-1, 1);
        tx.translate(-(image.getWidth(null)), 0);
        AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
        return op.filter(image, null);
    }/*from   w  w w  . ja  v  a 2s  . c o m*/
}

Related

  1. flipBothVerticallyAndHorizontallyWithAffineTransformOp(BufferedImage srcImage)
  2. flipBufferedImage(BufferedImage bufferedImage)
  3. flipBufferedImageVertically(BufferedImage bufferedImage)
  4. flipHorizontal(BufferedImage bufferedImage)
  5. flipHorizontally(BufferedImage srcImage)
  6. flipImage(final BufferedImage image, final boolean horizontal, final boolean vertical)
  7. flipImage(Object original, boolean flipX, boolean flipY)
  8. flipImageHorizontally(BufferedImage image)
  9. flipImageVertically(BufferedImage theImage)