简体   繁体   中英

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. I want to display it in a simple X11 window. Because it represents a screen scrape, it needs to be fast/near realtime (30 fps min). 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. Can anyone help? I just need a direct path:

data[] -> Pixmap -> paint into window.

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.

Thanks,

SW, PhM (PhD/ABD)

You can use XPutImage to send whole 2d raster image to a drawable (Pixmap or Window) in one request. You'll have to decode rle on the client before sending ( and also probably convert from rgb 565 to format x server support)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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