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

I need to display a raw image in QT widgets. I run X11 in a framebuffer, so OpenGL is not available.

Both images and framebuffer are in the same format - RGB565, but if necessary, I can change it to any other format. I do not need to mix or scale. I just need to display the pixels as is.

I use QPainter :: drawImage, but it converts QImage to QPixmap, and this conversion seems very slow. It is also supported by Xrender, and I think that unnecessary overhead is needed to support mixing in Xrender, which I really don't need.

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

+6
source share
2 answers

Have you tried using XPutImage ? (or XShmPutImage if you intend to transfer the image more than once from the client and have the extension MIT-SHM) Also look at video4linux webcam sample viewer.c , but they will convert 565 to 16 or 24-bit depth before sending. For your installation, it should be possible to send the image without conversion

+3
source

It might be worth setting the QT_GRAPHICSSYSTEM environment QT_GRAPHICSSYSTEM . I am having trouble rendering X11, becoming very, very slow. By setting QT_GRAPHICSSYSTEM = 'raster' QT rendering bypasses the X11 rendering engine, which can (as in my experience) be significantly more efficient. Other valid values ​​for QT_GRAPHICSSYSTEM are 'native' and 'opengl' , but 'raster' worked for me. I will be interested to know how you are doing.

+2
source

Source: https://habr.com/ru/post/897279/


All Articles