简体   繁体   English

挣扎于X11原始栅格

[英]Struggling with X11 raw raster

[Preface: I have looked off and on for a direct-path for this for a years now.] [前言:多年来,我一直在寻找直接的途径。]

I get raw raster (1024x600, RGB/565) from a remote device. 我从远程设备获取原始栅格(1024x600,RGB / 565)。 I want to display it in a simple X11 window. 我想在一个简单的X11窗口中显示它。 Because it represents a screen scrape, it needs to be fast/near realtime (30 fps min). 由于它代表屏幕刮擦,因此需要快速/接近实时(最小30 fps)。 I found a way to plug each pixel into a Pixmap/Bitmap, but there must be a way to hand the whole raster blob to Pixmap/Bitmap. 我找到了一种将每个像素插入Pixmap / Bitmap的方法,但是必须有一种将整个栅格Blob交给Pixmap / Bitmap的方法。 Can anyone help? 有人可以帮忙吗? I just need a direct path: 我只需要一条直接路径:

data[] -> Pixmap -> paint into window. data []-> Pixmap->绘制到窗口中。

uint8_t buffer[1024*600*2];
int byte_cnt = recv(client_sd, buffer, sizeof(buffer), MSG_WAITALL);
???; //--convert to Pixmap/Bitmap
???; //--paint in window

I cannot send a bitmap from the source, because I will run a simple RLE (run-length encoder) to speed data rates. 我无法从源发送位图,因为我将运行一个简单的RLE(行程编码器)以加快数据速率。

Thanks, 谢谢,

SW, PhM (PhD/ABD) 软件,博士学位(PhD / ABD)

You can use XPutImage to send whole 2d raster image to a drawable (Pixmap or Window) in one request. 您可以使用XPutImage在一个请求中将整个2d栅格图像发送到可绘制对象(Pixmap或Window)。 You'll have to decode rle on the client before sending ( and also probably convert from rgb 565 to format x server support) 发送之前,您必须在客户端上解码Rle(并且还可能从rgb 565转换为format x服务器支持)

If client and xserver are on the same physical machine (ei share same memory) you can speed up this with MIT-SHM extension - see XShmPutImage 如果客户端和xserver在同一台物理计算机上(EI共享相同的内存),则可以通过MIT-SHM扩展来加快速度-请参阅XShmPutImage

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM