realtime data display

23 views
Skip to first unread message

Daniele Lugli

unread,
Nov 29, 2016, 4:04:34 AM11/29/16
to fltk.general
Dear all,

Using fltk I would like to display images coming asynchronously from a separate capture thread (c++11 std::thread, already coded and tested).

At present I'm doing something similar with wxwidgets. The capture thread prepares an entry in a shared ring buffer, then queues a custom event which is processed by an event handling function by the main loop.

What is the right way to do this with fltk?

Searching for "realtime data display" in this forum gave me mainly the following results:

https://groups.google.com/forum/#!topic/fltkgeneral/-bIjXnLQCL4%5B1-25%5D

dated 2013, and

https://groups.google.com/forum/#!searchin/fltkgeneral/realtime$20data$20display%7Csort:relevance/fltkgeneral/1hdwtbqDtV8/Ra846o0Ct28J

dated 2014.

Am I missing something more recent?
Have the long discussions been frozen to an up-to-date manual page / example / tutorial?

I also found this example from a camera vendor:

https://www.matrix-vision.com/manuals/SDK_CPP/SynchronousCaptureMultipleInputsFLTK_8cpp-example.html

but I am not sure how much it is to be trusted.

Any pointer / suggestion?

Thank you,

Daniele

Albrecht Schlosser

unread,
Nov 29, 2016, 6:08:12 AM11/29/16
to fltkg...@googlegroups.com
On 29.11.2016 10:04 Daniele Lugli wrote:

> Using fltk I would like to display images coming asynchronously from a
> separate capture thread (c++11 std::thread, already coded and tested).
>
> At present I'm doing something similar with wxwidgets. The capture
> thread prepares an entry in a shared ring buffer, then queues a custom
> event which is processed by an event handling function by the main loop.
>
> What is the right way to do this with fltk?

Technically it's the same, but see Ian's post for much more good
information.

> Am I missing something more recent?

Likely not.

> Have the long discussions been frozen to an up-to-date manual page /
> example / tutorial?

Did you see/read the "Advanced FLTK" chapter in the FLTK docs?
http://www.fltk.org/doc-1.3/advanced.html

That would be a good start and should answer most of your questions. It
has been improved very much since the discussions mentioned by you. I
think you should particularly have a look at calling Fl::awake( ... )
with a callback which is the most reliable and recommended way to send
informations from a worker thread to the main (GUI) thread and have the
main thread (in the callback) do the display update.

> Any pointer / suggestion?

The long threads you mentioned above may give you some hints, but again,
while I was writing this (and was interrupted for a while) Ian posted a
long reply, and I think he said it all...

Reply all
Reply to author
Forward
0 new messages