I have a java se 6 application which receive between 10 and 15 BufferedImage.
The app has to write these BufferedImage in shared memory in order to a C program to read it and display the images.
The problem is the images are big, from 1900*1600 to 800 * 600 and the transformation in byte[] with ImageIO take a long time: 50ms for the biggest images. I need this byte[] to write in the memory and ImageIo is the fastest way i found.
If i have 4 large images, it take 50 * 4 = 200 ms to refresh an image 🙁
Do you have any idea how i could improve it ?
Should i care about 1 image in 1 thread ? I will have 15 threads and the cpu is already working around 60%
instead of writing the images using imageio. have you tried GetPixels().
the imageio writes the data to a specific codec like TIFF / MJPEG.
what you need its the actual data (the pixels).
now you need to write the C code to be able to render pixels.
(how are you planning to pass the data to the C code? pointers???).