Java快速绘制图像
我有一个 BufferedImage,其颜色模型类型为 IndexColorModel。当我尝试使用 Graphics2D.drawImage() 绘制该图像时,大约需要 30 毫秒。但是,如果我首先将此图像转换为 DirectColorModel,则绘制只需要大约 3 毫秒。为了进行此转换,我调用
AffineTransformOp identityOp = new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_BILINEAR);
displayImage = identityOp.filter(displayImage, null);
This 将 displayImage 从 IndexColorModel 转换为 DirectColorModel。然而,这个过程大约需要25毫秒。
我的问题是如何更快地绘制 IndexColorModel 图像或快速转换为另一个可以更快绘制的 ColorModel?
谢谢
I have a BufferedImage which has a color model type of IndexColorModel. When I try and paint this image using Graphics2D.drawImage() it takes about 30 milliseconds. However, if I first convert this image to a DirectColorModel it only takes about 3 milliseconds to paint. In order to do this conversion I call
AffineTransformOp identityOp = new AffineTransformOp(new AffineTransform(), AffineTransformOp.TYPE_BILINEAR);
displayImage = identityOp.filter(displayImage, null);
This converts the displayImage from an IndexColorModel to a DirectColorModel. However, this process takes about 25 milliseconds.
My question is either how do I paint an IndexColorModel image faster or quickly convert to another ColorModel that I can paint faster?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论