Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pixel-based graphics in linux terminal application

I'm developing a C++ application which will run on a headless server and keep track of some statistics. The application will run in a terminal in a screen session so that I can login over SSH and check those statistics.

Now, what I want to do, is display plots of various data. For that I need pixel-per-pixel access of course, which is not possible with ncurses or S-Lang. I found out about DirectFB (and it's C++ wrappers DFB++ & ++DFB), but can't seem to find conclusive evidence if it is possible to draw graphics with it inside a terminal.

Is DirectFB the way to go? Will it work fine inside a screen session without creating extra windows? If not, is there any library out there that can achieve what I want?

Edit: Ideally, I would of course prefer a library that has some kind of widget support as well, so that I don't have to create tons of classes to emulate text fields/scrollbars/...

like image 392
AVH Avatar asked Dec 23 '11 13:12

AVH


1 Answers

You could make your application have a web interface. You could use e.g. Wt or Onion to make your application an HTTP server (or you could make it a FastCgi application), and use SVG (perhaps with Javascript and Ajax tricks) to display vector graphics (or generate a pixel-based PNG or JPEG or GIF image; there are several libraries for that).

I don't think that DirectFB works with SSH, and I believe it is becoming deprecated (for example GTK3 don't support it anymore).

You might also generate Gnu Plot graphics (by generating the appropriate commands), but that is not very interactive.

I don't think that making graphics thru ssh without X make sense, unless you want only ASCII art (which I believe is not the right way for your needs).

like image 130
Basile Starynkevitch Avatar answered Sep 25 '22 17:09

Basile Starynkevitch