Java 创建浮雕(红/蓝图像)
我正在编写一个 Java 游戏引擎 (http://victoryengine.org),并且我一直在尝试生成“3d” “戴上红/蓝眼镜就能看到具有深度的图像。 我正在使用 Java2D 进行图形处理。
我创建了一些可以工作的东西,但速度非常慢(通过手动复制像素值和类似的东西)。
我需要的是获取两个 BufferedImage(一个用于左眼,一个用于右眼)并将它们组合成一个(另一个缓冲区或直接到屏幕)。 对于一个,我只想要红色通道,对于另一个,我只想要绿色和蓝色通道。 最快的方法是什么?
I'm writing a Java game engine (http://victoryengine.org) and I've been experimenting with generating "3d" images with depth that you can see with those red/blue glasses. I'm using Java2D for graphics.
I've created something that works, but is very slow (by manually copying pixel values and stuff like that).
What I need to is take two BufferedImages (one for the left eye, one for the right) and combine them into one (either another buffer or directly to screen). For one I just want the red channel, and for the other one the green and blue ones. What's the fastest way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 JAI BandMerge 操作:
http://download.java.net/media/jai/javadoc/1.1.3/jai-apidocs/javax/media/jai/operator/BandMergeDescriptor.html
创建灰度立体对图像并使用波段合并将它们组合为最终图像中的红色和绿色通道。
Look ath the JAI BandMerge operation:
http://download.java.net/media/jai/javadoc/1.1.3/jai-apidocs/javax/media/jai/operator/BandMergeDescriptor.html
Create your stereoscopic pairs as greyscale images and use band merge to combine them as red and green channels in the final image.