Painting images using PixelWriter

Tobias Bley (UltraMixer) tobi at ultramixer.com
Mon Jun 4 14:06:35 PDT 2012


HI Jasper,

do you think it would be possible to change this to one shared buffer? IMO thats the big advantage of NIO buffers. So we could get a much better performance when showing webcam images or video frames. So I could query the webcam by JNI and fill in a Java IO buffer which is rendered by JavaFX. But if there is a need to copy the complete image every 40ms (framerate 25fps) the performance could be poor.

Best regards,
Tobi


--
Tobias Bley
Geschäftsführer/ Managing Director

------------------------------------------------------------------------

UltraMixer Digital Audio Solutions
Schillerstrasse 29
01326 Dresden

-------------------------------------------------------------------------
info at ultramixer.com 	      	 http://www.ultramixer.com

Am 04.06.2012 um 22:17 schrieb Jasper Potts:

> Hi,
> 
> There will always be at minimum one copy operation because JavaFX runs on two threads. So at the point when you set pixels a copy will be made so it can be safe to access that new copy from our internal render thread. So you can have your own ByteBuffer access from native and every time you call setPixels a copy will be taken for the JavaFX platform to use. So you will need to make sure the content is static during that setPixels (copy) operation.
> 
> Jasper
> 
> On Jun 4, 2012, at 2:06 AM, Tobias Bley wrote:
> 
>> Hi,
>> 
>> since JFX 2.2 there is the new class PixelWriter. Would it be possible to draw Images like from a webcam using a shared ByteBuffer (or IntBuffer)? Wo what I would like to do is to fill a shared ByteBuffer from C (with JNI) and use the same bytebuffer for the JavaFX Image object....
>> 
>> Best regards,
>> Tobi
>> 
>> 
>> 
>> -- 
>> Tobias Bley
>> Chief Executive Officer
>> 
>> --------------------------------------------------------
>> 
>> UltraMixer Digital Audio Solutions
>> Schillerstraße  29
>> D-01326 Dresden
>> Germany
>> 
>> --------------------------------------------------------
>> bley at ultramixer.com   http://www.ultramixer.com
>> 
>> 
>> 
> 



More information about the openjfx-dev mailing list