I am try to use this code to create a pixelbuffer:
val pixelBuffer = PixelBuffer(widths, heights, buffer, PixelFormat.getByteRgbInstance())
If I am running it, the constructor of PixelBuffer will throw a exception:Unsupported PixelFormat: BYTE_RGB
I see that these formats has been specifically implemented in the source code,but the constructor use a switch to filter them that make them will be never arrived.
switch (pixelFormat.getType()) {
case BYTE_BGRA_PRE:
...
case INT_ARGB_PRE:
...
default:
throw new IllegalArgumentException("Unsupported PixelFormat: " + pixelFormat.getType());
}
Why does javafx need to disable other format?