canvas - Passing an image from Java to JavaFX WebView -


i've got application window using javafx. window contains simple webview display html document. inside html document, there script tag, executing java function, returns pixels int[]. i'm using following code draw image onto canvas:

var context = canvas.getcontext('2d'); var imagedata = context.createimagedata(canvas.width, canvas.height); var buffer8 = new uint8clampedarray(imagedata.data.buffer); var buffer32 = new uint32array(imagedata.data.buffer); buffer32.set(pixels); context.putimagedata(imagedata, 0, 0); 

this works, performance 0.07 seconds per frame, giving me total of ~ 15 fps, using 640x480 canvas currently. goal @ last 30fps 1920x1080 (currently 5 fps), , higher values. solution come create/populate whole buffer @ once on java side, have no idea how manage that. appreciated.


Comments

Popular posts from this blog

javascript - How do you prevent nested queries/catches in sequelize? -

java - Could not retrieve pre-bound Hibernate session - Could not obtain transaction-synchronized Session for current thread -

ruby on rails - ActiveRecord order not working -