在X中获取类似窗口的帧缓冲的最简单方法是什么?用Python?有了XCB吗?

时间:2013-11-05 00:49:37

标签: x11 framebuffer

我想以最简单的方式做的是获得一个像对象一样的简单帧缓冲区。

详细说明,我希望能够编写像

这样的代码
typedef struct {
   ...
   uint32_t stride; // Number of items to skip to get to same pixel on row below
   uint32_t *pixels; // Pixel data
   ...
} framebuffer_thing;

#define PX(x,y) ((stride * (y))+(x))

void updateFb(framebuffer_thing);

myfunc(framebuffer_thing f) {
  for(i=0;i<100;i++) f.fb[PX(10+i,20+i)]=0xff000000+i*0x00010000; // To write pixels into my buffer
  updateFb(f); // To update the display if necessary
}

理想情况下,我也希望从Python中交互使用它。有没有人知道执行此操作的代码已经有效,或者如何编写它?

0 个答案:

没有答案