How to get raw pixel data into JavaFX

Philipp Dörfler phdoerfler at gmail.com
Wed Apr 29 14:21:50 UTC 2015


Hello list,

I got some very low level pixel data residing in memory with a pixel format and want to get that into JavaFX. I am talking about raw bytes, BGR, 24 bit per pixel etc..
The library providing this pixel data is OpenCV and although it allows for encoding the data into a standard format like ".bmp" or ".png" which then can be read by JavaFX, I would like to avoid this extra conversion process because I got some real time constraints.

As far as I understand this is what the PixelReader and PixelWriter interface is for. Is this correct? Where can I find additional information on how to use them besides the Javadoc? Would using the Canvas be easier? Can I somehow use the GraphicsContext of Canvas to do that?
I'd be grateful for any pointers even when it's just "check out the class XZY in the underlying prism code: <link to bitbucket>".

Thanks and best regards!

Philipp Dörfler


More information about the openjfx-dev mailing list