不使用OpenGL在X11上以QT显示图像的最快方法是什么? [英] What is the fastest way to display an image in QT on X11 without OpenGL?

查看:364
本文介绍了不使用OpenGL在X11上以QT显示图像的最快方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在QT小部件中显示原始图像.我在帧缓冲区上运行X11,因此OpenGL不可用.

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

图像和帧缓冲区的格式相同-RGB565,但是如果需要,我可以将其更改为任何其他格式.我不需要混合或缩放.我只需要按原样显示像素即可.

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.

我正在使用QPainter :: drawImage,但是它将QImage转换为QPixmap,这种转换似乎很慢.它也得到了Xrender的支持,我认为支持Xrender中的混合是不必要的,而我并不需要

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

还有更好的方法吗?如果它在QT中不可用,我可以使用Xlib或任何其他库或协议.我可以修改驱动程序,X服务器或其他任何东西.

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.

推荐答案

您尝试使用 XShmPutImage 如果要从客户端传输更多图像,然后再进行一次MIT-SHM可以使用扩展名).另请参见 video4linux网络摄像头示例查看器. c ,但是它们在发送前将565转换为16或24位深度.对于您的设置,应该可以发送未经转换的图像

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

这篇关于不使用OpenGL在X11上以QT显示图像的最快方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆