I have a C++ library that does image processing on rectangular arrays of pixels. I want to pass the output C++ pixels to java so they can most effciently be "drawn" into a java.awt.Graphics2 instance for a canvas as an Image/Raster/(?) object( yeah not the best way but it is a legacy app )
I am looking for the best way to do this for performance, as the image can be "animated" and updates need to be reasonable.
The backing store for a
Rasterobject is aDataBuffer, which is an interface you can implement yourself. If you use aDirectByteBufferyou can effectively share a memory region between Java and the native world.