Hello, everyone!
I need to read a BufferedImage
from file, which doesn't use DataBufferInt
(as normally), but DataBufferFloat
.
Please note: I don't just need some standalone DataBufferFloat
, but really a BufferedImage
with underlying DataBufferFloat
.
The API around these things is very complex, I just can't find how to do this.
Please help.
EDIT
Found out what is not working:
DataBufferDouble dbd = new DataBufferDouble(destWidth * destHeight * 4);
// Exception here:
// java.lang.IllegalArgumentException: Unsupported data type 5
WritableRaster wr = WritableRaster.createPackedRaster(
dbd, destWidth, destHeight, 32, new Point(0, 0));
BufferedImage bi = new BufferedImage(ColorModel.getRGBdefault(),
wr, false, (Hashtable<?, ?>) null);