Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the fastest way to display an image in QT on X11 without OpenGL?

Tags:

linux

x11

qt

qt4

xlib

I need to display a raw image in a QT widget. I'm running X11 on a framebuffer, so OpenGL is not available.

Both the image and the framebuffer are in the same format - RGB565, but I can change it to any other format if needed. I don't need blending or scaling. I just need to display pixels as is.

I'm using QPainter::drawImage, but it converts QImage to QPixmap and this conversion seems to be very slow. Also it is backed by Xrender and I think there is unnecessary overhead required to support blending in Xrender which I don't really need

Is there any better way? If it is not available in QT, I can use Xlib or any other library or protocol. I can modify the driver, X server or anything else.

like image 352
msh Avatar asked Sep 14 '11 02:09

msh


1 Answers

did you try to use XPutImage? (or XShmPutImage if you going to transfer image more then once from client and have MIT-SHM extension available) Also look at video4linux webcam sample viewer.c, but they convert 565 to 16 or 24 bit depth before sending. For your setup it should be possible to send image without conversion

like image 110
Andrey Sidorov Avatar answered Sep 28 '22 04:09

Andrey Sidorov