开发者

How can I create a JAI PlanarImage from a byte array raster?

开发者 https://www.devze.com 2022-12-26 03:39 出处:网络
I have an application that uses JAI to process i开发者_运维问答mages. It takes TIFF files, reads them, wraps the content into a SeekableStream then uses JAI.create to create the PlanarImage.

I have an application that uses JAI to process i开发者_运维问答mages. It takes TIFF files, reads them, wraps the content into a SeekableStream then uses JAI.create to create the PlanarImage.

What I want to do is change the source from TIFF files to a component, which already exists, and which serves me the image data in the form of a raster stored in a byte array. I know the format of the raster data (width, height, bits per sample etc.).But I can't find a way to create a PlanarImage for JAI in the same way as before.

My only idea is to create a java.awt.Image from the raster and use that with JAI.create. Is this OK, or is there a better solution?


You can use PlanarImage.wrap(bufferedImage) method.

Note: you can create bufferedImage from raster.

Furkan

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号