return true; }
public
LuminanceSource crop(int left, int top, int width, int height) {
return new
BufferedImageLuminanceSource(image, this.left + left,
this.top + top, width, height); }
public
boolean isRotateSupported() { return true; }
public
LuminanceSource rotateCounterClockwise() { int
sourceWidth = image.getWidth(); int
sourceHeight = image.getHeight();
AffineTransform transform = new AffineTransform(0.0, -1.0, 1.0,
0.0, 0.0, sourceWidth);
BufferedImage rotatedImage = new BufferedImage(sourceHeight,
sourceWidth,
BufferedImage.TYPE_BYTE_GRAY);
Graphics2D g
= rotatedImage.createGraphics();
g.drawImage(image, transform, null); g.dispose();
int width = getWidth();
return new
BufferedImageLuminanceSource(rotatedImage, top,
相关推荐: