/**
* Mirrors the image horizontally (the left of the image becomes the right, and vice versa).
*
*/
public void mirrorHorizontally()
{
AffineTransform tx = AffineTransform.getScaleInstance(-1, 1);
tx.translate(-image.getWidth(null), 0);
AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
setImage(op.filter(image, null));
}
Graphics2D g2d = (Graphics2D)buffer.getAwtImage().getGraphics();
g2d.translate(buffer.getWidth(), 1);
g2d.scale(-1, 1);
g2d.drawImage(source.getAwtImage(), 0, 0, null);