Read canvas image by HTTP: Difference between revisions

Jump to navigation Jump to search
Line 149: Line 149:


== Implementation ==
== Implementation ==
What I did now roughly is:
This solution was created roughly by:
*adding a DrawCallback to the canvas camera
*adding a DrawCallback to the canvas camera
*attach an image to the canvas camera
*attach an image to the canvas camera
*duplicate Torstens http ScreenshotUriHandler to a CanvasImageUriHandler that subscribes to the callback in the canvas camera
*duplicate Torstens http ScreenshotUriHandler to a CanvasImageUriHandler that subscribes to the callback in the canvas camera


This works so far and I can grab ND images from my browser by http like a screenshot. And as you mentioned before, there are latencies and it isn't efficient. Just creating the PNG image from OSG takes up to 100ms. Using an uncomressed bitmap format like tiff results in 3MB image sies. Assuming a frame rate of 5 will be sufficient for displaying smooth instruments (which I doubt) this results in 15 image creations per second (for Captains PFD, ND and Eicas).
== Alternatives ==
 
There are possible alternative solutions for rendering canvases on a remote system, that remove the rendering load from the main flightgear process. These might be based on Nasal, Javascript, Python, etc.<ref>{{cite web
However, it is working and I will use this approach for my first setup and for some long running tests for checking for memory leaks and other problems. Probably there will be some fine tuning required.
And in the meantime I keep thinking about an external canvas drawing solution. Maybe I'll pursue the Nasal/Javascript approach, though my personal favorite is a Nasal/generic approach which allows implementing drawing in any environment like JavaScript/Python/Java aso.<ref>{{cite web
   |url    =  https://forum.flightgear.org/viewtopic.php?p=296627#p296627  
   |url    =  https://forum.flightgear.org/viewtopic.php?p=296627#p296627  
   |title  =  <nowiki> Re: Canvas remote drawing </nowiki>  
   |title  =  <nowiki> Re: Canvas remote drawing </nowiki>  
Line 165: Line 163:
   |script_version = 0.40  
   |script_version = 0.40  
   }}</ref>
   }}</ref>
One currently available solution is ..., created by James.


== Gallery ==
== Gallery ==
183

edits

Navigation menu