java - 在 Java 中是否有比 AffineTransform 更有效的旋转图像的方法?

标签 java image awt bufferedimage

我四处寻找在 Java 中旋转 BufferedImage 的方法,我发现的只是 AffineTransform。这很好,但如果我只想旋转 90 度,那就有点矫枉过正了。逐个像素地进行处理会更有效吗?我还可以使用其他方法吗?

最佳答案

来自您提到的类的 Javadoc:

Handling 90-Degree Rotations

In some variations of the rotate methods in the AffineTransform class, a double-precision argument specifies the angle of rotation in radians. These methods have special handling for rotations of approximately 90 degrees (including multiples such as 180, 270, and 360 degrees), so that the common case of quadrant rotation is handled more efficiently.

这使得您似乎不必担心性能,除非有确凿的相反证据。

此外请注意以下方法:quadrantRotate(int numQuadrants)

关于java - 在 Java 中是否有比 AffineTransform 更有效的旋转图像的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25826838/

相关文章:

java - jOOQ 和 Spring 事务管理

javascript - WordPress - 将模板文件夹图像添加到 JavaScript

java - 在 switch 语句中使用 ctrl-z 撤消的未弃用方法

java - 我想在我的 JPanel 中实现 xuggle 播放的视频窗口?

java - 如何禁用 java.awt.Graphics.fillRect(int x, int y, int width, int height) 的效果?

java - @Controller 、 @RestController 和 @Component 在 Spring boot 多模块 maven 项目的子包中不起作用

java - CORBA 不清楚的东西

c# - 列表接口(interface) : from Java to C#

安卓 Facebook v4.0 发布图文

html - 无法在 Bootstrap 中对齐图像