PDA

View Full Version : Rapid Update of Pixmap



dbrmik
21st April 2009, 15:21
Hi

I am having problems updating and displaying a (8bit) pixmap using data provided by another thread. The pixmap is created from a Qimage. The QImage is created from binary data sent over ethernet link using udp protocol. The data is sent as 1k packets every 1 millisecond. (the QImage is 1k x 2k )

A seperate thread processes the network packets and emits a signal on every packet, the gui thread then updates the QImage with pixel data and a new pixmap is created with the new data and shown on a QLabel.

However the display cannot keep up with the network data rate. It appears that the QPixmap::fromImage(...) function is the bottleneck. This is called every 1ms (packet frequency). Any ideas on how to speed this up?

Regards

caduel
21st April 2009, 17:53
Well, you don't have displays this fast. Not to mention human eye+brain combination. So it's not really helpful to try to get a 1ms fast display.

Just update some internal data, and trigger an update of the pixmap every 20ms or so.
The illusion to human beings will be just fine and your hardware and Qt should be able to do that, too.

HTH

dbrmik
22nd April 2009, 14:17
Thanks Caduel

However I have tried that. The problem is the conversion from QImage to QPixmap taking too long (The image is 2k wide by 1k high) The QImage is constructed one vertical line at at time. I want to give the illusion of a rolling display .

I receive a vertical line of binary data every 1 millisecond over ethernet link using udp. A signal is emitted for every line that is received

I append this vertical line of data to the QImage and convert to Pixmap for display on a QLabel. This is taking far too long. Is there a better way? Is there a way to append each new vertical line of data to the pixamp without having to do the conversion from image to pixmap?

Thanks

dbrmik
23rd April 2009, 09:40
Hi

Struggling with this.

I need to update a pixmap line by line from raw data. Presently I convert from QImage for display on a label. Can anyone offer a better/quicker solution?

Regards

^NyAw^
23rd April 2009, 11:06
Hi,

Try using OpenGL.

dbrmik
23rd April 2009, 11:49
Hi

Is it not possible to update a pixmap line by line? Is it possible to paint slices of the Image as I receive them?

Regards