efficiently displaying a slowly varying image in XWindows/Linux

efficiently displaying a slowly varying image in XWindows/Linux

am 22.10.2005 02:16:15 von wgadsby

I'm trying to write a short program that receives slow-scan video data
over a COM port and displays it on an XWindows display in Linux. The
window continually updates as the data comes in. The video data is
grayscale and consists of one byte per pixel. One entire image takes
about five seconds to receive. Its dimensions are 320x240.

My first thought was to use Tk-Perl. However, it seems to be too slow.
It takes several seconds to display a single image, and updating one
line at a time does not seem to keep up with the data coming in. I've
tried completely updating the image every second or so, or updating
just one line at a time each time one comes in. If it could update a
complete image in 100 milliseconds or so, I could probably just use
Tk-Perl and update the view ten times per second. If it could update a
single line of data quickly enough, this would work as well. Neither
scheme seems to keep up with the data.

There are at least several other ways of displaying a complete image -
ImageMagick comes to mind. Usually the image must be complete before
displaying, and it is difficult to change small pieces at a time. The
usual procedure is to make a picture file, either in a local structure
or on disk, and display it completely each time something changes.
This is very inefficient.

I would like to find a simple way to create a blank window on the
XWindows workstation, then be able to manipulate individual pixels in
the window as data comes in. Manipulating one line at a time would be
fine too. The software needs to do this quickly, however, so that it
can keep up with data coming in.

I'm using a Pentium III, 800 MHz running Fedora Core 3.

Has anyone done anything similar in Perl. Any ideas as to where to
start? Thanks in advance for any suggestions.