Canvas development: Difference between revisions

Jump to navigation Jump to search
m
→‎Adding new Placements: https://forum.flightgear.org/viewtopic.php?f=71&t=30642&p=297413#p297413
m (→‎Adding new Placements: https://forum.flightgear.org/viewtopic.php?f=71&t=30642&p=297413#p297413)
Line 1,937: Line 1,937:


=== Adding new Placements ===
=== Adding new Placements ===
{{WIP}}
Let's assume, we'd like to a new type of placement, one for treating any Canvas as a raster image that can be fetched via the built-in httpd server, or even streamed as a MJPEG.
For that to work, we need to be able fetch the Canvas, convert it to an osg::Image and then register the whole thing with the mongoose integration ($FG_SRC/Network/httpd), next we need to register a corresponding camera drawback to obtain the image, and notify the mongoose code to register a new handler and a class providing the corresponding image <ref>https://forum.flightgear.org/viewtopic.php?f=71&t=30642&p=297413#p297413</ref>.
In Canvas terms, the way a Canvas is placed is handled by a so called '''Placement''', a placement is just another class that responds to placement-specific events, mainly relevant property updates.
In this particular case, it wouldl make sense to support a handful of events/attributes:
* output format (png, jpeg, mjpeg)
* size of the image to be streamed (width/height)
* color depth
* name (to be used for requests)
* update frequency (usually, once or twice per second should suffice)


== Projections ==
== Projections ==

Navigation menu